diff options
-rw-r--r-- | sys/src/9/pc64/l.s | 13 | ||||
-rw-r--r-- | sys/src/9/pc64/mem.h | 1 | ||||
-rw-r--r-- | sys/src/9/pc64/memory.c | 4 |
3 files changed, 12 insertions, 6 deletions
diff --git a/sys/src/9/pc64/l.s b/sys/src/9/pc64/l.s index 78171a114..94356a9fb 100644 --- a/sys/src/9/pc64/l.s +++ b/sys/src/9/pc64/l.s @@ -144,13 +144,20 @@ TEXT _warp64<>(SB), 1, $-4 MOVL $(PTESIZE|PTEGLOBAL|PTEWRITE|PTEVALID), DX MOVL DX, PDO(0)(AX) /* PDE for double-map */ + /* + * map from KZERO to end using 2MB pages + */ ADDL $PDO(KZERO), AX + MOVL $end-KZERO(SB), CX + ADDL $(PGLSZ(1)-1), CX + ANDL $~(PGLSZ(1)-1), CX + MOVL CX, MemMin-KZERO(SB) /* see memory.c */ + SHRL $(1*PTSHIFT+PGSHIFT), CX memloop: - MOVL DX, 0(AX) + MOVL DX, (AX) ADDL $PGLSZ(1), DX ADDL $8, AX - CMPL DX, $INIMAP - JLT memloop + LOOP memloop /* * Enable and activate Long Mode. From the manual: diff --git a/sys/src/9/pc64/mem.h b/sys/src/9/pc64/mem.h index acbbff43d..0a82a378d 100644 --- a/sys/src/9/pc64/mem.h +++ b/sys/src/9/pc64/mem.h @@ -79,7 +79,6 @@ #define CPU0END (CPU0MACH+MACHSIZE) #define MACHSIZE (2*KSTACK) -#define INIMAP (8*MiB) /* 4 pages; size of inital map in l.s */ /* * known x86 segments (in GDT) and their selectors diff --git a/sys/src/9/pc64/memory.c b/sys/src/9/pc64/memory.c index a4ff047d6..349133976 100644 --- a/sys/src/9/pc64/memory.c +++ b/sys/src/9/pc64/memory.c @@ -12,6 +12,8 @@ #include "io.h" #include "ureg.h" +u32int MemMin; /* set by l.s */ + #define MEMDEBUG 0 enum { @@ -22,8 +24,6 @@ enum { NMemType = 4, KB = 1024, - - MemMin = INIMAP, }; typedef struct Map Map; |