diff options
Diffstat (limited to 'arch/arm/kernel/entry-common.S')
-rw-r--r-- | arch/arm/kernel/entry-common.S | 47 |
1 files changed, 27 insertions, 20 deletions
diff --git a/arch/arm/kernel/entry-common.S b/arch/arm/kernel/entry-common.S index bfa7f0af7ede..3657c5328a5b 100644 --- a/arch/arm/kernel/entry-common.S +++ b/arch/arm/kernel/entry-common.S | |||
@@ -33,14 +33,7 @@ ret_fast_syscall: | |||
33 | /* perform architecture specific actions before user return */ | 33 | /* perform architecture specific actions before user return */ |
34 | arch_ret_to_user r1, lr | 34 | arch_ret_to_user r1, lr |
35 | 35 | ||
36 | @ fast_restore_user_regs | 36 | restore_user_regs fast = 1, offset = S_OFF |
37 | ldr r1, [sp, #S_OFF + S_PSR] @ get calling cpsr | ||
38 | ldr lr, [sp, #S_OFF + S_PC]! @ get pc | ||
39 | msr spsr_cxsf, r1 @ save in spsr_svc | ||
40 | ldmdb sp, {r1 - lr}^ @ get calling r1 - lr | ||
41 | mov r0, r0 | ||
42 | add sp, sp, #S_FRAME_SIZE - S_PC | ||
43 | movs pc, lr @ return & move spsr_svc into cpsr | ||
44 | UNWIND(.fnend ) | 37 | UNWIND(.fnend ) |
45 | 38 | ||
46 | /* | 39 | /* |
@@ -73,14 +66,7 @@ no_work_pending: | |||
73 | /* perform architecture specific actions before user return */ | 66 | /* perform architecture specific actions before user return */ |
74 | arch_ret_to_user r1, lr | 67 | arch_ret_to_user r1, lr |
75 | 68 | ||
76 | @ slow_restore_user_regs | 69 | restore_user_regs fast = 0, offset = 0 |
77 | ldr r1, [sp, #S_PSR] @ get calling cpsr | ||
78 | ldr lr, [sp, #S_PC]! @ get pc | ||
79 | msr spsr_cxsf, r1 @ save in spsr_svc | ||
80 | ldmdb sp, {r0 - lr}^ @ get calling r0 - lr | ||
81 | mov r0, r0 | ||
82 | add sp, sp, #S_FRAME_SIZE - S_PC | ||
83 | movs pc, lr @ return & move spsr_svc into cpsr | ||
84 | ENDPROC(ret_to_user) | 70 | ENDPROC(ret_to_user) |
85 | 71 | ||
86 | /* | 72 | /* |
@@ -132,6 +118,25 @@ ftrace_call: | |||
132 | 118 | ||
133 | #else | 119 | #else |
134 | 120 | ||
121 | ENTRY(__gnu_mcount_nc) | ||
122 | stmdb sp!, {r0-r3, lr} | ||
123 | ldr r0, =ftrace_trace_function | ||
124 | ldr r2, [r0] | ||
125 | adr r0, ftrace_stub | ||
126 | cmp r0, r2 | ||
127 | bne gnu_trace | ||
128 | ldmia sp!, {r0-r3, ip, lr} | ||
129 | bx ip | ||
130 | |||
131 | gnu_trace: | ||
132 | ldr r1, [sp, #20] @ lr of instrumented routine | ||
133 | mov r0, lr | ||
134 | sub r0, r0, #MCOUNT_INSN_SIZE | ||
135 | mov lr, pc | ||
136 | mov pc, r2 | ||
137 | ldmia sp!, {r0-r3, ip, lr} | ||
138 | bx ip | ||
139 | |||
135 | ENTRY(mcount) | 140 | ENTRY(mcount) |
136 | stmdb sp!, {r0-r3, lr} | 141 | stmdb sp!, {r0-r3, lr} |
137 | ldr r0, =ftrace_trace_function | 142 | ldr r0, =ftrace_trace_function |
@@ -182,8 +187,10 @@ ftrace_stub: | |||
182 | ENTRY(vector_swi) | 187 | ENTRY(vector_swi) |
183 | sub sp, sp, #S_FRAME_SIZE | 188 | sub sp, sp, #S_FRAME_SIZE |
184 | stmia sp, {r0 - r12} @ Calling r0 - r12 | 189 | stmia sp, {r0 - r12} @ Calling r0 - r12 |
185 | add r8, sp, #S_PC | 190 | ARM( add r8, sp, #S_PC ) |
186 | stmdb r8, {sp, lr}^ @ Calling sp, lr | 191 | ARM( stmdb r8, {sp, lr}^ ) @ Calling sp, lr |
192 | THUMB( mov r8, sp ) | ||
193 | THUMB( store_user_sp_lr r8, r10, S_SP ) @ calling sp, lr | ||
187 | mrs r8, spsr @ called from non-FIQ mode, so ok. | 194 | mrs r8, spsr @ called from non-FIQ mode, so ok. |
188 | str lr, [sp, #S_PC] @ Save calling PC | 195 | str lr, [sp, #S_PC] @ Save calling PC |
189 | str r8, [sp, #S_PSR] @ Save CPSR | 196 | str r8, [sp, #S_PSR] @ Save CPSR |
@@ -272,7 +279,7 @@ ENTRY(vector_swi) | |||
272 | bne __sys_trace | 279 | bne __sys_trace |
273 | 280 | ||
274 | cmp scno, #NR_syscalls @ check upper syscall limit | 281 | cmp scno, #NR_syscalls @ check upper syscall limit |
275 | adr lr, ret_fast_syscall @ return address | 282 | adr lr, BSYM(ret_fast_syscall) @ return address |
276 | ldrcc pc, [tbl, scno, lsl #2] @ call sys_* routine | 283 | ldrcc pc, [tbl, scno, lsl #2] @ call sys_* routine |
277 | 284 | ||
278 | add r1, sp, #S_OFF | 285 | add r1, sp, #S_OFF |
@@ -293,7 +300,7 @@ __sys_trace: | |||
293 | mov r0, #0 @ trace entry [IP = 0] | 300 | mov r0, #0 @ trace entry [IP = 0] |
294 | bl syscall_trace | 301 | bl syscall_trace |
295 | 302 | ||
296 | adr lr, __sys_trace_return @ return address | 303 | adr lr, BSYM(__sys_trace_return) @ return address |
297 | mov scno, r0 @ syscall number (possibly new) | 304 | mov scno, r0 @ syscall number (possibly new) |
298 | add r1, sp, #S_R0 + S_OFF @ pointer to regs | 305 | add r1, sp, #S_R0 + S_OFF @ pointer to regs |
299 | cmp scno, #NR_syscalls @ check upper syscall limit | 306 | cmp scno, #NR_syscalls @ check upper syscall limit |