diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2004-05-07 15:30:05 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2004-05-07 15:30:05 +0000 |
commit | b261d1b50cbbf544ee5c5f393b3449bd2910aa61 (patch) | |
tree | 26db7c33032444c7db1fbf8448b6221313e06421 /sys/arch/mvme88k | |
parent | 5fee1be7378b44e66f3c3abf36ba646589767c2d (diff) |
Do not rely upon a fictitious MAXPHYSMEM value, but rather the actual
physical memory size, to decide the end of /dev/*mem, as well as default
cacheability for mappings.
Diffstat (limited to 'sys/arch/mvme88k')
-rw-r--r-- | sys/arch/mvme88k/mvme88k/mem.c | 5 | ||||
-rw-r--r-- | sys/arch/mvme88k/mvme88k/pmap.c | 7 |
2 files changed, 7 insertions, 5 deletions
diff --git a/sys/arch/mvme88k/mvme88k/mem.c b/sys/arch/mvme88k/mvme88k/mem.c index 85004ea86da..4b0eee2d46c 100644 --- a/sys/arch/mvme88k/mvme88k/mem.c +++ b/sys/arch/mvme88k/mvme88k/mem.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mem.c,v 1.19 2003/10/05 20:27:47 miod Exp $ */ +/* $OpenBSD: mem.c,v 1.20 2004/05/07 15:30:04 miod Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -52,6 +52,7 @@ #include <uvm/uvm_extern.h> caddr_t zeropage; +extern vaddr_t last_addr; #define mmread mmrw #define mmwrite mmrw @@ -127,7 +128,7 @@ mmrw(dev, uio, flags) case 0: /* move one page at a time */ v = uio->uio_offset; - if (v > MAXPHYSMEM) { + if (v > last_addr) { error = EFAULT; goto unlock; } diff --git a/sys/arch/mvme88k/mvme88k/pmap.c b/sys/arch/mvme88k/mvme88k/pmap.c index 5f534392618..3d3e5d99cd4 100644 --- a/sys/arch/mvme88k/mvme88k/pmap.c +++ b/sys/arch/mvme88k/mvme88k/pmap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pmap.c,v 1.113 2004/05/07 08:00:16 miod Exp $ */ +/* $OpenBSD: pmap.c,v 1.114 2004/05/07 15:30:04 miod Exp $ */ /* * Copyright (c) 2001, 2002, 2003 Miodrag Vallat * Copyright (c) 1998-2001 Steve Murphree, Jr. @@ -68,6 +68,7 @@ */ extern vaddr_t avail_start; extern vaddr_t virtual_avail, virtual_end; +extern vaddr_t last_addr; /* * Macros to operate pm_cpus field @@ -1921,7 +1922,7 @@ pmap_enter(pmap_t pmap, vaddr_t va, paddr_t pa, vm_prot_t prot, int flags) if (wired) template |= PG_W; - if ((unsigned long)pa >= MAXPHYSMEM) + if ((unsigned long)pa >= last_addr) template |= CACHE_INH; else template |= CACHE_GLOBAL; @@ -2689,7 +2690,7 @@ pmap_kenter_pa(vaddr_t va, paddr_t pa, vm_prot_t prot) kernel_pmap->pm_stats.wired_count++; invalidate_pte(pte); - if ((unsigned long)pa >= MAXPHYSMEM) + if ((unsigned long)pa >= last_addr) template |= CACHE_INH | PG_V | PG_W; else template |= CACHE_GLOBAL | PG_V | PG_W; |