From 8882a22f7b4efb478326b2fc3a5a3c759d62143d Mon Sep 17 00:00:00 2001 From: Mark Kettenis Date: Sat, 5 Jul 2008 21:20:49 +0000 Subject: Calculate the size of kernel text correctly if it spans multiple prom mapping entries. This is necessary on the v1280 where the firmware mixes 4MB and 8KB mappings to map kernel text. tested by miod@ and nick@ --- sys/arch/sparc64/sparc64/pmap.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'sys/arch/sparc64') diff --git a/sys/arch/sparc64/sparc64/pmap.c b/sys/arch/sparc64/sparc64/pmap.c index d97b8a280ba..46be8e6a088 100644 --- a/sys/arch/sparc64/sparc64/pmap.c +++ b/sys/arch/sparc64/sparc64/pmap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pmap.c,v 1.64 2008/07/04 17:40:25 kettenis Exp $ */ +/* $OpenBSD: pmap.c,v 1.65 2008/07/05 21:20:48 kettenis Exp $ */ /* $NetBSD: pmap.c,v 1.107 2001/08/31 16:47:41 eeh Exp $ */ #undef NO_VCACHE /* Don't forget the locked TLB in dostart */ /* @@ -882,12 +882,12 @@ remap_data: * Hunt for the kernel text segment and figure out it size and * alignment. */ + ktsize = 0; for (i = 0; i < prom_map_size; i++) - if (prom_map[i].vstart == ktext) - break; - if (i == prom_map_size) + if (prom_map[i].vstart == ktext + ktsize) + ktsize += prom_map[i].vsize; + if (ktsize == 0) panic("No kernel text segment!"); - ktsize = prom_map[i].vsize; ektext = ktext + ktsize; if (ktextp & (4*MEG-1)) { -- cgit v1.2.3