From 0f6ba36e9c2dd719766b931ffd5ebc6e81537b83 Mon Sep 17 00:00:00 2001 From: Miod Vallat Date: Sat, 25 Apr 2009 20:35:32 +0000 Subject: Make pmap_steal_memory() return KSEG0 addresses only for kernels linked at KSEG0 addresses. --- sys/arch/mips64/mips64/pmap.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'sys') 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); -- cgit v1.2.3