fix sign extension bug (thanks, charles!). the proper fix to this is to change PGSZ to be signed, but i wanted to get something in quickly. Reference: /n/atom/patch/applied/mmusign Date: Fri Aug 14 15:21:27 CES 2015 Signed-off-by: quanstro@quanstro.net --- /sys/src/nix/k10/mmu.c Fri Aug 14 15:20:47 2015 +++ /sys/src/nix/k10/mmu.c Fri Aug 14 15:20:48 2015 @@ -14,7 +14,7 @@ * mmuptcopy (PteSHARED trick?); */ -#define PPN(x) ((x)&~(PGSZ-1)) +#define PPN(x) ((x)&~(uintmem)(PGSZ-1)) /* * set up a pat mappings. the system depends @@ -692,7 +692,7 @@ */ typedef struct Remap Remap; struct Remap { - uintmem map[300]; + uintmem map[600]; usize n; }; static Remap smap; @@ -703,7 +703,8 @@ int i, o; uintmem pa, p; - o = pa0 - (pa0 & ~(PGSZ-1)); +// iprint("vmapoverlap(%#P, %#lux)\n", pa0, sz); + o = pa0 - (pa0 & ~(uintmem)(PGSZ-1)); pa = pa0 - o; sz = ROUNDUP(sz+o, PGSZ);