aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRussell King <rmk@dyn-67.arm.linux.org.uk>2005-04-17 10:50:36 -0400
committerRussell King <rmk@dyn-67.arm.linux.org.uk>2005-04-17 10:50:36 -0400
commit652a12ef98d16ccd1ee5cdf2c832ce5411ed3262 (patch)
treefb4202396bed56574c68f5b516eeb85846e88c6a
parent58c02ec4701c94c671a41e1e5d50c582e859851f (diff)
[PATCH] ARM: showregs
Fix show_regs() to provide a backtrace. Provide a new __show_regs() function which implements the common subset of show_regs() and die(). Add prototypes to asm-arm/system.h Signed-off-by: Russell King <rmk@arm.linux.org.uk>
-rw-r--r--arch/arm/kernel/process.c15
-rw-r--r--arch/arm/kernel/traps.c8
-rw-r--r--include/asm-arm/ptrace.h5
-rw-r--r--include/asm-arm/system.h3
4 files changed, 17 insertions, 14 deletions
diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c
index dbd8ca89b385..26eacd3e5def 100644
--- a/arch/arm/kernel/process.c
+++ b/arch/arm/kernel/process.c
@@ -168,12 +168,11 @@ void machine_restart(char * __unused)
168 168
169EXPORT_SYMBOL(machine_restart); 169EXPORT_SYMBOL(machine_restart);
170 170
171void show_regs(struct pt_regs * regs) 171void __show_regs(struct pt_regs *regs)
172{ 172{
173 unsigned long flags; 173 unsigned long flags = condition_codes(regs);
174
175 flags = condition_codes(regs);
176 174
175 printk("CPU: %d\n", smp_processor_id());
177 print_symbol("PC is at %s\n", instruction_pointer(regs)); 176 print_symbol("PC is at %s\n", instruction_pointer(regs));
178 print_symbol("LR is at %s\n", regs->ARM_lr); 177 print_symbol("LR is at %s\n", regs->ARM_lr);
179 printk("pc : [<%08lx>] lr : [<%08lx>] %s\n" 178 printk("pc : [<%08lx>] lr : [<%08lx>] %s\n"
@@ -213,6 +212,14 @@ void show_regs(struct pt_regs * regs)
213 } 212 }
214} 213}
215 214
215void show_regs(struct pt_regs * regs)
216{
217 printk("\n");
218 printk("Pid: %d, comm: %20s\n", current->pid, current->comm);
219 __show_regs(regs);
220 __backtrace();
221}
222
216void show_fpregs(struct user_fp *regs) 223void show_fpregs(struct user_fp *regs)
217{ 224{
218 int i; 225 int i;
diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c
index 93dc4646cd7f..6e31718f6008 100644
--- a/arch/arm/kernel/traps.c
+++ b/arch/arm/kernel/traps.c
@@ -31,9 +31,6 @@
31 31
32#include "ptrace.h" 32#include "ptrace.h"
33 33
34extern void c_backtrace (unsigned long fp, int pmode);
35extern void show_pte(struct mm_struct *mm, unsigned long addr);
36
37const char *processor_modes[]= 34const char *processor_modes[]=
38{ "USER_26", "FIQ_26" , "IRQ_26" , "SVC_26" , "UK4_26" , "UK5_26" , "UK6_26" , "UK7_26" , 35{ "USER_26", "FIQ_26" , "IRQ_26" , "SVC_26" , "UK4_26" , "UK5_26" , "UK6_26" , "UK7_26" ,
39 "UK8_26" , "UK9_26" , "UK10_26", "UK11_26", "UK12_26", "UK13_26", "UK14_26", "UK15_26", 36 "UK8_26" , "UK9_26" , "UK10_26", "UK11_26", "UK12_26", "UK13_26", "UK14_26", "UK15_26",
@@ -216,8 +213,7 @@ NORET_TYPE void die(const char *str, struct pt_regs *regs, int err)
216 213
217 printk("Internal error: %s: %x [#%d]\n", str, err, ++die_counter); 214 printk("Internal error: %s: %x [#%d]\n", str, err, ++die_counter);
218 print_modules(); 215 print_modules();
219 printk("CPU: %d\n", smp_processor_id()); 216 __show_regs(regs);
220 show_regs(regs);
221 printk("Process %s (pid: %d, stack limit = 0x%p)\n", 217 printk("Process %s (pid: %d, stack limit = 0x%p)\n",
222 tsk->comm, tsk->pid, tsk->thread_info + 1); 218 tsk->comm, tsk->pid, tsk->thread_info + 1);
223 219
@@ -482,7 +478,7 @@ asmlinkage int arm_syscall(int no, struct pt_regs *regs)
482 current->pid, current->comm, no); 478 current->pid, current->comm, no);
483 dump_instr(regs); 479 dump_instr(regs);
484 if (user_mode(regs)) { 480 if (user_mode(regs)) {
485 show_regs(regs); 481 __show_regs(regs);
486 c_backtrace(regs->ARM_fp, processor_mode(regs)); 482 c_backtrace(regs->ARM_fp, processor_mode(regs));
487 } 483 }
488 } 484 }
diff --git a/include/asm-arm/ptrace.h b/include/asm-arm/ptrace.h
index 604e3a186cf9..4377e22b7e1a 100644
--- a/include/asm-arm/ptrace.h
+++ b/include/asm-arm/ptrace.h
@@ -142,11 +142,8 @@ extern unsigned long profile_pc(struct pt_regs *regs);
142#endif 142#endif
143 143
144#ifdef __KERNEL__ 144#ifdef __KERNEL__
145extern void show_regs(struct pt_regs *); 145#define predicate(x) ((x) & 0xf0000000)
146
147#define predicate(x) (x & 0xf0000000)
148#define PREDICATE_ALWAYS 0xe0000000 146#define PREDICATE_ALWAYS 0xe0000000
149
150#endif 147#endif
151 148
152#endif /* __ASSEMBLY__ */ 149#endif /* __ASSEMBLY__ */
diff --git a/include/asm-arm/system.h b/include/asm-arm/system.h
index b5731290b4e5..b13a8da4847b 100644
--- a/include/asm-arm/system.h
+++ b/include/asm-arm/system.h
@@ -99,6 +99,9 @@ void hook_fault_code(int nr, int (*fn)(unsigned long, unsigned int,
99#define tas(ptr) (xchg((ptr),1)) 99#define tas(ptr) (xchg((ptr),1))
100 100
101extern asmlinkage void __backtrace(void); 101extern asmlinkage void __backtrace(void);
102extern asmlinkage void c_backtrace(unsigned long fp, int pmode);
103extern void show_pte(struct mm_struct *mm, unsigned long addr);
104extern void __show_regs(struct pt_regs *);
102 105
103extern int cpu_architecture(void); 106extern int cpu_architecture(void);
104 107