Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/sparc/sparc alloc_cpuinfo: zero all the memory we a...



details:   https://anonhg.NetBSD.org/src/rev/a6d7d51e79e0
branches:  trunk
changeset: 504469:a6d7d51e79e0
user:      pk <pk%NetBSD.org@localhost>
date:      Sat Mar 03 19:40:28 2001 +0000

description:
alloc_cpuinfo: zero all the memory we allocate; not just the `cpuinfo' part.
cpu_attach: initialize `curpcb->pcb_wim' for each additional CPU.

diffstat:

 sys/arch/sparc/sparc/cpu.c |  11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diffs (39 lines):

diff -r beb6ced86f93 -r a6d7d51e79e0 sys/arch/sparc/sparc/cpu.c
--- a/sys/arch/sparc/sparc/cpu.c        Sat Mar 03 19:11:02 2001 +0000
+++ b/sys/arch/sparc/sparc/cpu.c        Sat Mar 03 19:40:28 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cpu.c,v 1.112 2001/03/02 17:00:13 pk Exp $ */
+/*     $NetBSD: cpu.c,v 1.113 2001/03/03 19:40:28 pk Exp $ */
 
 /*
  * Copyright (c) 1996
@@ -65,6 +65,7 @@
 #include <machine/reg.h>
 #include <machine/ctlreg.h>
 #include <machine/trap.h>
+#include <machine/pcb.h>
 #include <machine/pmap.h>
 
 #include <machine/oldmon.h>
@@ -198,7 +199,7 @@
                va += NBPG;
        }
 
-       bzero((void *)cpi, sizeof(struct cpu_info));
+       bzero((void *)cpi, sz);
        cpi->eintstack = (void *)((vaddr_t)cpi + sz);
        cpi->idle_u = (void *)((vaddr_t)cpi + sz - INT_STACK_SIZE - USPACE);
 
@@ -320,7 +321,11 @@
                cpi = sc->sc_cpuinfo = alloc_cpuinfo();
                cpi->ci_self = cpi;
                cpi->curpcb = cpi->idle_u;
-               /* Note: `idle_u' and `eintstack' are set in alloc_cpuinfo() */
+               cpi->curpcb->pcb_wim = 1;
+               /*
+                * Note: `idle_u' and `eintstack' are set in alloc_cpuinfo().
+                * The %wim register will be initialized in cpu_hatch().
+                */
                getcpuinfo(cpi, node);
 #else
                printf(": no SMP support in kernel\n");



Home | Main Index | Thread Index | Old Index