aboutsummaryrefslogtreecommitdiffstats
path: root/arch/m68knommu
diff options
context:
space:
mode:
authorGreg Ungerer <gerg@uclinux.org>2010-11-03 23:53:26 -0400
committerGreg Ungerer <gerg@uclinux.org>2011-01-05 00:19:18 -0500
commit1c83af5f9d7e15a091f11394ad5916a7dcf1a99e (patch)
treeaa41743fb552319bb53959a7df228233d4f04ba2 /arch/m68knommu
parent0762346034a3e94f9c3a5fe8d7c4bcaffbc1cd53 (diff)
m68knommu: use user stack pointer hardware on some ColdFire cores
The more modern ColdFire parts (even if based on older version cores) have separate user and supervisor stack pointers (a7 register). Modify the ColdFire CPU setup and exception code to enable and use this on parts that have it. Signed-off-by: Greg Ungerer <gerg@uclinux.org>
Diffstat (limited to 'arch/m68knommu')
-rw-r--r--arch/m68knommu/Kconfig10
-rw-r--r--arch/m68knommu/platform/coldfire/entry.S30
2 files changed, 20 insertions, 20 deletions
diff --git a/arch/m68knommu/Kconfig b/arch/m68knommu/Kconfig
index 266a39eebcad..e6f482d18d05 100644
--- a/arch/m68knommu/Kconfig
+++ b/arch/m68knommu/Kconfig
@@ -75,6 +75,10 @@ config GENERIC_CLOCKEVENTS
75config NO_IOPORT 75config NO_IOPORT
76 def_bool y 76 def_bool y
77 77
78config COLDFIRE_SW_A7
79 bool
80 default n
81
78source "init/Kconfig" 82source "init/Kconfig"
79 83
80source "kernel/Kconfig.freezer" 84source "kernel/Kconfig.freezer"
@@ -107,11 +111,13 @@ config M68360
107 111
108config M5206 112config M5206
109 bool "MCF5206" 113 bool "MCF5206"
114 select COLDFIRE_SW_A7
110 help 115 help
111 Motorola ColdFire 5206 processor support. 116 Motorola ColdFire 5206 processor support.
112 117
113config M5206e 118config M5206e
114 bool "MCF5206e" 119 bool "MCF5206e"
120 select COLDFIRE_SW_A7
115 help 121 help
116 Motorola ColdFire 5206e processor support. 122 Motorola ColdFire 5206e processor support.
117 123
@@ -129,6 +135,7 @@ config M523x
129 135
130config M5249 136config M5249
131 bool "MCF5249" 137 bool "MCF5249"
138 select COLDFIRE_SW_A7
132 help 139 help
133 Motorola ColdFire 5249 processor support. 140 Motorola ColdFire 5249 processor support.
134 141
@@ -139,6 +146,7 @@ config M5271
139 146
140config M5272 147config M5272
141 bool "MCF5272" 148 bool "MCF5272"
149 select COLDFIRE_SW_A7
142 help 150 help
143 Motorola ColdFire 5272 processor support. 151 Motorola ColdFire 5272 processor support.
144 152
@@ -155,6 +163,7 @@ config M528x
155 163
156config M5307 164config M5307
157 bool "MCF5307" 165 bool "MCF5307"
166 select COLDFIRE_SW_A7
158 help 167 help
159 Motorola ColdFire 5307 processor support. 168 Motorola ColdFire 5307 processor support.
160 169
@@ -165,6 +174,7 @@ config M532x
165 174
166config M5407 175config M5407
167 bool "MCF5407" 176 bool "MCF5407"
177 select COLDFIRE_SW_A7
168 help 178 help
169 Motorola ColdFire 5407 processor support. 179 Motorola ColdFire 5407 processor support.
170 180
diff --git a/arch/m68knommu/platform/coldfire/entry.S b/arch/m68knommu/platform/coldfire/entry.S
index b9ce31966181..f90e6173ccd4 100644
--- a/arch/m68knommu/platform/coldfire/entry.S
+++ b/arch/m68knommu/platform/coldfire/entry.S
@@ -36,13 +36,16 @@
36#include <asm/asm-offsets.h> 36#include <asm/asm-offsets.h>
37#include <asm/entry.h> 37#include <asm/entry.h>
38 38
39#ifdef CONFIG_COLDFIRE_SW_A7
40/*
41 * Define software copies of the supervisor and user stack pointers.
42 */
39.bss 43.bss
40
41sw_ksp: 44sw_ksp:
42.long 0 45.long 0
43
44sw_usp: 46sw_usp:
45.long 0 47.long 0
48#endif /* CONFIG_COLDFIRE_SW_A7 */
46 49
47.text 50.text
48 51
@@ -52,6 +55,7 @@ sw_usp:
52.globl ret_from_signal 55.globl ret_from_signal
53.globl sys_call_table 56.globl sys_call_table
54.globl inthandler 57.globl inthandler
58.globl fasthandler
55 59
56enosys: 60enosys:
57 mov.l #sys_ni_syscall,%d3 61 mov.l #sys_ni_syscall,%d3
@@ -138,20 +142,7 @@ Luser_return:
138 jne Lwork_to_do /* still work to do */ 142 jne Lwork_to_do /* still work to do */
139 143
140Lreturn: 144Lreturn:
141 move #0x2700,%sr /* disable intrs */ 145 RESTORE_USER
142 movel sw_usp,%a0 /* get usp */
143 movel %sp@(PT_OFF_PC),%a0@- /* copy exception program counter */
144 movel %sp@(PT_OFF_FORMATVEC),%a0@- /* copy exception format/vector/sr */
145 moveml %sp@,%d1-%d5/%a0-%a2
146 lea %sp@(32),%sp /* space for 8 regs */
147 movel %sp@+,%d0
148 addql #4,%sp /* orig d0 */
149 addl %sp@+,%sp /* stk adj */
150 addql #8,%sp /* remove exception */
151 movel %sp,sw_ksp /* save ksp */
152 subql #8,sw_usp /* set exception */
153 movel sw_usp,%sp /* restore usp */
154 rte
155 146
156Lwork_to_do: 147Lwork_to_do:
157 movel %a0@(TI_FLAGS),%d1 /* get thread_info->flags */ 148 movel %a0@(TI_FLAGS),%d1 /* get thread_info->flags */
@@ -201,9 +192,8 @@ ENTRY(inthandler)
201 */ 192 */
202ENTRY(resume) 193ENTRY(resume)
203 movel %a0, %d1 /* get prev thread in d1 */ 194 movel %a0, %d1 /* get prev thread in d1 */
204 195 RDUSP
205 movel sw_usp,%d0 /* save usp */ 196 movel %a2,%a0@(TASK_THREAD+THREAD_USP)
206 movel %d0,%a0@(TASK_THREAD+THREAD_USP)
207 197
208 SAVE_SWITCH_STACK 198 SAVE_SWITCH_STACK
209 movel %sp,%a0@(TASK_THREAD+THREAD_KSP) /* save kernel stack pointer */ 199 movel %sp,%a0@(TASK_THREAD+THREAD_KSP) /* save kernel stack pointer */
@@ -211,5 +201,5 @@ ENTRY(resume)
211 RESTORE_SWITCH_STACK 201 RESTORE_SWITCH_STACK
212 202
213 movel %a1@(TASK_THREAD+THREAD_USP),%a0 /* restore thread user stack */ 203 movel %a1@(TASK_THREAD+THREAD_USP),%a0 /* restore thread user stack */
214 movel %a0, sw_usp 204 WRUSP
215 rts 205 rts