summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>2004-09-19 01:30:12 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>2004-09-19 01:30:12 +0000
commitcd3148246dba71b06a1e732e4e16662f31650a1b (patch)
tree1994109a36cf421479bf77dbff6c1764b52db905 /sys/arch
parent91b4a91ab6fc3999940cb75dc638d8d2e66227fc (diff)
turn totalphysmem into physmem and name old physmem into smth it really is
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/hppa/dev/mem.c9
-rw-r--r--sys/arch/hppa/hppa/machdep.c16
-rw-r--r--sys/arch/hppa/hppa/pmap.c25
3 files changed, 23 insertions, 27 deletions
diff --git a/sys/arch/hppa/dev/mem.c b/sys/arch/hppa/dev/mem.c
index 9241bf785a2..c61f76a7329 100644
--- a/sys/arch/hppa/dev/mem.c
+++ b/sys/arch/hppa/dev/mem.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mem.c,v 1.25 2004/04/07 18:24:19 mickey Exp $ */
+/* $OpenBSD: mem.c,v 1.26 2004/09/19 01:30:11 mickey Exp $ */
/*
* Copyright (c) 1998-2004 Michael Shalayeff
@@ -325,7 +325,6 @@ mmrw(dev, uio, flags)
struct uio *uio;
int flags;
{
- extern u_int totalphysmem;
struct iovec *iov;
vaddr_t v, o;
int error = 0;
@@ -346,12 +345,12 @@ mmrw(dev, uio, flags)
/* If the address isn't in RAM, bail. */
v = uio->uio_offset;
- if (btoc(v) > totalphysmem) {
+ if (btoc(v) > physmem) {
error = EFAULT;
/* this will break us out of the loop */
continue;
}
- c = ctob(totalphysmem) - v;
+ c = ctob(physmem) - v;
c = min(c, uio->uio_resid);
error = uiomove((caddr_t)v, c, uio);
break;
@@ -360,7 +359,7 @@ mmrw(dev, uio, flags)
v = uio->uio_offset;
o = v & PGOFSET;
c = min(uio->uio_resid, (int)(PAGE_SIZE - o));
- if (btoc(v) > totalphysmem && !uvm_kernacc((caddr_t)v,
+ if (btoc(v) > physmem && !uvm_kernacc((caddr_t)v,
c, (uio->uio_rw == UIO_READ) ? B_READ : B_WRITE)) {
error = EFAULT;
/* this will break us out of the loop */
diff --git a/sys/arch/hppa/hppa/machdep.c b/sys/arch/hppa/hppa/machdep.c
index 6d23ab74c06..3ef6ac60e54 100644
--- a/sys/arch/hppa/hppa/machdep.c
+++ b/sys/arch/hppa/hppa/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.136 2004/09/18 05:06:17 mickey Exp $ */
+/* $OpenBSD: machdep.c,v 1.137 2004/09/19 01:30:11 mickey Exp $ */
/*
* Copyright (c) 1999-2003 Michael Shalayeff
@@ -153,7 +153,7 @@ int (*cpu_dbtlb_ins)(int i, pa_space_t sp, vaddr_t va, paddr_t pa,
vsize_t sz, u_int prot);
dev_t bootdev;
-int totalphysmem, resvmem, physmem, esym;
+int physmem, resvmem, resvphysmem, esym;
paddr_t avail_end;
/*
@@ -360,7 +360,7 @@ hppa_init(start)
avail_end = trunc_page(PAGE0->imm_max_mem);
if (avail_end > SYSCALLGATE)
avail_end = SYSCALLGATE;
- totalphysmem = btoc(avail_end);
+ physmem = btoc(avail_end);
resvmem = btoc(((vaddr_t)&kernel_text));
/* we hope this won't fail */
@@ -377,8 +377,8 @@ hppa_init(start)
/* buffer cache parameters */
if (bufpages == 0)
- bufpages = totalphysmem / 100 *
- (totalphysmem <= 0x1000? 5 : bufcachepercent);
+ bufpages = physmem / 100 *
+ (physmem <= 0x1000? 5 : bufcachepercent);
if (nbuf == 0)
nbuf = bufpages < 16? 16 : bufpages;
@@ -412,7 +412,7 @@ hppa_init(start)
v += round_page(MSGBUFSIZE);
bzero(msgbufp, MSGBUFSIZE);
- /* sets physmem */
+ /* sets resvphysmem */
pmap_bootstrap(v);
msgbufmapped = 1;
@@ -648,7 +648,7 @@ cpu_startup(void)
printf("%s\n", cpu_model);
printf("real mem = %d (%d reserved for PROM, %d used by OpenBSD)\n",
- ctob(totalphysmem), ctob(resvmem), ctob(physmem - resvmem));
+ ctob(physmem), ctob(resvmem), ctob(resvphysmem - resvmem));
size = MAXBSIZE * nbuf;
if (uvm_map(kernel_map, &minaddr, round_page(size),
@@ -1113,7 +1113,7 @@ dumpsys(void)
if (!(error = cpu_dump())) {
- bytes = ctob(totalphysmem);
+ bytes = ctob(physmem);
maddr = NULL;
blkno = dumplo + cpu_dumpsize();
dump = bdevsw[major(dumpdev)].d_dump;
diff --git a/sys/arch/hppa/hppa/pmap.c b/sys/arch/hppa/hppa/pmap.c
index 5f49271e576..355fec12680 100644
--- a/sys/arch/hppa/hppa/pmap.c
+++ b/sys/arch/hppa/hppa/pmap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pmap.c,v 1.120 2004/09/18 06:43:23 mickey Exp $ */
+/* $OpenBSD: pmap.c,v 1.121 2004/09/19 01:30:11 mickey Exp $ */
/*
* Copyright (c) 1998-2004 Michael Shalayeff
@@ -435,8 +435,8 @@ void
pmap_bootstrap(vstart)
vaddr_t vstart;
{
- extern int etext, __rodata_end, __data_start;
- extern u_int totalphysmem, *ie_mem;
+ extern int resvphysmem, etext, __rodata_end, __data_start;
+ extern u_int *ie_mem;
extern paddr_t hppa_vtop;
vaddr_t va, addr = hppa_round_page(vstart), t;
vsize_t size;
@@ -536,11 +536,11 @@ pmap_bootstrap(vstart)
}
/* kernel virtual is the last gig of the moohicans */
- nkpdes = totalphysmem >> 14; /* at least 16/gig for kmem */
+ nkpdes = physmem >> 14; /* at least 16/gig for kmem */
if (nkpdes < 4)
nkpdes = 4; /* ... but no less than four */
nkpdes += HPPA_IOLEN / PDE_SIZE; /* ... and io space too */
- npdes = nkpdes + (totalphysmem + btoc(PDE_SIZE) - 1) / btoc(PDE_SIZE);
+ npdes = nkpdes + (physmem + btoc(PDE_SIZE) - 1) / btoc(PDE_SIZE);
/* map the pdes */
for (va = 0; npdes--; va += PDE_SIZE, addr += PAGE_SIZE) {
@@ -557,13 +557,13 @@ pmap_bootstrap(vstart)
kpm->pm_stats.resident_count++; /* count PTP as resident */
}
- physmem = atop(addr);
- DPRINTF(PDB_INIT, ("physmem: 0x%x - 0x%x\n", physmem, totalphysmem));
- uvm_page_physload(0, totalphysmem,
- physmem, totalphysmem, VM_FREELIST_DEFAULT);
+ resvphysmem = atop(addr);
+ DPRINTF(PDB_INIT, ("physmem: 0x%x - 0x%x\n", resvphysmem, physmem));
+ uvm_page_physload(0, physmem,
+ resvphysmem, physmem, VM_FREELIST_DEFAULT);
/* TODO optimize/inline the kenter */
- for (va = 0; va < ptoa(totalphysmem); va += PAGE_SIZE) {
+ for (va = 0; va < ptoa(physmem); va += PAGE_SIZE) {
extern struct user *proc0paddr;
vm_prot_t prot = UVM_PROT_RW;
@@ -1218,9 +1218,6 @@ pmap_kremove(va, size)
vaddr_t va;
vsize_t size;
{
-#ifdef PMAPDEBUG
- extern u_int totalphysmem;
-#endif
struct pv_entry *pve;
vaddr_t eva, pdemask;
volatile pt_entry_t *pde;
@@ -1230,7 +1227,7 @@ pmap_kremove(va, size)
DPRINTF(PDB_FOLLOW|PDB_REMOVE,
("pmap_kremove(%x, %x)\n", va, size));
#ifdef PMAPDEBUG
- if (va < ptoa(totalphysmem)) {
+ if (va < ptoa(physmem)) {
printf("pmap_kremove(%x, %x): unmapping physmem\n", va, size);
return;
}