Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/sparc64/sparc64 Fix ALTERNATE_GLOBALS so it at leas...



details:   https://anonhg.NetBSD.org/src/rev/e4980cbae2c1
branches:  trunk
changeset: 797836:e4980cbae2c1
user:      palle <palle%NetBSD.org@localhost>
date:      Wed Jul 30 13:50:33 2014 +0000

description:
Fix ALTERNATE_GLOBALS so it at least works on sun4u - using a scratch register is not a good idea...

diffstat:

 sys/arch/sparc64/sparc64/locore.s |  23 ++++-------------------
 1 files changed, 4 insertions(+), 19 deletions(-)

diffs (44 lines):

diff -r 7a20cef8cff7 -r e4980cbae2c1 sys/arch/sparc64/sparc64/locore.s
--- a/sys/arch/sparc64/sparc64/locore.s Wed Jul 30 13:32:09 2014 +0000
+++ b/sys/arch/sparc64/sparc64/locore.s Wed Jul 30 13:50:33 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: locore.s,v 1.368 2014/07/27 16:37:47 palle Exp $       */
+/*     $NetBSD: locore.s,v 1.369 2014/07/30 13:50:33 palle Exp $       */
 
 /*
  * Copyright (c) 2006-2010 Matthew R. Green
@@ -160,23 +160,8 @@
 3:
        .endm
 
-       .macro  ALTERNATE_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, 1, %gl
-2:             
-#endif 
-       /* sun4u */
-       rdpr     %pstate, \scratch
-       or      \scratch, PSTATE_AG, \scratch   ! Alternate Globals (AG) bit set to one
-       wrpr    %g0, \scratch, %pstate
-3:
+       .macro  ALTERNATE_GLOBALS
+        wrpr    %g0, PSTATE_KERN|PSTATE_AG, %pstate    ! sun4u only for now...
        .endm
        
        .macro  ENABLE_INTERRUPTS scratch
@@ -3954,7 +3939,7 @@
 #ifdef TRAPS_USE_IG
        wrpr    %g0, PSTATE_KERN|PSTATE_IG, %pstate     ! DEBUG
 #else
-       ALTERNATE_GLOBALS %g7           ! Assuming %g7 is ok to trash
+       ALTERNATE_GLOBALS
 #endif
        ldx     [%sp + CC64FSZ + STKB + TF_O + (0*8)], %i0
        ldx     [%sp + CC64FSZ + STKB + TF_O + (1*8)], %i1



Home | Main Index | Thread Index | Old Index