1 Index: arch/blackfin/mach-common/entry.S
2 ===================================================================
3 --- arch/blackfin/mach-common/entry.S (revision 3496)
4 +++ arch/blackfin/mach-common/entry.S (working copy)
7 #include <asm/mach-common/context.S>
9 +#ifdef CONFIG_BFIN_SCRATCH_REG_RETN
10 +# define EX_SCRATCH_REG RETN
12 +# define EX_SCRATCH_REG RETE
15 #ifdef CONFIG_EXCPT_IRQ_SYSC_L1
18 @@ -93,7 +99,7 @@ ENTRY(_ex_icplb)
20 DEBUG_START_HWTRACE(p5, r7)
23 + SP = EX_SCRATCH_REG;
27 @@ -102,7 +108,7 @@ ENTRY(_ex_syscall)
30 raise 15; /* invoked by TRAP #0, for sys call */
32 + sp = EX_SCRATCH_REG;
36 @@ -145,7 +151,7 @@ _return_from_exception:
41 + sp = EX_SCRATCH_REG;
45 @@ -204,7 +210,7 @@ ENTRY(_ex_trap_c)
46 DEBUG_START_HWTRACE(p5, r7)
50 + SP = EX_SCRATCH_REG;
54 @@ -279,7 +285,7 @@ ENTRY(_trap) /* Exception: 4th entry int
55 * covered by a CPLB. Switch to an exception stack; use RETN as a
56 * scratch register (for want of a better option).
59 + EX_SCRATCH_REG = sp;
60 sp.l = _exception_stack_top;
61 sp.h = _exception_stack_top;
62 /* Try to deal with syscalls quickly. */
63 Index: arch/blackfin/Kconfig
64 ===================================================================
65 --- arch/blackfin/Kconfig (revision 3496)
66 +++ arch/blackfin/Kconfig (working copy)
67 @@ -520,6 +520,32 @@ config BFIN_IDLE_LED_NUM
69 Select the LED (marked on the board) for you to blink.
72 + prompt "Blackfin Exception Scratch Register"
73 + default BFIN_SCRATCH_REG_RETN
75 +config BFIN_SCRATCH_REG_RETN
78 + Use the RETN register in the Blackfin exception handler
79 + as a stack scratch register. This means you cannot
80 + safely use NMI on the Blackfin while running Linux, but
81 + you can debug the system with a JTAG ICE.
83 + If you are unsure, please select "RETN".
85 +config BFIN_SCRATCH_REG_RETE
88 + Use the RETE register in the Blackfin exception handler
89 + as a stack scratch register. This means you cannot
90 + safely use a JTAG ICE while debugging a Blackfin board,
91 + but you can safely use the NMI.
93 + If you are unsure, please select "RETN".
98 # Sorry - but you need to put the hex address here -