]> git.wh0rd.org Git - patches.git/blob - blackfin-retn-or-rete.patch
initial import
[patches.git] / blackfin-retn-or-rete.patch
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)
5 @@ -58,6 +58,12 @@
6  
7  #include <asm/mach-common/context.S>
8  
9 +#ifdef CONFIG_BFIN_SCRATCH_REG_RETN
10 +# define EX_SCRATCH_REG RETN
11 +#else
12 +# define EX_SCRATCH_REG RETE
13 +#endif
14 +
15  #ifdef CONFIG_EXCPT_IRQ_SYSC_L1
16  .section .l1.text
17  #else
18 @@ -93,7 +99,7 @@ ENTRY(_ex_icplb)
19         call __cplb_hdr;
20         DEBUG_START_HWTRACE(p5, r7)
21         RESTORE_ALL_SYS
22 -       SP = RETN;
23 +       SP = EX_SCRATCH_REG;
24         rtx;
25  ENDPROC(_ex_icplb)
26  
27 @@ -102,7 +108,7 @@ ENTRY(_ex_syscall)
28         (R7:6,P5:4) = [sp++];
29         ASTAT = [sp++];
30         raise 15;               /* invoked by TRAP #0, for sys call */
31 -       sp = retn;
32 +       sp = EX_SCRATCH_REG;
33         rtx
34  ENDPROC(_ex_syscall)
35  
36 @@ -145,7 +151,7 @@ _return_from_exception:
37  #endif
38         (R7:6,P5:4) = [sp++];
39         ASTAT = [sp++];
40 -       sp = retn;
41 +       sp = EX_SCRATCH_REG;
42         rtx;
43  ENDPROC(_ex_soft_bp)
44  
45 @@ -204,7 +210,7 @@ ENTRY(_ex_trap_c)
46         DEBUG_START_HWTRACE(p5, r7)
47         (R7:6,P5:4) = [sp++];
48         ASTAT = [sp++];
49 -       SP = RETN;
50 +       SP = EX_SCRATCH_REG;
51         raise 5;
52         rtx;
53  ENDPROC(_ex_trap_c)
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).
57          */
58 -       retn = sp;
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
68         help
69           Select the LED (marked on the board) for you to blink.
70  
71 +choice
72 +       prompt "Blackfin Exception Scratch Register"
73 +       default BFIN_SCRATCH_REG_RETN
74 +
75 +config BFIN_SCRATCH_REG_RETN
76 +       bool "RETN"
77 +       help
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.
82 +
83 +         If you are unsure, please select "RETN".
84 +
85 +config BFIN_SCRATCH_REG_RETE
86 +       bool "RETE"
87 +       help
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.
92 +
93 +         If you are unsure, please select "RETN".
94 +
95 +endchoice
96 +
97  #
98  # Sorry - but you need to put the hex address here -
99  #