summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2009-04-25 20:35:32 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2009-04-25 20:35:32 +0000
commit0f6ba36e9c2dd719766b931ffd5ebc6e81537b83 (patch)
treeba9c91b31246eee703e16949703cc1670af1aac0 /sys
parent6d1e3959caeda76eb34bb91ee67c0d31b2db2998 (diff)
Make pmap_steal_memory() return KSEG0 addresses only for kernels linked at
KSEG0 addresses.
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/mips64/mips64/pmap.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/arch/mips64/mips64/pmap.c b/sys/arch/mips64/mips64/pmap.c
index 5ddd01fcc44..bbe53c491e5 100644
--- a/sys/arch/mips64/mips64/pmap.c
+++ b/sys/arch/mips64/mips64/pmap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pmap.c,v 1.35 2008/09/23 04:34:02 miod Exp $ */
+/* $OpenBSD: pmap.c,v 1.36 2009/04/25 20:35:31 miod Exp $ */
/*
* Copyright (c) 2001-2004 Opsycon AB (www.opsycon.se / www.opsycon.com)
@@ -225,9 +225,11 @@ pmap_steal_memory(vsize_t size, vaddr_t *vstartp, vaddr_t *vendp)
*vendp = virtual_end;
/*
- * Prefer KSEG0 addresses for now, whenever possible.
+ * If we are running with a 32 bit ARCBios (i.e. kernel
+ * linked in KSEG0), return a KSEG0 address whenever possible.
*/
- if (pa + size < KSEG_SIZE)
+ if ((vaddr_t)&pmap_steal_memory - KSEG0_BASE < KSEG_SIZE &&
+ pa + size < KSEG_SIZE)
va = PHYS_TO_KSEG0(pa);
else
va = PHYS_TO_XKPHYS(pa, CCA_CACHED);