aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/lib
diff options
context:
space:
mode:
authorLaura Abbott <lauraa@codeaurora.org>2011-05-27 12:23:16 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2011-05-27 17:56:53 -0400
commit81479c246c07b703aeb4bf54933b7d928cb5b717 (patch)
tree2ad7888a68ad944292c455d2ee4fc242bcc79a5c /arch/arm/lib
parent45b95235b0ac86cef2ad4480b0618b8778847479 (diff)
ARM: 6945/1: Add unwinding support for division functions
The software division functions never had unwinding annotations added. Currently, when a division by zero occurs the backtrace shown will stop at Ldiv0 or some completely unrelated function. Add unwinding annotations in hopes of getting a more useful backtrace when a division by zero occurs. Signed-off-by: Laura Abbott <lauraa@codeaurora.org> Acked-by: Dave Martin <dave.martin@linaro.org> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/lib')
-rw-r--r--arch/arm/lib/lib1funcs.S25
1 files changed, 20 insertions, 5 deletions
diff --git a/arch/arm/lib/lib1funcs.S b/arch/arm/lib/lib1funcs.S
index 6dc06487f3c3..c562f649734c 100644
--- a/arch/arm/lib/lib1funcs.S
+++ b/arch/arm/lib/lib1funcs.S
@@ -35,7 +35,7 @@ Boston, MA 02111-1307, USA. */
35 35
36#include <linux/linkage.h> 36#include <linux/linkage.h>
37#include <asm/assembler.h> 37#include <asm/assembler.h>
38 38#include <asm/unwind.h>
39 39
40.macro ARM_DIV_BODY dividend, divisor, result, curbit 40.macro ARM_DIV_BODY dividend, divisor, result, curbit
41 41
@@ -207,6 +207,7 @@ Boston, MA 02111-1307, USA. */
207 207
208ENTRY(__udivsi3) 208ENTRY(__udivsi3)
209ENTRY(__aeabi_uidiv) 209ENTRY(__aeabi_uidiv)
210UNWIND(.fnstart)
210 211
211 subs r2, r1, #1 212 subs r2, r1, #1
212 moveq pc, lr 213 moveq pc, lr
@@ -230,10 +231,12 @@ ENTRY(__aeabi_uidiv)
230 mov r0, r0, lsr r2 231 mov r0, r0, lsr r2
231 mov pc, lr 232 mov pc, lr
232 233
234UNWIND(.fnend)
233ENDPROC(__udivsi3) 235ENDPROC(__udivsi3)
234ENDPROC(__aeabi_uidiv) 236ENDPROC(__aeabi_uidiv)
235 237
236ENTRY(__umodsi3) 238ENTRY(__umodsi3)
239UNWIND(.fnstart)
237 240
238 subs r2, r1, #1 @ compare divisor with 1 241 subs r2, r1, #1 @ compare divisor with 1
239 bcc Ldiv0 242 bcc Ldiv0
@@ -247,10 +250,12 @@ ENTRY(__umodsi3)
247 250
248 mov pc, lr 251 mov pc, lr
249 252
253UNWIND(.fnend)
250ENDPROC(__umodsi3) 254ENDPROC(__umodsi3)
251 255
252ENTRY(__divsi3) 256ENTRY(__divsi3)
253ENTRY(__aeabi_idiv) 257ENTRY(__aeabi_idiv)
258UNWIND(.fnstart)
254 259
255 cmp r1, #0 260 cmp r1, #0
256 eor ip, r0, r1 @ save the sign of the result. 261 eor ip, r0, r1 @ save the sign of the result.
@@ -287,10 +292,12 @@ ENTRY(__aeabi_idiv)
287 rsbmi r0, r0, #0 292 rsbmi r0, r0, #0
288 mov pc, lr 293 mov pc, lr
289 294
295UNWIND(.fnend)
290ENDPROC(__divsi3) 296ENDPROC(__divsi3)
291ENDPROC(__aeabi_idiv) 297ENDPROC(__aeabi_idiv)
292 298
293ENTRY(__modsi3) 299ENTRY(__modsi3)
300UNWIND(.fnstart)
294 301
295 cmp r1, #0 302 cmp r1, #0
296 beq Ldiv0 303 beq Ldiv0
@@ -310,11 +317,14 @@ ENTRY(__modsi3)
310 rsbmi r0, r0, #0 317 rsbmi r0, r0, #0
311 mov pc, lr 318 mov pc, lr
312 319
320UNWIND(.fnend)
313ENDPROC(__modsi3) 321ENDPROC(__modsi3)
314 322
315#ifdef CONFIG_AEABI 323#ifdef CONFIG_AEABI
316 324
317ENTRY(__aeabi_uidivmod) 325ENTRY(__aeabi_uidivmod)
326UNWIND(.fnstart)
327UNWIND(.save {r0, r1, ip, lr} )
318 328
319 stmfd sp!, {r0, r1, ip, lr} 329 stmfd sp!, {r0, r1, ip, lr}
320 bl __aeabi_uidiv 330 bl __aeabi_uidiv
@@ -323,10 +333,12 @@ ENTRY(__aeabi_uidivmod)
323 sub r1, r1, r3 333 sub r1, r1, r3
324 mov pc, lr 334 mov pc, lr
325 335
336UNWIND(.fnend)
326ENDPROC(__aeabi_uidivmod) 337ENDPROC(__aeabi_uidivmod)
327 338
328ENTRY(__aeabi_idivmod) 339ENTRY(__aeabi_idivmod)
329 340UNWIND(.fnstart)
341UNWIND(.save {r0, r1, ip, lr} )
330 stmfd sp!, {r0, r1, ip, lr} 342 stmfd sp!, {r0, r1, ip, lr}
331 bl __aeabi_idiv 343 bl __aeabi_idiv
332 ldmfd sp!, {r1, r2, ip, lr} 344 ldmfd sp!, {r1, r2, ip, lr}
@@ -334,15 +346,18 @@ ENTRY(__aeabi_idivmod)
334 sub r1, r1, r3 346 sub r1, r1, r3
335 mov pc, lr 347 mov pc, lr
336 348
349UNWIND(.fnend)
337ENDPROC(__aeabi_idivmod) 350ENDPROC(__aeabi_idivmod)
338 351
339#endif 352#endif
340 353
341Ldiv0: 354Ldiv0:
342 355UNWIND(.fnstart)
356UNWIND(.pad #4)
357UNWIND(.save {lr})
343 str lr, [sp, #-8]! 358 str lr, [sp, #-8]!
344 bl __div0 359 bl __div0
345 mov r0, #0 @ About as wrong as it could be. 360 mov r0, #0 @ About as wrong as it could be.
346 ldr pc, [sp], #8 361 ldr pc, [sp], #8
347 362UNWIND(.fnend)
348 363ENDPROC(Ldiv0)