Index: sys/arch/sparc64/sparc64/locore.s =================================================================== RCS file: /cvsroot/src/sys/arch/sparc64/sparc64/locore.s,v retrieving revision 1.364 diff -u -r1.364 locore.s --- sys/arch/sparc64/sparc64/locore.s 16 Jul 2014 19:53:18 -0000 1.364 +++ sys/arch/sparc64/sparc64/locore.s 19 Jul 2014 13:35:26 -0000 @@ -141,6 +141,24 @@ .endm + .macro NORMAL_GLOBALS scratch +#ifdef SUN4V + sethi %hi(cputyp), \scratch + ld [\scratch + %lo(cputyp)], \scratch + cmp \scratch, CPU_SUN4V + bne,pt %icc, 2f + nop + /* sun4v */ + ba 3f + wrpr %g0, 0, %gl +2: +#endif + /* sun4u */ + wrpr %g0, PSTATE_KERN, %pstate +3: + .endm + + #ifdef SUN4V /* Misc. sun4v macros */ @@ -3582,7 +3600,7 @@ #endif INTR_SETUP(-CC64FSZ-TF_SIZE) ! Switch to normal globals so we can save them - wrpr %g0, PSTATE_KERN, %pstate + NORMAL_GLOBALS %g5 stx %g1, [%sp + CC64FSZ + STKB + TF_G + ( 1*8)] stx %g2, [%sp + CC64FSZ + STKB + TF_G + ( 2*8)] stx %g3, [%sp + CC64FSZ + STKB + TF_G + ( 3*8)]