aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/sparc/kernel/apc.c2
-rw-r--r--arch/sparc/kernel/head.S1
-rw-r--r--arch/sparc64/kernel/trampoline.S18
-rw-r--r--include/math-emu/op-common.h19
-rwxr-xr-xscripts/checkstack.pl4
5 files changed, 35 insertions, 9 deletions
diff --git a/arch/sparc/kernel/apc.c b/arch/sparc/kernel/apc.c
index 4dd1ba752ce6..9c115823c4b5 100644
--- a/arch/sparc/kernel/apc.c
+++ b/arch/sparc/kernel/apc.c
@@ -31,7 +31,7 @@
31#define APC_DEVNAME "apc" 31#define APC_DEVNAME "apc"
32 32
33static u8 __iomem *regs; 33static u8 __iomem *regs;
34static int apc_no_idle __initdata = 0; 34static int apc_no_idle __devinitdata = 0;
35 35
36#define apc_readb(offs) (sbus_readb(regs+offs)) 36#define apc_readb(offs) (sbus_readb(regs+offs))
37#define apc_writeb(val, offs) (sbus_writeb(val, regs+offs)) 37#define apc_writeb(val, offs) (sbus_writeb(val, regs+offs))
diff --git a/arch/sparc/kernel/head.S b/arch/sparc/kernel/head.S
index 2d325fd84579..2fe2c117e772 100644
--- a/arch/sparc/kernel/head.S
+++ b/arch/sparc/kernel/head.S
@@ -465,6 +465,7 @@ gokernel:
465 mov %o7, %g4 ! Save %o7 465 mov %o7, %g4 ! Save %o7
466 466
467 /* Jump to it, and pray... */ 467 /* Jump to it, and pray... */
468 __INIT
468current_pc: 469current_pc:
469 call 1f 470 call 1f
470 nop 471 nop
diff --git a/arch/sparc64/kernel/trampoline.S b/arch/sparc64/kernel/trampoline.S
index 704a3afcfd06..83abd5ae88a4 100644
--- a/arch/sparc64/kernel/trampoline.S
+++ b/arch/sparc64/kernel/trampoline.S
@@ -328,6 +328,12 @@ after_lock_tlb:
328 328
329 wrpr %g0, 0, %wstate 329 wrpr %g0, 0, %wstate
330 330
331 sethi %hi(prom_entry_lock), %g2
3321: ldstub [%g2 + %lo(prom_entry_lock)], %g1
333 membar #StoreLoad | #StoreStore
334 brnz,pn %g1, 1b
335 nop
336
331 /* As a hack, put &init_thread_union into %g6. 337 /* As a hack, put &init_thread_union into %g6.
332 * prom_world() loads from here to restore the %asi 338 * prom_world() loads from here to restore the %asi
333 * register. 339 * register.
@@ -337,7 +343,7 @@ after_lock_tlb:
337 343
338 sethi %hi(is_sun4v), %o0 344 sethi %hi(is_sun4v), %o0
339 lduw [%o0 + %lo(is_sun4v)], %o0 345 lduw [%o0 + %lo(is_sun4v)], %o0
340 brz,pt %o0, 1f 346 brz,pt %o0, 2f
341 nop 347 nop
342 348
343 TRAP_LOAD_TRAP_BLOCK(%g2, %g3) 349 TRAP_LOAD_TRAP_BLOCK(%g2, %g3)
@@ -369,10 +375,10 @@ after_lock_tlb:
369 call %o1 375 call %o1
370 add %sp, (2047 + 128), %o0 376 add %sp, (2047 + 128), %o0
371 377
372 ba,pt %xcc, 2f 378 ba,pt %xcc, 3f
373 nop 379 nop
374 380
3751: sethi %hi(sparc64_ttable_tl0), %o0 3812: sethi %hi(sparc64_ttable_tl0), %o0
376 set prom_set_trap_table_name, %g2 382 set prom_set_trap_table_name, %g2
377 stx %g2, [%sp + 2047 + 128 + 0x00] 383 stx %g2, [%sp + 2047 + 128 + 0x00]
378 mov 1, %g2 384 mov 1, %g2
@@ -386,7 +392,11 @@ after_lock_tlb:
386 call %o1 392 call %o1
387 add %sp, (2047 + 128), %o0 393 add %sp, (2047 + 128), %o0
388 394
3892: ldx [%l0], %g6 3953: sethi %hi(prom_entry_lock), %g2
396 stb %g0, [%g2 + %lo(prom_entry_lock)]
397 membar #StoreStore | #StoreLoad
398
399 ldx [%l0], %g6
390 ldx [%g6 + TI_TASK], %g4 400 ldx [%g6 + TI_TASK], %g4
391 401
392 mov 1, %g5 402 mov 1, %g5
diff --git a/include/math-emu/op-common.h b/include/math-emu/op-common.h
index cc1ec396f8d6..f456534dcaf9 100644
--- a/include/math-emu/op-common.h
+++ b/include/math-emu/op-common.h
@@ -139,18 +139,27 @@ do { \
139 if (X##_e <= _FP_WFRACBITS_##fs) \ 139 if (X##_e <= _FP_WFRACBITS_##fs) \
140 { \ 140 { \
141 _FP_FRAC_SRS_##wc(X, X##_e, _FP_WFRACBITS_##fs); \ 141 _FP_FRAC_SRS_##wc(X, X##_e, _FP_WFRACBITS_##fs); \
142 _FP_ROUND(wc, X); \
143 if (_FP_FRAC_HIGH_##fs(X) \ 142 if (_FP_FRAC_HIGH_##fs(X) \
144 & (_FP_OVERFLOW_##fs >> 1)) \ 143 & (_FP_OVERFLOW_##fs >> 1)) \
145 { \ 144 { \
146 X##_e = 1; \ 145 X##_e = 1; \
147 _FP_FRAC_SET_##wc(X, _FP_ZEROFRAC_##wc); \ 146 _FP_FRAC_SET_##wc(X, _FP_ZEROFRAC_##wc); \
148 FP_SET_EXCEPTION(FP_EX_INEXACT); \
149 } \ 147 } \
150 else \ 148 else \
151 { \ 149 { \
152 X##_e = 0; \ 150 _FP_ROUND(wc, X); \
153 _FP_FRAC_SRL_##wc(X, _FP_WORKBITS); \ 151 if (_FP_FRAC_HIGH_##fs(X) \
152 & (_FP_OVERFLOW_##fs >> 1)) \
153 { \
154 X##_e = 1; \
155 _FP_FRAC_SET_##wc(X, _FP_ZEROFRAC_##wc); \
156 FP_SET_EXCEPTION(FP_EX_INEXACT); \
157 } \
158 else \
159 { \
160 X##_e = 0; \
161 _FP_FRAC_SRL_##wc(X, _FP_WORKBITS); \
162 } \
154 } \ 163 } \
155 if ((FP_CUR_EXCEPTIONS & FP_EX_INEXACT) || \ 164 if ((FP_CUR_EXCEPTIONS & FP_EX_INEXACT) || \
156 (FP_TRAPPING_EXCEPTIONS & FP_EX_UNDERFLOW)) \ 165 (FP_TRAPPING_EXCEPTIONS & FP_EX_UNDERFLOW)) \
@@ -494,6 +503,8 @@ do { \
494 R##_c = FP_CLS_NAN; \ 503 R##_c = FP_CLS_NAN; \
495 _FP_FRAC_SET_##wc(R, _FP_NANFRAC_##fs); \ 504 _FP_FRAC_SET_##wc(R, _FP_NANFRAC_##fs); \
496 FP_SET_EXCEPTION(FP_EX_INVALID | FP_EX_INVALID_IDI);\ 505 FP_SET_EXCEPTION(FP_EX_INVALID | FP_EX_INVALID_IDI);\
506 break; \
507 \
497 case _FP_CLS_COMBINE(FP_CLS_ZERO,FP_CLS_ZERO): \ 508 case _FP_CLS_COMBINE(FP_CLS_ZERO,FP_CLS_ZERO): \
498 R##_s = _FP_NANSIGN_##fs; \ 509 R##_s = _FP_NANSIGN_##fs; \
499 R##_c = FP_CLS_NAN; \ 510 R##_c = FP_CLS_NAN; \
diff --git a/scripts/checkstack.pl b/scripts/checkstack.pl
index f7e8e93ff30d..14ee68e991dd 100755
--- a/scripts/checkstack.pl
+++ b/scripts/checkstack.pl
@@ -14,6 +14,7 @@
14# M68k port by Geert Uytterhoeven and Andreas Schwab 14# M68k port by Geert Uytterhoeven and Andreas Schwab
15# AVR32 port by Haavard Skinnemoen <hskinnemoen@atmel.com> 15# AVR32 port by Haavard Skinnemoen <hskinnemoen@atmel.com>
16# PARISC port by Kyle McMartin <kyle@parisc-linux.org> 16# PARISC port by Kyle McMartin <kyle@parisc-linux.org>
17# sparc port by Martin Habets <errandir_news@mph.eclipse.co.uk>
17# 18#
18# Usage: 19# Usage:
19# objdump -d vmlinux | scripts/checkstack.pl [arch] 20# objdump -d vmlinux | scripts/checkstack.pl [arch]
@@ -94,6 +95,9 @@ my (@stack, $re, $dre, $x, $xs);
94 } elsif ($arch =~ /^blackfin$/) { 95 } elsif ($arch =~ /^blackfin$/) {
95 # 0: 00 e8 38 01 LINK 0x4e0; 96 # 0: 00 e8 38 01 LINK 0x4e0;
96 $re = qr/.*[[:space:]]LINK[[:space:]]*(0x$x{1,8})/o; 97 $re = qr/.*[[:space:]]LINK[[:space:]]*(0x$x{1,8})/o;
98 } elsif ($arch eq 'sparc' || $arch eq 'sparc64') {
99 # f0019d10: 9d e3 bf 90 save %sp, -112, %sp
100 $re = qr/.*save.*%sp, -(([0-9]{2}|[3-9])[0-9]{2}), %sp/o;
97 } else { 101 } else {
98 print("wrong or unknown architecture \"$arch\"\n"); 102 print("wrong or unknown architecture \"$arch\"\n");
99 exit 103 exit