diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2008-07-05 21:20:49 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2008-07-05 21:20:49 +0000 |
commit | 8882a22f7b4efb478326b2fc3a5a3c759d62143d (patch) | |
tree | 551a616d4b736f38a93bcbba17bfeffe57339c79 /sys/arch/sparc64 | |
parent | 42951335bffb98506ad95ff8bb569a1826b60b02 (diff) |
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@
Diffstat (limited to 'sys/arch/sparc64')
-rw-r--r-- | sys/arch/sparc64/sparc64/pmap.c | 10 |
1 files changed, 5 insertions, 5 deletions
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)) { |