From: kettenis Date: Fri, 25 Jul 2008 14:53:38 +0000 (+0000) Subject: Switch to a temporary stack early on such that we don't lose if the stack X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=0e9f1ab64ebecab65197f0ed20c5a9c54fb80491;p=openbsd Switch to a temporary stack early on such that we don't lose if the stack provided by the PROM gets flushed out of the TLB before we install our own trap table. Makes RAMDISK kernels work on T2 systems. --- diff --git a/sys/arch/sparc64/sparc64/locore.s b/sys/arch/sparc64/sparc64/locore.s index 81f83cb749a..41a6b980189 100644 --- a/sys/arch/sparc64/sparc64/locore.s +++ b/sys/arch/sparc64/sparc64/locore.s @@ -1,4 +1,4 @@ -/* $OpenBSD: locore.s,v 1.147 2008/07/21 13:30:05 art Exp $ */ +/* $OpenBSD: locore.s,v 1.148 2008/07/25 14:53:38 kettenis Exp $ */ /* $NetBSD: locore.s,v 1.137 2001/08/13 06:10:10 jdolecek Exp $ */ /* @@ -347,6 +347,13 @@ _C_LABEL(data_start): ! Start of data segment _C_LABEL(u0): .xword 0 estack0: .xword 0 +/* + * This stack is used for bootstrapping and spinning up CPUs. + */ + .space 4096 + .align 16 +tmpstack: + #ifdef DEBUG /* * This stack is used when we detect kernel stack corruption. @@ -4856,6 +4863,11 @@ dostart: membar #Sync #endif /* 0 */ + /* + * Switch to temporary stack. + */ + set tmpstack-CC64FSZ-BIAS, %sp + /* * Ready to run C code; finish bootstrap. */ @@ -4964,12 +4976,6 @@ ENTRY(sun4u_set_tsbs) #ifdef MULTIPROCESSOR - .data - .space 2048 - _ALIGN -tmpstack: - .text - ENTRY(cpu_mp_startup) mov %o0, %g2