]> git.lizzy.rs Git - plan9front.git/blobdiff - sys/src/9/bcm/mmu.c
kernel: reduce Page structure size by changing Page.cachectl[]
[plan9front.git] / sys / src / 9 / bcm / mmu.c
index 8eba6e1d35b7320cf70de50fc220a9a350348d01..f068b387c4e9aa962a62591f4dc13f49a816ff12 100644 (file)
@@ -265,10 +265,9 @@ putmmu(uintptr va, uintptr pa, Page* page)
         *  rather than direct mapped.
         */
        cachedwbinv();
-       if(page->cachectl[0] == PG_TXTFLUSH){
-               /* pio() sets PG_TXTFLUSH whenever a text pg has been written */
+       if(page->txtflush){
                cacheiinv();
-               page->cachectl[0] = PG_NOFLUSH;
+               page->txtflush = 0;
        }
        checkmmu(va, PPN(pa));
 }
@@ -305,7 +304,7 @@ mmukmap(uintptr va, uintptr pa, usize size)
                *pte++ = (pa+n)|Dom0|L1AP(Krw)|Section;
                mmuinvalidateaddr(va+n);
        }
-       cachedwbse(pte0, pte - pte0);
+       cachedwbse(pte0, (uintptr)pte - (uintptr)pte0);
        return va + o;
 }