From 0729240c886523b69793fc3eae293f8d2d160f61 Mon Sep 17 00:00:00 2001 From: thorpej Date: Tue, 6 Oct 1998 18:58:09 +0000 Subject: [PATCH] Move the "XXX re-zero proc0 user area" to the end of configure(), before interrupts are enabled. --- sys/arch/sparc/sparc/autoconf.c | 11 ++++++++++- sys/arch/sparc/sparc/machdep.c | 11 +---------- sys/arch/sparc64/sparc64/autoconf.c | 18 +++++++++++++++++- sys/arch/sparc64/sparc64/machdep.c | 10 +--------- 4 files changed, 29 insertions(+), 21 deletions(-) diff --git a/sys/arch/sparc/sparc/autoconf.c b/sys/arch/sparc/sparc/autoconf.c index 47bccd9d0b1e..0bebd8bc6b0f 100644 --- a/sys/arch/sparc/sparc/autoconf.c +++ b/sys/arch/sparc/sparc/autoconf.c @@ -1,4 +1,4 @@ -/* $NetBSD: autoconf.c,v 1.101 1998/09/26 20:15:59 pk Exp $ */ +/* $NetBSD: autoconf.c,v 1.102 1998/10/06 18:58:09 thorpej Exp $ */ /* * Copyright (c) 1996 @@ -63,6 +63,7 @@ #include #include #include +#include #include @@ -763,6 +764,7 @@ st_crazymap(n) void configure() { + extern struct user *proc0paddr; /* XXX see below */ /* build the bootpath */ bootpath_build(); @@ -808,6 +810,13 @@ configure() ienab_bis(IE_ALLIE); #endif + /* + * XXX Re-zero proc0's user area, to nullify the effect of the + * XXX stack running into it during auto-configuration. + * XXX - should fix stack usage. + */ + bzero(proc0paddr, sizeof(struct user)); + (void)spl0(); cold = 0; } diff --git a/sys/arch/sparc/sparc/machdep.c b/sys/arch/sparc/sparc/machdep.c index 68105cc27365..6251ff635320 100644 --- a/sys/arch/sparc/sparc/machdep.c +++ b/sys/arch/sparc/sparc/machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.131 1998/09/30 18:38:57 pk Exp $ */ +/* $NetBSD: machdep.c,v 1.132 1998/10/06 18:58:09 thorpej Exp $ */ /*- * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc. @@ -214,7 +214,6 @@ cpu_startup() #endif vaddr_t minaddr, maxaddr; vsize_t size; - extern struct user *proc0paddr; #ifdef DEBUG pmapdebug = 0; @@ -397,14 +396,6 @@ cpu_startup() */ configure(); - /* - * Re-zero proc0's user area, to nullify the effect of the - * stack running into it during auto-configuration. - * XXX - should fix stack usage. - * XXX - there's a race here, as interrupts are enabled - */ - bzero(proc0paddr, sizeof(struct user)); - pmap_redzone(); } diff --git a/sys/arch/sparc64/sparc64/autoconf.c b/sys/arch/sparc64/sparc64/autoconf.c index 5e4bcb3b53ea..ea093d0b85f1 100644 --- a/sys/arch/sparc64/sparc64/autoconf.c +++ b/sys/arch/sparc64/sparc64/autoconf.c @@ -1,4 +1,4 @@ -/* $NetBSD: autoconf.c,v 1.8 1998/09/05 23:57:26 eeh Exp $ */ +/* $NetBSD: autoconf.c,v 1.9 1998/10/06 18:58:09 thorpej Exp $ */ /* * Copyright (c) 1996 @@ -64,6 +64,9 @@ #include #include #include +#if 0 +#include +#endif #include @@ -443,6 +446,10 @@ st_crazymap(n) void configure() { +#if 0 + extern struct user *proc0paddr; /* XXX see below */ +#endif + /* build the bootpath */ bootpath_build(); @@ -462,6 +469,15 @@ configure() /* Enable device interrupts */ setpstate(getpstate()|PSTATE_IE); +#if 0 + /* + * XXX Re-zero proc0's user area, to nullify the effect of the + * XXX stack running into it during auto-configuration. + * XXX - should fix stack usage. + */ + bzero(proc0paddr, sizeof(struct user)); +#endif + (void)spl0(); cold = 0; } diff --git a/sys/arch/sparc64/sparc64/machdep.c b/sys/arch/sparc64/sparc64/machdep.c index 590476c22d65..b20f97c6613f 100644 --- a/sys/arch/sparc64/sparc64/machdep.c +++ b/sys/arch/sparc64/sparc64/machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.18 1998/09/22 02:48:44 eeh Exp $ */ +/* $NetBSD: machdep.c,v 1.19 1998/10/06 18:58:09 thorpej Exp $ */ /*- * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc. @@ -385,14 +385,6 @@ cpu_startup() configure(); #if 0 - /* - * Re-zero proc0's user area, to nullify the effect of the - * stack running into it during auto-configuration. - * XXX - should fix stack usage. - * XXX - there's a race here, as interrupts are enabled - */ - bzero(proc0paddr, sizeof(struct user)); - pmap_redzone(); #endif }