Skip to content

Commit

Permalink
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
torvalds committed Oct 24, 2008
2 parents 969907a + 60b8267 commit 5579a78
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 9 deletions.
2 changes: 1 addition & 1 deletion arch/sparc/kernel/apc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
1 change: 1 addition & 0 deletions arch/sparc/kernel/head.S
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,7 @@ gokernel:
mov %o7, %g4 ! Save %o7

/* Jump to it, and pray... */
__INIT
current_pc:
call 1f
nop
Expand Down
18 changes: 14 additions & 4 deletions arch/sparc64/kernel/trampoline.S
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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)
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
19 changes: 15 additions & 4 deletions include/math-emu/op-common.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)) \
Expand Down Expand Up @@ -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; \
Expand Down
4 changes: 4 additions & 0 deletions scripts/checkstack.pl
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
# M68k port by Geert Uytterhoeven and Andreas Schwab
# AVR32 port by Haavard Skinnemoen <[email protected]>
# PARISC port by Kyle McMartin <[email protected]>
# sparc port by Martin Habets <[email protected]>
#
# Usage:
# objdump -d vmlinux | scripts/checkstack.pl [arch]
Expand Down Expand Up @@ -94,6 +95,9 @@
} 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
Expand Down

0 comments on commit 5579a78

Please sign in to comment.