]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/sparc64/kernel/etrap.S
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland...
[linux-2.6-omap-h63xx.git] / arch / sparc64 / kernel / etrap.S
index f2556146a735c4f577afe1a96bc66e85ddf77069..4b2bf9eb447a1f5eaa7c93b27627c0c217a9937b 100644 (file)
@@ -5,7 +5,6 @@
  * Copyright (C) 1997, 1998, 1999 Jakub Jelinek (jj@ultra.linux.cz)
  */
 
-#include <linux/config.h>
 
 #include <asm/asi.h>
 #include <asm/pstate.h>
@@ -95,14 +94,27 @@ etrap_save: save    %g2, -STACK_BIAS, %sp
                wrpr    %g2, 0, %wstate
                sethi   %hi(sparc64_kern_pri_context), %g2
                ldx     [%g2 + %lo(sparc64_kern_pri_context)], %g3
-               stxa    %g3, [%l4] ASI_DMMU
+
+661:           stxa    %g3, [%l4] ASI_DMMU
+               .section .sun4v_1insn_patch, "ax"
+               .word   661b
+               stxa    %g3, [%l4] ASI_MMU
+               .previous
+
                sethi   %hi(KERNBASE), %l4
                flush   %l4
                mov     ASI_AIUS, %l7
 2:             mov     %g4, %l4
                mov     %g5, %l5
                add     %g7, 4, %l2
-               wrpr    %g0, ETRAP_PSTATE1, %pstate
+
+               /* Go to trap time globals so we can save them.  */
+661:           wrpr    %g0, ETRAP_PSTATE1, %pstate
+               .section .sun4v_1insn_patch, "ax"
+               .word   661b
+               SET_GL(0)
+               .previous
+
                stx     %g1, [%sp + PTREGS_OFF + PT_V9_G1]
                stx     %g2, [%sp + PTREGS_OFF + PT_V9_G2]
                sllx    %l7, 24, %l7
@@ -175,6 +187,11 @@ etraptl1:  /* Save tstate/tpc/tnpc of TL 1-->4 and the tl register itself.
                rdpr    %tt, %g3
                stx     %g3, [%g2 + STACK_BIAS + 0x38]
 
+               sethi   %hi(is_sun4v), %g3
+               lduw    [%g3 + %lo(is_sun4v)], %g3
+               brnz,pn %g3, finish_tl1_capture
+                nop
+
                wrpr    %g0, 3, %tl
                rdpr    %tstate, %g3
                stx     %g3, [%g2 + STACK_BIAS + 0x40]
@@ -195,9 +212,16 @@ etraptl1:  /* Save tstate/tpc/tnpc of TL 1-->4 and the tl register itself.
                rdpr    %tt, %g3
                stx     %g3, [%g2 + STACK_BIAS + 0x78]
 
-               wrpr    %g1, %tl
                stx     %g1, [%g2 + STACK_BIAS + 0x80]
 
+finish_tl1_capture:
+               wrpr    %g0, 1, %tl
+661:           nop
+               .section .sun4v_1insn_patch, "ax"
+               .word   661b
+               SET_GL(1)
+               .previous
+
                rdpr    %tstate, %g1
                sub     %g2, STACKFRAME_SZ + TRACEREG_SZ - STACK_BIAS, %g2
                ba,pt   %xcc, 1b