Module Name:    src
Committed By:   palle
Date:           Sat Jul 19 20:58:12 UTC 2014

Modified Files:
        src/sys/arch/sparc64/sparc64: locore.s

Log Message:
sun4v: Introduce a NORMAL_GLOBALS macro - first used in sparc_interrupt - other 
relevant uses will be handled as the sun4v work is progressesing - ok martin@


To generate a diff of this commit:
cvs rdiff -u -r1.364 -r1.365 src/sys/arch/sparc64/sparc64/locore.s

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/sparc64/sparc64/locore.s
diff -u src/sys/arch/sparc64/sparc64/locore.s:1.364 src/sys/arch/sparc64/sparc64/locore.s:1.365
--- src/sys/arch/sparc64/sparc64/locore.s:1.364	Wed Jul 16 19:53:18 2014
+++ src/sys/arch/sparc64/sparc64/locore.s	Sat Jul 19 20:58:12 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.s,v 1.364 2014/07/16 19:53:18 palle Exp $	*/
+/*	$NetBSD: locore.s,v 1.365 2014/07/19 20:58:12 palle Exp $	*/
 
 /*
  * Copyright (c) 2006-2010 Matthew R. Green
@@ -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 @@ ENTRY_NOPROFILE(sparc_interrupt)
 #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)]

Reply via email to