Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/evbppc/walnut Zero bss in start, not in initppc.



details:   https://anonhg.NetBSD.org/src/rev/15229990c3e2
branches:  trunk
changeset: 543385:15229990c3e2
user:      matt <matt%NetBSD.org@localhost>
date:      Mon Feb 24 08:06:42 2003 +0000

description:
Zero bss in start, not in initppc.

diffstat:

 sys/arch/evbppc/walnut/machdep.c      |  10 ++--------
 sys/arch/evbppc/walnut/walnut_start.S |  21 +++++++++++----------
 2 files changed, 13 insertions(+), 18 deletions(-)

diffs (75 lines):

diff -r e4e0e4805b2c -r 15229990c3e2 sys/arch/evbppc/walnut/machdep.c
--- a/sys/arch/evbppc/walnut/machdep.c  Mon Feb 24 07:47:17 2003 +0000
+++ b/sys/arch/evbppc/walnut/machdep.c  Mon Feb 24 08:06:42 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: machdep.c,v 1.5 2003/02/02 20:43:19 matt Exp $ */
+/*     $NetBSD: machdep.c,v 1.6 2003/02/24 08:06:42 matt Exp $ */
 
 /*
  * Copyright 2001, 2002 Wasabi Systems, Inc.
@@ -171,11 +171,7 @@
        extern int ipkdblow, ipkdbsize;
 #endif
        int exc;
-       extern char _edata, _end;
-       struct cpu_info * const ci = &cpu_info[0];
-
-       /* Set the curcpu() pointer */
-       mtspr(SPR_SPRG0, ci);
+       struct cpu_info * const ci = curcpu();
 
        /* Disable all external interrupts */
        mtdcr(DCR_UIC0_ER, 0);
@@ -183,8 +179,6 @@
         /* Initialize cache info for memcpy, etc. */
         cpu_probe_cache();
 
-       memset(&_edata, 0, &_end-&_edata); /* Clear BSS area */
-
        /* Save info block */
        if (info_block == NULL)
                /* XXX why isn't r3 set correctly?!?!? */
diff -r e4e0e4805b2c -r 15229990c3e2 sys/arch/evbppc/walnut/walnut_start.S
--- a/sys/arch/evbppc/walnut/walnut_start.S     Mon Feb 24 07:47:17 2003 +0000
+++ b/sys/arch/evbppc/walnut/walnut_start.S     Mon Feb 24 08:06:42 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: walnut_start.S,v 1.4 2003/02/02 20:43:19 matt Exp $    */
+/*     $NetBSD: walnut_start.S,v 1.5 2003/02/24 08:06:43 matt Exp $    */
 /*     $OpenBSD: locore.S,v 1.4 1997/01/26 09:06:38 rahnds Exp $       */
 
 /*
@@ -118,13 +118,6 @@
 GLOBAL(eintrcnt)
 
 /*
- * File-scope for locore.S
- */
-       .data
-idle_u:
-       .long   0                       /* fake uarea during idle after exit */
-
-/*
  * This symbol is here for the benefit of kvm_mkdb, and is supposed to
  * mark the start of kernel text.
  */
@@ -183,10 +176,18 @@
        tlbia
        sync
        isync
-
-/* compute end of kernel memory */
+/* get start of bss */
+       lis     3,_C_LABEL(_edata)-4@ha
+       addi    3,3,_C_LABEL(_edata)-4@l
+/* get end of kernel memory */
        lis     8,_C_LABEL(end)@ha
        addi    8,8,_C_LABEL(end)@l
+/* zero bss */
+       li      4,0
+2:     stwu    4,4(3)
+       cmpw    3,8
+       bne+    2b
+
 #if defined(DDB)
        /* If we had symbol table location we'd store it here and would've adjusted r8 here */
        lis     7,_C_LABEL(startsym)@ha



Home | Main Index | Thread Index | Old Index