From 34af340895da0cb69ddf3235e4c619bcfcf97172 Mon Sep 17 00:00:00 2001 From: Mark Kettenis Date: Sat, 22 Mar 2008 10:53:16 +0000 Subject: Switch to our initial stack after switching over to our own trap table. This removes the need to lock the stack (and cpuinfo) into the TLB on sun4v. --- sys/arch/sparc64/sparc64/locore.s | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/sys/arch/sparc64/sparc64/locore.s b/sys/arch/sparc64/sparc64/locore.s index e2ccf2c33c8..91622f36cbd 100644 --- a/sys/arch/sparc64/sparc64/locore.s +++ b/sys/arch/sparc64/sparc64/locore.s @@ -1,4 +1,4 @@ -/* $OpenBSD: locore.s,v 1.118 2008/03/20 22:22:47 kettenis Exp $ */ +/* $OpenBSD: locore.s,v 1.119 2008/03/22 10:53:15 kettenis Exp $ */ /* $NetBSD: locore.s,v 1.137 2001/08/13 06:10:10 jdolecek Exp $ */ /* @@ -3647,20 +3647,6 @@ dostart: _C_LABEL(cpu_initialize): wrpr %g0, 0, %tl ! Make sure we're not in NUCLEUS mode - - /* - * Step 6: map cpu_info struct and interrupt stack and - * switch to our initial stack. - */ - -!!! Make sure our stack's OK. - flushw - GET_CPUINFO_VA(%l0) - ldx [%l0 + CI_INITSTACK], %l0 - add %l0, - CC64FSZ - 80, %l0 ! via syscall(boot_me_up) or somesuch - andn %l0, 0x0f, %l0 ! Needs to be 16-byte aligned - sub %l0, BIAS, %l0 ! and biased - mov %l0, %sp flushw /* @@ -3701,6 +3687,14 @@ _C_LABEL(cpu_initialize): wrpr %l1, 0, %tba ! Make sure the PROM didn't foul up. wrpr %g0, WSTATE_KERN, %wstate + /* + * Switch to our initial stack. + */ + + GET_CPUINFO_VA(%l0) + ldx [%l0 + CI_INITSTACK], %l0 + add %l0, -BIAS-CC64FSZ, %sp + /* * Call our startup routine. */ -- cgit v1.2.3