aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mm/proc-arm6_7.S
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2011-06-27 07:27:47 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2011-07-02 05:56:12 -0400
commit40f0b90a2f16f433f9afbfef4b7c312efb54e933 (patch)
tree70f9ba82308817eabc79f915babd33862d716506 /arch/arm/mm/proc-arm6_7.S
parent108f6af0a82cf3b61f3ac6728e2241805a935b64 (diff)
ARM: entry: data abort: ensure r5 is preserved by abort functions
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mm/proc-arm6_7.S')
-rw-r--r--arch/arm/mm/proc-arm6_7.S33
1 files changed, 16 insertions, 17 deletions
diff --git a/arch/arm/mm/proc-arm6_7.S b/arch/arm/mm/proc-arm6_7.S
index 4d963114c66b..50e3543d03bf 100644
--- a/arch/arm/mm/proc-arm6_7.S
+++ b/arch/arm/mm/proc-arm6_7.S
@@ -35,8 +35,7 @@ ENTRY(cpu_arm7_dcache_clean_area)
35 * 35 *
36 * Purpose : obtain information about current aborted instruction 36 * Purpose : obtain information about current aborted instruction
37 * 37 *
38 * Returns : r0 = address of abort 38 * Returns : r4-r5, r10-r11, r13 preserved
39 * : r1 = FSR
40 */ 39 */
41 40
42ENTRY(cpu_arm7_data_abort) 41ENTRY(cpu_arm7_data_abort)
@@ -95,21 +94,21 @@ ENTRY(cpu_arm6_data_abort)
95 add r6, r6, r6, lsr #8 94 add r6, r6, r6, lsr #8
96 add r6, r6, r6, lsr #4 95 add r6, r6, r6, lsr #4
97 and r6, r6, #15 @ r6 = no. of registers to transfer. 96 and r6, r6, #15 @ r6 = no. of registers to transfer.
98 and r5, r8, #15 << 16 @ Extract 'n' from instruction 97 and r9, r8, #15 << 16 @ Extract 'n' from instruction
99 ldr r7, [r2, r5, lsr #14] @ Get register 'Rn' 98 ldr r7, [r2, r9, lsr #14] @ Get register 'Rn'
100 tst r8, #1 << 23 @ Check U bit 99 tst r8, #1 << 23 @ Check U bit
101 subne r7, r7, r6, lsl #2 @ Undo increment 100 subne r7, r7, r6, lsl #2 @ Undo increment
102 addeq r7, r7, r6, lsl #2 @ Undo decrement 101 addeq r7, r7, r6, lsl #2 @ Undo decrement
103 str r7, [r2, r5, lsr #14] @ Put register 'Rn' 102 str r7, [r2, r9, lsr #14] @ Put register 'Rn'
104 b do_DataAbort 103 b do_DataAbort
105 104
106.data_arm_apply_r6_and_rn: 105.data_arm_apply_r6_and_rn:
107 and r5, r8, #15 << 16 @ Extract 'n' from instruction 106 and r9, r8, #15 << 16 @ Extract 'n' from instruction
108 ldr r7, [r2, r5, lsr #14] @ Get register 'Rn' 107 ldr r7, [r2, r9, lsr #14] @ Get register 'Rn'
109 tst r8, #1 << 23 @ Check U bit 108 tst r8, #1 << 23 @ Check U bit
110 subne r7, r7, r6 @ Undo incrmenet 109 subne r7, r7, r6 @ Undo incrmenet
111 addeq r7, r7, r6 @ Undo decrement 110 addeq r7, r7, r6 @ Undo decrement
112 str r7, [r2, r5, lsr #14] @ Put register 'Rn' 111 str r7, [r2, r9, lsr #14] @ Put register 'Rn'
113 b do_DataAbort 112 b do_DataAbort
114 113
115.data_arm_lateldrpreconst: 114.data_arm_lateldrpreconst:
@@ -118,12 +117,12 @@ ENTRY(cpu_arm6_data_abort)
118.data_arm_lateldrpostconst: 117.data_arm_lateldrpostconst:
119 movs r6, r8, lsl #20 @ Get offset 118 movs r6, r8, lsl #20 @ Get offset
120 beq do_DataAbort @ zero -> no fixup 119 beq do_DataAbort @ zero -> no fixup
121 and r5, r8, #15 << 16 @ Extract 'n' from instruction 120 and r9, r8, #15 << 16 @ Extract 'n' from instruction
122 ldr r7, [r2, r5, lsr #14] @ Get register 'Rn' 121 ldr r7, [r2, r9, lsr #14] @ Get register 'Rn'
123 tst r8, #1 << 23 @ Check U bit 122 tst r8, #1 << 23 @ Check U bit
124 subne r7, r7, r6, lsr #20 @ Undo increment 123 subne r7, r7, r6, lsr #20 @ Undo increment
125 addeq r7, r7, r6, lsr #20 @ Undo decrement 124 addeq r7, r7, r6, lsr #20 @ Undo decrement
126 str r7, [r2, r5, lsr #14] @ Put register 'Rn' 125 str r7, [r2, r9, lsr #14] @ Put register 'Rn'
127 b do_DataAbort 126 b do_DataAbort
128 127
129.data_arm_lateldrprereg: 128.data_arm_lateldrprereg:
@@ -132,14 +131,14 @@ ENTRY(cpu_arm6_data_abort)
132.data_arm_lateldrpostreg: 131.data_arm_lateldrpostreg:
133 and r7, r8, #15 @ Extract 'm' from instruction 132 and r7, r8, #15 @ Extract 'm' from instruction
134 ldr r6, [r2, r7, lsl #2] @ Get register 'Rm' 133 ldr r6, [r2, r7, lsl #2] @ Get register 'Rm'
135 mov r5, r8, lsr #7 @ get shift count 134 mov r9, r8, lsr #7 @ get shift count
136 ands r5, r5, #31 135 ands r9, r9, #31
137 and r7, r8, #0x70 @ get shift type 136 and r7, r8, #0x70 @ get shift type
138 orreq r7, r7, #8 @ shift count = 0 137 orreq r7, r7, #8 @ shift count = 0
139 add pc, pc, r7 138 add pc, pc, r7
140 nop 139 nop
141 140
142 mov r6, r6, lsl r5 @ 0: LSL #!0 141 mov r6, r6, lsl r9 @ 0: LSL #!0
143 b .data_arm_apply_r6_and_rn 142 b .data_arm_apply_r6_and_rn
144 b .data_arm_apply_r6_and_rn @ 1: LSL #0 143 b .data_arm_apply_r6_and_rn @ 1: LSL #0
145 nop 144 nop
@@ -147,7 +146,7 @@ ENTRY(cpu_arm6_data_abort)
147 nop 146 nop
148 b .data_unknown @ 3: MUL? 147 b .data_unknown @ 3: MUL?
149 nop 148 nop
150 mov r6, r6, lsr r5 @ 4: LSR #!0 149 mov r6, r6, lsr r9 @ 4: LSR #!0
151 b .data_arm_apply_r6_and_rn 150 b .data_arm_apply_r6_and_rn
152 mov r6, r6, lsr #32 @ 5: LSR #32 151 mov r6, r6, lsr #32 @ 5: LSR #32
153 b .data_arm_apply_r6_and_rn 152 b .data_arm_apply_r6_and_rn
@@ -155,7 +154,7 @@ ENTRY(cpu_arm6_data_abort)
155 nop 154 nop
156 b .data_unknown @ 7: MUL? 155 b .data_unknown @ 7: MUL?
157 nop 156 nop
158 mov r6, r6, asr r5 @ 8: ASR #!0 157 mov r6, r6, asr r9 @ 8: ASR #!0
159 b .data_arm_apply_r6_and_rn 158 b .data_arm_apply_r6_and_rn
160 mov r6, r6, asr #32 @ 9: ASR #32 159 mov r6, r6, asr #32 @ 9: ASR #32
161 b .data_arm_apply_r6_and_rn 160 b .data_arm_apply_r6_and_rn
@@ -163,7 +162,7 @@ ENTRY(cpu_arm6_data_abort)
163 nop 162 nop
164 b .data_unknown @ B: MUL? 163 b .data_unknown @ B: MUL?
165 nop 164 nop
166 mov r6, r6, ror r5 @ C: ROR #!0 165 mov r6, r6, ror r9 @ C: ROR #!0
167 b .data_arm_apply_r6_and_rn 166 b .data_arm_apply_r6_and_rn
168 mov r6, r6, rrx @ D: RRX 167 mov r6, r6, rrx @ D: RRX
169 b .data_arm_apply_r6_and_rn 168 b .data_arm_apply_r6_and_rn