]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6
authorLinus Torvalds <torvalds@linux-foundation.org>
Fri, 24 Oct 2008 02:19:14 +0000 (19:19 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 24 Oct 2008 02:19:14 +0000 (19:19 -0700)
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6:
  math-emu: Fix thinko in _FP_DIV
  math-emu: Fix signalling of underflow and inexact while packing result.
  sparc: Add checkstack support
  sparc: correct section of current_pc()
  sparc: correct section of apc_no_idle
  sparc64: Fix race in arch/sparc64/kernel/trampoline.S

arch/sparc/kernel/apc.c
arch/sparc/kernel/head.S
arch/sparc64/kernel/trampoline.S
include/math-emu/op-common.h
scripts/checkstack.pl

index 4dd1ba752ce6338376df2f7fd4bb297195ec251a..9c115823c4b5e2a7a4e9596402bde120503477eb 100644 (file)
@@ -31,7 +31,7 @@
 #define APC_DEVNAME "apc"
 
 static u8 __iomem *regs;
-static int apc_no_idle __initdata = 0;
+static int apc_no_idle __devinitdata = 0;
 
 #define apc_readb(offs)                (sbus_readb(regs+offs))
 #define apc_writeb(val, offs)  (sbus_writeb(val, regs+offs))
index 2d325fd845795e32361f658736784262f56bf5c0..2fe2c117e772fac352230dd2827d5a45d8915fd4 100644 (file)
@@ -465,6 +465,7 @@ gokernel:
                mov     %o7, %g4                ! Save %o7
 
                /* Jump to it, and pray... */
+               __INIT
 current_pc:
                call    1f
                 nop
index 704a3afcfd0685458ad542027638e443c517cfb2..83abd5ae88a49c6458de439ee2bac8846bf5d336 100644 (file)
@@ -328,6 +328,12 @@ after_lock_tlb:
 
        wrpr            %g0, 0, %wstate
 
+       sethi           %hi(prom_entry_lock), %g2
+1:     ldstub          [%g2 + %lo(prom_entry_lock)], %g1
+       membar          #StoreLoad | #StoreStore
+       brnz,pn         %g1, 1b
+        nop
+
        /* As a hack, put &init_thread_union into %g6.
         * prom_world() loads from here to restore the %asi
         * register.
@@ -337,7 +343,7 @@ after_lock_tlb:
 
        sethi           %hi(is_sun4v), %o0
        lduw            [%o0 + %lo(is_sun4v)], %o0
-       brz,pt          %o0, 1f
+       brz,pt          %o0, 2f
         nop
 
        TRAP_LOAD_TRAP_BLOCK(%g2, %g3)
@@ -369,10 +375,10 @@ after_lock_tlb:
        call            %o1
         add            %sp, (2047 + 128), %o0
 
-       ba,pt           %xcc, 2f
+       ba,pt           %xcc, 3f
         nop
 
-1:     sethi           %hi(sparc64_ttable_tl0), %o0
+2:     sethi           %hi(sparc64_ttable_tl0), %o0
        set             prom_set_trap_table_name, %g2
        stx             %g2, [%sp + 2047 + 128 + 0x00]
        mov             1, %g2
@@ -386,7 +392,11 @@ after_lock_tlb:
        call            %o1
         add            %sp, (2047 + 128), %o0
 
-2:     ldx             [%l0], %g6
+3:     sethi           %hi(prom_entry_lock), %g2
+       stb             %g0, [%g2 + %lo(prom_entry_lock)]
+       membar          #StoreStore | #StoreLoad
+
+       ldx             [%l0], %g6
        ldx             [%g6 + TI_TASK], %g4
 
        mov             1, %g5
index cc1ec396f8d61bcc6e82e851845184011d467eb6..f456534dcaf92615e4b6778bd17de23f227a5578 100644 (file)
@@ -139,18 +139,27 @@ do {                                                              \
        if (X##_e <= _FP_WFRACBITS_##fs)                        \
          {                                                     \
            _FP_FRAC_SRS_##wc(X, X##_e, _FP_WFRACBITS_##fs);    \
-           _FP_ROUND(wc, X);                                   \
            if (_FP_FRAC_HIGH_##fs(X)                           \
                & (_FP_OVERFLOW_##fs >> 1))                     \
              {                                                 \
                X##_e = 1;                                      \
                _FP_FRAC_SET_##wc(X, _FP_ZEROFRAC_##wc);        \
-               FP_SET_EXCEPTION(FP_EX_INEXACT);                \
              }                                                 \
            else                                                \
              {                                                 \
-               X##_e = 0;                                      \
-               _FP_FRAC_SRL_##wc(X, _FP_WORKBITS);             \
+               _FP_ROUND(wc, X);                               \
+               if (_FP_FRAC_HIGH_##fs(X)                       \
+                  & (_FP_OVERFLOW_##fs >> 1))                  \
+                 {                                             \
+                   X##_e = 1;                                  \
+                   _FP_FRAC_SET_##wc(X, _FP_ZEROFRAC_##wc);    \
+                   FP_SET_EXCEPTION(FP_EX_INEXACT);            \
+                 }                                             \
+               else                                            \
+                 {                                             \
+                   X##_e = 0;                                  \
+                   _FP_FRAC_SRL_##wc(X, _FP_WORKBITS);         \
+                 }                                             \
              }                                                 \
            if ((FP_CUR_EXCEPTIONS & FP_EX_INEXACT) ||          \
                (FP_TRAPPING_EXCEPTIONS & FP_EX_UNDERFLOW))     \
@@ -494,6 +503,8 @@ do {                                                        \
     R##_c = FP_CLS_NAN;                                        \
     _FP_FRAC_SET_##wc(R, _FP_NANFRAC_##fs);            \
     FP_SET_EXCEPTION(FP_EX_INVALID | FP_EX_INVALID_IDI);\
+    break;                                             \
+                                                       \
   case _FP_CLS_COMBINE(FP_CLS_ZERO,FP_CLS_ZERO):       \
     R##_s = _FP_NANSIGN_##fs;                          \
     R##_c = FP_CLS_NAN;                                        \
index f7e8e93ff30d32266c5faf4aa0688ce75b2a651e..14ee68e991dd45767b8ded17747da02a59c703f1 100755 (executable)
@@ -14,6 +14,7 @@
 #      M68k port by Geert Uytterhoeven and Andreas Schwab
 #      AVR32 port by Haavard Skinnemoen <hskinnemoen@atmel.com>
 #      PARISC port by Kyle McMartin <kyle@parisc-linux.org>
+#      sparc port by Martin Habets <errandir_news@mph.eclipse.co.uk>
 #
 #      Usage:
 #      objdump -d vmlinux | scripts/checkstack.pl [arch]
@@ -94,6 +95,9 @@ my (@stack, $re, $dre, $x, $xs);
        } elsif ($arch =~ /^blackfin$/) {
                #   0:   00 e8 38 01     LINK 0x4e0;
                $re = qr/.*[[:space:]]LINK[[:space:]]*(0x$x{1,8})/o;
+       } elsif ($arch eq 'sparc' || $arch eq 'sparc64') {
+               # f0019d10:       9d e3 bf 90     save  %sp, -112, %sp
+               $re = qr/.*save.*%sp, -(([0-9]{2}|[3-9])[0-9]{2}), %sp/o;
        } else {
                print("wrong or unknown architecture \"$arch\"\n");
                exit