Merge tag 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm
[sfrench/cifs-2.6.git] / arch / arm / lib / backtrace-clang.S
index 5b2cdb1003e35806d0873880d741c70b1d41024d..290c52a60fc65878a9304ca68c00deae8d185a8f 100644 (file)
@@ -144,7 +144,7 @@ for_each_frame:     tst     frame, mask             @ Check for address exceptions
  */
 1003:          ldr     sv_lr, [sv_fp, #4]      @ get saved lr from next frame
 
-               ldr     r0, [sv_lr, #-4]        @ get call instruction
+1004:          ldr     r0, [sv_lr, #-4]        @ get call instruction
                ldr     r3, .Lopcode+4
                and     r2, r3, r0              @ is this a bl call
                teq     r2, r3
@@ -164,7 +164,7 @@ finished_setup:
 /*
  * Print the function (sv_pc) and where it was called from (sv_lr).
  */
-1004:          mov     r0, sv_pc
+               mov     r0, sv_pc
 
                mov     r1, sv_lr
                mov     r2, frame
@@ -197,6 +197,14 @@ finished_setup:
 
                cmp     sv_fp, frame            @ next frame must be
                mov     frame, sv_fp            @ above the current frame
+#ifdef CONFIG_IRQSTACKS
+               @
+               @ Kernel stacks may be discontiguous in memory. If the next
+               @ frame is below the previous frame, accept it as long as it
+               @ lives in kernel memory.
+               @
+               cmpls   sv_fp, #PAGE_OFFSET
+#endif
                bhi     for_each_frame
 
 1006:          adr     r0, .Lbad
@@ -210,7 +218,7 @@ ENDPROC(c_backtrace)
                .long   1001b, 1006b
                .long   1002b, 1006b
                .long   1003b, 1006b
-               .long   1004b, 1006b
+               .long   1004b, finished_setup
                .long   1005b, 1006b
                .popsection