Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/ofppc/ofppc Fix msgbuf handling.



details:   https://anonhg.NetBSD.org/src/rev/d888eb46333e
branches:  trunk
changeset: 472695:d888eb46333e
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Wed May 05 00:03:10 1999 +0000

description:
Fix msgbuf handling.

diffstat:

 sys/arch/ofppc/ofppc/machdep.c |  19 +++++++++++++------
 1 files changed, 13 insertions(+), 6 deletions(-)

diffs (43 lines):

diff -r 72995c610492 -r d888eb46333e sys/arch/ofppc/ofppc/machdep.c
--- a/sys/arch/ofppc/ofppc/machdep.c    Tue May 04 23:55:27 1999 +0000
+++ b/sys/arch/ofppc/ofppc/machdep.c    Wed May 05 00:03:10 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: machdep.c,v 1.38 1999/04/17 21:16:47 ws Exp $  */
+/*     $NetBSD: machdep.c,v 1.39 1999/05/05 00:03:10 thorpej Exp $     */
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -87,7 +87,8 @@
 
 char *bootpath;
 
-#define MSGBUFADDR 0x3000
+paddr_t msgbuf_paddr;
+vaddr_t msgbuf_vaddr;
 
 caddr_t allocsys __P((caddr_t));
 
@@ -373,13 +374,19 @@
        paddr_t minaddr, maxaddr;
        int base, residual;
 
+       proc0.p_addr = proc0paddr;
+       v = (caddr_t)proc0paddr + USPACE;
+
        /*
         * Initialize error message buffer (at end of core).
         */
-       initmsgbuf((caddr_t)MSGBUFADDR, round_page(MSGBUFSIZE));
-
-       proc0.p_addr = proc0paddr;
-       v = (caddr_t)proc0paddr + USPACE;
+       if (!(msgbuf_vaddr = uvm_km_alloc(kernel_map, round_page(MSGBUFSIZE))))
+               panic("startup: no room for message buffer");
+       for (i = 0; i < btoc(MSGBUFSIZE); i++)
+               pmap_enter(pmap_kernel(), msgbuf_vaddr + i * NBPG,
+                   msgbuf_paddr + i * NBPG, VM_PROT_READ|VM_PROT_WRITE, TRUE,
+                   VM_PROT_READ|VM_PROT_WRITE);
+       initmsgbuf((caddr_t)msgbuf_vaddr, round_page(MSGBUFSIZE));
 
        printf("%s", version);
        identifycpu();



Home | Main Index | Thread Index | Old Index