diff options
author | Dale Rahn <drahn@cvs.openbsd.org> | 2002-03-08 02:52:37 +0000 |
---|---|---|
committer | Dale Rahn <drahn@cvs.openbsd.org> | 2002-03-08 02:52:37 +0000 |
commit | bfd6cab07ebbe219670eb8f3c2903f2290a508c2 (patch) | |
tree | 12f572b85ea7bba9219244b7aa745fb699665db5 /sys/arch/powerpc | |
parent | 60e1b4b28b90133dc3101a210246060100ce71c2 (diff) |
Move the message buffer out of low memory, Openfirmware clears the area
on reboot. perhaps OF uses it at other times?
Since OF always use the same memory addresses, this should always allocate
the same ram to the msgbuf, and allow it to be preserved across reboot.
Diffstat (limited to 'sys/arch/powerpc')
-rw-r--r-- | sys/arch/powerpc/powerpc/pmap.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/sys/arch/powerpc/powerpc/pmap.c b/sys/arch/powerpc/powerpc/pmap.c index a530c155d43..926d3a831c4 100644 --- a/sys/arch/powerpc/powerpc/pmap.c +++ b/sys/arch/powerpc/powerpc/pmap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pmap.c,v 1.58 2002/01/25 04:04:55 drahn Exp $ */ +/* $OpenBSD: pmap.c,v 1.59 2002/03/08 02:52:36 drahn Exp $ */ /* $NetBSD: pmap.c,v 1.1 1996/09/30 16:34:52 ws Exp $ */ /* @@ -458,6 +458,8 @@ pte_spill(addr) return 0; } +void *msgbuf_addr; /* memory for msgbuf, physical, mapped with BATs */ + int avail_start; int avail_end; /* @@ -566,6 +568,22 @@ pmap_bootstrap(kernelstart, kernelend) mp1->size = sz; } } + /* + * grab first available memory for msgbuf + */ + for (mp = avail; mp->size; mp++) { + if (mp->size >= MSGBUFSIZE) { + mp->size -= MSGBUFSIZE; + msgbuf_addr = (void *)mp->start; + mp->start += MSGBUFSIZE; + if (mp->size == 0) { + bcopy(mp + 1, mp, + (cnt - (mp - avail)) * sizeof *mp); + cnt--; + } + break; + } + } #if 0 avail_start = 0; avail_end = npgs * NBPG; |