summaryrefslogtreecommitdiffstats
path: root/arch/microblaze/kernel/entry-nommu.S
diff options
context:
space:
mode:
authorSteven J. Magnani2010-04-27 19:37:54 +0200
committerMichal Simek2010-08-04 10:22:35 +0200
commitce3266c047389443d5f433d605c769e878cbe46e (patch)
treee638a255d5d0f1b000a81b512dc605b92d0b8701 /arch/microblaze/kernel/entry-nommu.S
parentmicroblaze: Allow PAGE_SIZE configuration (diff)
downloadkernel-qcow2-linux-ce3266c047389443d5f433d605c769e878cbe46e.tar.gz
kernel-qcow2-linux-ce3266c047389443d5f433d605c769e878cbe46e.tar.xz
kernel-qcow2-linux-ce3266c047389443d5f433d605c769e878cbe46e.zip
microblaze: Add stack unwinder
Implement intelligent backtracing by searching for stack frame creation, and emitting only return addresses. Use print_hex_dump() to display the entire binary kernel stack. Limitation: MMU kernels are not currently able to trace beyond a system trap (interrupt, syscall, etc.). It is the intent of this patch to provide infrastructure that can be extended to add this capability later. Changes from V1: * Removed checks in find_frame_creation() that prevented location of the frame creation instruction in heavily optimized code * Various formatting/commenting/file location tweaks per review comments * Dropped Kconfig option to enable STACKTRACE as something logically separate Signed-off-by: Steven J. Magnani <steve@digidescorp.com>
Diffstat (limited to 'arch/microblaze/kernel/entry-nommu.S')
-rw-r--r--arch/microblaze/kernel/entry-nommu.S28
1 files changed, 28 insertions, 0 deletions
diff --git a/arch/microblaze/kernel/entry-nommu.S b/arch/microblaze/kernel/entry-nommu.S
index 8cc18cd2cce6..ca84368570b6 100644
--- a/arch/microblaze/kernel/entry-nommu.S
+++ b/arch/microblaze/kernel/entry-nommu.S
@@ -588,3 +588,31 @@ sys_rt_sigsuspend_wrapper:
#include "syscall_table.S"
syscall_table_size=(.-sys_call_table)
+
+type_SYSCALL:
+ .ascii "SYSCALL\0"
+type_IRQ:
+ .ascii "IRQ\0"
+type_IRQ_PREEMPT:
+ .ascii "IRQ (PREEMPTED)\0"
+type_SYSCALL_PREEMPT:
+ .ascii " SYSCALL (PREEMPTED)\0"
+
+ /*
+ * Trap decoding for stack unwinder
+ * Tuples are (start addr, end addr, string)
+ * If return address lies on [start addr, end addr],
+ * unwinder displays 'string'
+ */
+
+ .align 4
+.global microblaze_trap_handlers
+microblaze_trap_handlers:
+ /* Exact matches come first */
+ .word ret_to_user ; .word ret_to_user ; .word type_SYSCALL
+ .word ret_from_intr; .word ret_from_intr ; .word type_IRQ
+ /* Fuzzy matches go here */
+ .word ret_from_intr; .word no_intr_resched; .word type_IRQ_PREEMPT
+ .word work_pending ; .word no_work_pending; .word type_SYSCALL_PREEMPT
+ /* End of table */
+ .word 0 ; .word 0 ; .word 0