diff options
-rw-r--r-- | sys/amd64/amd64/machdep.c | 13 | ||||
-rw-r--r-- | sys/amd64/amd64/pmap.c | 3 | ||||
-rw-r--r-- | sys/amd64/include/pmap.h | 1 | ||||
-rw-r--r-- | sys/i386/i386/machdep.c | 13 | ||||
-rw-r--r-- | sys/i386/i386/pmap.c | 1 | ||||
-rw-r--r-- | sys/i386/include/pmap.h | 1 |
6 files changed, 13 insertions, 19 deletions
diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c index 67469e0..f0a6239 100644 --- a/sys/amd64/amd64/machdep.c +++ b/sys/amd64/amd64/machdep.c @@ -833,7 +833,7 @@ u_int basemem; static void getmemsize(caddr_t kmdp, u_int64_t first) { - int i, physmap_idx, pa_indx, da_indx; + int i, off, physmap_idx, pa_indx, da_indx; vm_paddr_t pa, physmap[PHYSMAP_SIZE]; u_long physmem_tunable; pt_entry_t *pte; @@ -1096,14 +1096,17 @@ do_next: /* Trim off space for the message buffer. */ phys_avail[pa_indx] -= round_page(MSGBUF_SIZE); - avail_end = phys_avail[pa_indx]; + /* Map the message buffer. */ + for (off = 0; off < round_page(MSGBUF_SIZE); off += PAGE_SIZE) + pmap_kenter((vm_offset_t)msgbufp + off, phys_avail[pa_indx] + + off); } u_int64_t hammer_time(u_int64_t modulep, u_int64_t physfree) { caddr_t kmdp; - int gsel_tss, off, x; + int gsel_tss, x; struct pcpu *pc; u_int64_t msr; char *env; @@ -1270,10 +1273,6 @@ hammer_time(u_int64_t modulep, u_int64_t physfree) /* now running on new page tables, configured,and u/iom is accessible */ - /* Map the message buffer. */ - for (off = 0; off < round_page(MSGBUF_SIZE); off += PAGE_SIZE) - pmap_kenter((vm_offset_t)msgbufp + off, avail_end + off); - msgbufinit(msgbufp, MSGBUF_SIZE); fpuinit(); diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index 7a8b672..1e796f8 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -168,8 +168,7 @@ __FBSDID("$FreeBSD$"); struct pmap kernel_pmap_store; -vm_paddr_t avail_start; /* PA of first available physical page */ -vm_paddr_t avail_end; /* PA of last available physical page */ +static vm_paddr_t avail_start; /* PA of first available physical page */ vm_offset_t virtual_avail; /* VA of first avail page (after kernel bss) */ vm_offset_t virtual_end; /* VA of last avail page (end of kernel AS) */ diff --git a/sys/amd64/include/pmap.h b/sys/amd64/include/pmap.h index df89589..24103c1 100644 --- a/sys/amd64/include/pmap.h +++ b/sys/amd64/include/pmap.h @@ -296,7 +296,6 @@ extern struct ppro_vmtrr PPro_vmtrr[NPPROVMTRR]; extern caddr_t CADDR1; extern pt_entry_t *CMAP1; -extern vm_paddr_t avail_end; extern vm_paddr_t phys_avail[]; extern vm_paddr_t dump_avail[]; extern vm_offset_t virtual_avail; diff --git a/sys/i386/i386/machdep.c b/sys/i386/i386/machdep.c index bff17e6..c416c38 100644 --- a/sys/i386/i386/machdep.c +++ b/sys/i386/i386/machdep.c @@ -1608,7 +1608,7 @@ sdtossd(sd, ssd) static void getmemsize(int first) { - int i, physmap_idx, pa_indx, da_indx; + int i, off, physmap_idx, pa_indx, da_indx; int hasbrokenint12, has_smap; u_long physmem_tunable; u_int extmem; @@ -2036,7 +2036,10 @@ do_next: /* Trim off space for the message buffer. */ phys_avail[pa_indx] -= round_page(MSGBUF_SIZE); - avail_end = phys_avail[pa_indx]; + /* Map the message buffer. */ + for (off = 0; off < round_page(MSGBUF_SIZE); off += PAGE_SIZE) + pmap_kenter((vm_offset_t)msgbufp + off, phys_avail[pa_indx] + + off); } void @@ -2044,7 +2047,7 @@ init386(first) int first; { struct gate_descriptor *gdp; - int gsel_tss, metadata_missing, off, x; + int gsel_tss, metadata_missing, x; struct pcpu *pc; thread0.td_kstack = proc0kstack; @@ -2269,10 +2272,6 @@ init386(first) /* now running on new page tables, configured,and u/iom is accessible */ - /* Map the message buffer. */ - for (off = 0; off < round_page(MSGBUF_SIZE); off += PAGE_SIZE) - pmap_kenter((vm_offset_t)msgbufp + off, avail_end + off); - msgbufinit(msgbufp, MSGBUF_SIZE); /* make a call gate to reenter kernel with */ diff --git a/sys/i386/i386/pmap.c b/sys/i386/i386/pmap.c index c4b2032..a1de346 100644 --- a/sys/i386/i386/pmap.c +++ b/sys/i386/i386/pmap.c @@ -196,7 +196,6 @@ LIST_HEAD(pmaplist, pmap); static struct pmaplist allpmaps; static struct mtx allpmaps_lock; -vm_paddr_t avail_end; /* PA of last available physical page */ vm_offset_t virtual_avail; /* VA of first avail page (after kernel bss) */ vm_offset_t virtual_end; /* VA of last avail page (end of kernel AS) */ int pgeflag = 0; /* PG_G or-in */ diff --git a/sys/i386/include/pmap.h b/sys/i386/include/pmap.h index 996795f..02adbb5 100644 --- a/sys/i386/include/pmap.h +++ b/sys/i386/include/pmap.h @@ -361,7 +361,6 @@ extern struct ppro_vmtrr PPro_vmtrr[NPPROVMTRR]; extern caddr_t CADDR1; extern pt_entry_t *CMAP1; -extern vm_paddr_t avail_end; extern vm_paddr_t phys_avail[]; extern vm_paddr_t dump_avail[]; extern int pseflag; |