diff options
-rw-r--r-- | arch/arm/kernel/entry-common.S | 28 | ||||
-rw-r--r-- | arch/arm/kernel/entry-header.S | 51 |
2 files changed, 25 insertions, 54 deletions
diff --git a/arch/arm/kernel/entry-common.S b/arch/arm/kernel/entry-common.S index 65c58b34db97..07da010b67d4 100644 --- a/arch/arm/kernel/entry-common.S +++ b/arch/arm/kernel/entry-common.S | |||
@@ -27,7 +27,15 @@ ret_fast_syscall: | |||
27 | ldr r1, [tsk, #TI_FLAGS] | 27 | ldr r1, [tsk, #TI_FLAGS] |
28 | tst r1, #_TIF_WORK_MASK | 28 | tst r1, #_TIF_WORK_MASK |
29 | bne fast_work_pending | 29 | bne fast_work_pending |
30 | fast_restore_user_regs | 30 | |
31 | @ fast_restore_user_regs | ||
32 | ldr r1, [sp, #S_OFF + S_PSR] @ get calling cpsr | ||
33 | ldr lr, [sp, #S_OFF + S_PC]! @ get pc | ||
34 | msr spsr_cxsf, r1 @ save in spsr_svc | ||
35 | ldmdb sp, {r1 - lr}^ @ get calling r1 - lr | ||
36 | mov r0, r0 | ||
37 | add sp, sp, #S_FRAME_SIZE - S_PC | ||
38 | movs pc, lr @ return & move spsr_svc into cpsr | ||
31 | 39 | ||
32 | /* | 40 | /* |
33 | * Ok, we need to do extra processing, enter the slow path. | 41 | * Ok, we need to do extra processing, enter the slow path. |
@@ -57,7 +65,14 @@ ret_slow_syscall: | |||
57 | tst r1, #_TIF_WORK_MASK | 65 | tst r1, #_TIF_WORK_MASK |
58 | bne work_pending | 66 | bne work_pending |
59 | no_work_pending: | 67 | no_work_pending: |
60 | slow_restore_user_regs | 68 | @ slow_restore_user_regs |
69 | ldr r1, [sp, #S_PSR] @ get calling cpsr | ||
70 | ldr lr, [sp, #S_PC]! @ get pc | ||
71 | msr spsr_cxsf, r1 @ save in spsr_svc | ||
72 | ldmdb sp, {r0 - lr}^ @ get calling r1 - lr | ||
73 | mov r0, r0 | ||
74 | add sp, sp, #S_FRAME_SIZE - S_PC | ||
75 | movs pc, lr @ return & move spsr_svc into cpsr | ||
61 | 76 | ||
62 | /* | 77 | /* |
63 | * This is how we return from a fork. | 78 | * This is how we return from a fork. |
@@ -109,7 +124,14 @@ ENTRY(ret_from_fork) | |||
109 | 124 | ||
110 | .align 5 | 125 | .align 5 |
111 | ENTRY(vector_swi) | 126 | ENTRY(vector_swi) |
112 | save_user_regs | 127 | sub sp, sp, #S_FRAME_SIZE |
128 | stmia sp, {r0 - r12} @ Calling r0 - r12 | ||
129 | add r8, sp, #S_PC | ||
130 | stmdb r8, {sp, lr}^ @ Calling sp, lr | ||
131 | mrs r8, spsr @ called from non-FIQ mode, so ok. | ||
132 | str lr, [sp, #S_PC] @ Save calling PC | ||
133 | str r8, [sp, #S_PSR] @ Save CPSR | ||
134 | str r0, [sp, #S_OLD_R0] @ Save OLD_R0 | ||
113 | zero_fp | 135 | zero_fp |
114 | 136 | ||
115 | /* | 137 | /* |
diff --git a/arch/arm/kernel/entry-header.S b/arch/arm/kernel/entry-header.S index b7d54a4f98f4..956af0bff3ff 100644 --- a/arch/arm/kernel/entry-header.S +++ b/arch/arm/kernel/entry-header.S | |||
@@ -57,57 +57,6 @@ | |||
57 | .endm | 57 | .endm |
58 | #endif | 58 | #endif |
59 | 59 | ||
60 | .macro save_user_regs | ||
61 | sub sp, sp, #S_FRAME_SIZE | ||
62 | stmia sp, {r0 - r12} @ Calling r0 - r12 | ||
63 | add r8, sp, #S_PC | ||
64 | stmdb r8, {sp, lr}^ @ Calling sp, lr | ||
65 | mrs r8, spsr @ called from non-FIQ mode, so ok. | ||
66 | str lr, [sp, #S_PC] @ Save calling PC | ||
67 | str r8, [sp, #S_PSR] @ Save CPSR | ||
68 | str r0, [sp, #S_OLD_R0] @ Save OLD_R0 | ||
69 | .endm | ||
70 | |||
71 | .macro restore_user_regs | ||
72 | ldr r1, [sp, #S_PSR] @ Get calling cpsr | ||
73 | disable_irq ip @ disable IRQs | ||
74 | ldr lr, [sp, #S_PC]! @ Get PC | ||
75 | msr spsr_cxsf, r1 @ save in spsr_svc | ||
76 | ldmdb sp, {r0 - lr}^ @ Get calling r0 - lr | ||
77 | mov r0, r0 | ||
78 | add sp, sp, #S_FRAME_SIZE - S_PC | ||
79 | movs pc, lr @ return & move spsr_svc into cpsr | ||
80 | .endm | ||
81 | |||
82 | /* | ||
83 | * Must be called with IRQs already disabled. | ||
84 | */ | ||
85 | .macro fast_restore_user_regs | ||
86 | ldr r1, [sp, #S_OFF + S_PSR] @ get calling cpsr | ||
87 | ldr lr, [sp, #S_OFF + S_PC]! @ get pc | ||
88 | msr spsr_cxsf, r1 @ save in spsr_svc | ||
89 | ldmdb sp, {r1 - lr}^ @ get calling r1 - lr | ||
90 | mov r0, r0 | ||
91 | add sp, sp, #S_FRAME_SIZE - S_PC | ||
92 | movs pc, lr @ return & move spsr_svc into cpsr | ||
93 | .endm | ||
94 | |||
95 | /* | ||
96 | * Must be called with IRQs already disabled. | ||
97 | */ | ||
98 | .macro slow_restore_user_regs | ||
99 | ldr r1, [sp, #S_PSR] @ get calling cpsr | ||
100 | ldr lr, [sp, #S_PC]! @ get pc | ||
101 | msr spsr_cxsf, r1 @ save in spsr_svc | ||
102 | ldmdb sp, {r0 - lr}^ @ get calling r1 - lr | ||
103 | mov r0, r0 | ||
104 | add sp, sp, #S_FRAME_SIZE - S_PC | ||
105 | movs pc, lr @ return & move spsr_svc into cpsr | ||
106 | .endm | ||
107 | |||
108 | .macro mask_pc, rd, rm | ||
109 | .endm | ||
110 | |||
111 | .macro get_thread_info, rd | 60 | .macro get_thread_info, rd |
112 | mov \rd, sp, lsr #13 | 61 | mov \rd, sp, lsr #13 |
113 | mov \rd, \rd, lsl #13 | 62 | mov \rd, \rd, lsl #13 |