]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - include/asm-sparc64/ttable.h
i2c-amd8111: Missed cleanup
[karo-tx-linux.git] / include / asm-sparc64 / ttable.h
index 972f913709a33c1a4c7e1f6213876a46d223cd88..c2a16e1884992a0c9bd13dbbf774731eb1fe2ecf 100644 (file)
@@ -2,7 +2,6 @@
 #ifndef _SPARC64_TTABLE_H
 #define _SPARC64_TTABLE_H
 
-#include <linux/config.h>
 #include <asm/utrap.h>
 
 #ifdef __ASSEMBLY__
 #endif
 #define BREAKPOINT_TRAP TRAP(breakpoint_trap)
 
+#ifdef CONFIG_TRACE_IRQFLAGS
+
 #define TRAP_IRQ(routine, level)                       \
        rdpr    %pil, %g2;                              \
        wrpr    %g0, 15, %pil;                          \
-       b,pt    %xcc, etrap_irq;                        \
+       sethi   %hi(1f-4), %g7;                         \
+       ba,pt   %xcc, etrap_irq;                        \
+        or     %g7, %lo(1f-4), %g7;                    \
+       nop;                                            \
+       nop;                                            \
+       nop;                                            \
+       .subsection     2;                              \
+1:     call    trace_hardirqs_off;                     \
+        nop;                                           \
+       mov     level, %o0;                             \
+       call    routine;                                \
+        add    %sp, PTREGS_OFF, %o1;                   \
+       ba,a,pt %xcc, rtrap_irq;                        \
+       .previous;
+
+#define TICK_SMP_IRQ                                   \
+       rdpr    %pil, %g2;                              \
+       wrpr    %g0, 15, %pil;                          \
+       sethi   %hi(1f-4), %g7;                         \
+       ba,pt   %xcc, etrap_irq;                        \
+        or     %g7, %lo(1f-4), %g7;                    \
+       nop;                                            \
+       nop;                                            \
+       nop;                                            \
+       .subsection     2;                              \
+1:     call    trace_hardirqs_off;                     \
+        nop;                                           \
+       call    smp_percpu_timer_interrupt;             \
+        add    %sp, PTREGS_OFF, %o0;                   \
+       ba,a,pt %xcc, rtrap_irq;                        \
+       .previous;
+
+#else
+
+#define TRAP_IRQ(routine, level)                       \
+       rdpr    %pil, %g2;                              \
+       wrpr    %g0, 15, %pil;                          \
+       ba,pt   %xcc, etrap_irq;                        \
         rd     %pc, %g7;                               \
        mov     level, %o0;                             \
        call    routine;                                \
        rdpr    %pil, %g2;                              \
        wrpr    %g0, 15, %pil;                          \
        sethi   %hi(109f), %g7;                         \
-       b,pt    %xcc, etrap_irq;                        \
+       ba,pt   %xcc, etrap_irq;                        \
 109:    or     %g7, %lo(109b), %g7;                    \
        call    smp_percpu_timer_interrupt;             \
         add    %sp, PTREGS_OFF, %o0;                   \
        ba,a,pt %xcc, rtrap_irq;
 
+#endif
+
 #define TRAP_IVEC TRAP_NOSAVE(do_ivec)
 
 #define BTRAP(lvl) TRAP_ARG(bad_trap, lvl)
 #define KPROBES_TRAP(lvl) TRAP_ARG(bad_trap, lvl)
 #endif
 
-#define SUN4V_ITSB_MISS                                \
-       mov     SCRATCHPAD_CPUID, %g1;          \
-       ldxa    [%g1] ASI_SCRATCHPAD, %g2;      \
-       ldxa    [%g1 + %g1] ASI_SCRATCHPAD, %g1;\
-       sethi   %hi(trap_block), %g5;           \
-       sllx    %g2, TRAP_BLOCK_SZ_SHIFT, %g2;  \
-       or      %g5, %lo(trap_block), %g5;      \
-       ba,pt   %xcc, sun4v_itsb_miss;          \
-        add    %g5, %g2, %g5;
-
-#define SUN4V_DTSB_MISS                                \
-       mov     SCRATCHPAD_CPUID, %g1;          \
-       ldxa    [%g1] ASI_SCRATCHPAD, %g2;      \
-       ldxa    [%g1 + %g1] ASI_SCRATCHPAD, %g1;\
-       sethi   %hi(trap_block), %g5;           \
-       sllx    %g2, TRAP_BLOCK_SZ_SHIFT, %g2;  \
-       or      %g5, %lo(trap_block), %g5;      \
-       ba,pt   %xcc, sun4v_dtsb_miss;          \
-        add    %g5, %g2, %g5;
+#define SUN4V_ITSB_MISS                                        \
+       ldxa    [%g0] ASI_SCRATCHPAD, %g2;              \
+       ldx     [%g2 + HV_FAULT_I_ADDR_OFFSET], %g4;    \
+       ldx     [%g2 + HV_FAULT_I_CTX_OFFSET], %g5;     \
+       srlx    %g4, 22, %g6;                           \
+       ba,pt   %xcc, sun4v_itsb_miss;                  \
+        nop;                                           \
+       nop;                                            \
+       nop;
+
+#define SUN4V_DTSB_MISS                                        \
+       ldxa    [%g0] ASI_SCRATCHPAD, %g2;              \
+       ldx     [%g2 + HV_FAULT_D_ADDR_OFFSET], %g4;    \
+       ldx     [%g2 + HV_FAULT_D_CTX_OFFSET], %g5;     \
+       srlx    %g4, 22, %g6;                           \
+       ba,pt   %xcc, sun4v_dtsb_miss;                  \
+        nop;                                           \
+       nop;                                            \
+       nop;
 
 /* Before touching these macros, you owe it to yourself to go and
  * see how arch/sparc64/kernel/winfixup.S works... -DaveM