sparc32,leon: added some SMP comments
authorDaniel Hellstrom <daniel@gaisler.com>
Mon, 25 Apr 2011 21:43:48 +0000 (21:43 +0000)
committerDavid S. Miller <davem@davemloft.net>
Mon, 16 May 2011 20:03:28 +0000 (13:03 -0700)
Signed-off-by: Daniel Hellstrom <daniel@gaisler.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
arch/sparc/include/asm/smp_32.h
arch/sparc/include/asm/winmacro.h

index d82d7f4c0a798f58eef6a4af71bfaa0e2ed357fa..d7837dcb252506e908ef0f63718642af6af4dad4 100644 (file)
@@ -135,6 +135,11 @@ static inline int hard_smp_processor_id(void)
                __asm__ __volatile__("lda [%g0] ASI_M_VIKING_TMP1, %0\n\t"
                                     "nop; nop" :
                                     "=&r" (cpuid));
+                    - leon
+               __asm__ __volatile__(   "rd %asr17, %0\n\t"
+                                       "srl %0, 0x1c, %0\n\t"
+                                       "nop\n\t" :
+                                       "=&r" (cpuid));
           See btfixup.h and btfixupprep.c to understand how a blackbox works.
         */
        __asm__ __volatile__("sethi %%hi(___b_hard_smp_processor_id), %0\n\t"
index 5b0a06dc3bcbcd7e17a5813faef90ce063a45eb4..a9be04b0d049c28c7aae4893ea548e7071721326 100644 (file)
         st       %scratch, [%cur_reg + TI_W_SAVED];
 
 #ifdef CONFIG_SMP
+/* Results of LOAD_CURRENT() after BTFIXUP for SUN4M, SUN4D & LEON (comments) */
 #define LOAD_CURRENT4M(dest_reg, idreg) \
         rd       %tbr, %idreg; \
        sethi    %hi(current_set), %dest_reg; \
        or      %dest_reg, %lo(C_LABEL(current_set)), %dest_reg; \
        ld      [%idreg + %dest_reg], %dest_reg;
 
+#define LOAD_CURRENT_LEON(dest_reg, idreg)                     \
+       rd      %asr17, %idreg;                                 \
+       sethi   %hi(current_set), %dest_reg;                    \
+       srl     %idreg, 0x1c, %idreg;                           \
+       or      %dest_reg, %lo(current_set), %dest_reg;         \
+       sll     %idreg, 0x2, %idreg;                            \
+       ld      [%idreg + %dest_reg], %dest_reg;
+
 /* Blackbox - take care with this... - check smp4m and smp4d before changing this. */
 #define LOAD_CURRENT(dest_reg, idreg)                                  \
        sethi    %hi(___b_load_current), %idreg;                        \