summaryrefslogtreecommitdiffstats
path: root/sys/amd64
diff options
context:
space:
mode:
authoralc <alc@FreeBSD.org>2006-11-19 20:54:58 +0000
committeralc <alc@FreeBSD.org>2006-11-19 20:54:58 +0000
commitb2f49e89dfec75e07cb3b542600531e1860a899d (patch)
tree891657095fe5bdd2f00ff4991286a5bf89a91acb /sys/amd64
parenta8077682d09327ba1bd27f42262428f912eb8aba (diff)
downloadFreeBSD-src-b2f49e89dfec75e07cb3b542600531e1860a899d.zip
FreeBSD-src-b2f49e89dfec75e07cb3b542600531e1860a899d.tar.gz
The global variable avail_end is redundant and only used once. Eliminate
it. Make avail_start static to the pmap on amd64. (It no longer exists on other architectures.)
Diffstat (limited to 'sys/amd64')
-rw-r--r--sys/amd64/amd64/machdep.c13
-rw-r--r--sys/amd64/amd64/pmap.c3
-rw-r--r--sys/amd64/include/pmap.h1
3 files changed, 7 insertions, 10 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;
OpenPOWER on IntegriCloud