aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/kernel/process.c
diff options
context:
space:
mode:
authorRussell King <rmk@dyn-67.arm.linux.org.uk>2007-06-18 09:59:45 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2007-06-18 10:04:42 -0400
commit154c772ebfb12ef66855510e6be2b12c85110b0c (patch)
tree9ece82abedf5f566572ba50ec7dd5294e5653389 /arch/arm/kernel/process.c
parentd9202429e60d16d39c427cd4e4408cf1827ab9e9 (diff)
[ARM] Update show_regs/oops register format
Add the kernel release and version information to the output of show_regs/oops. Add the CPU PSR register. Avoid using printk to output partial lines; always output a complete line. Re-combine the "Control" and "Table + DAC" lines after nommu separated them; we don't want to waste vertical screen space needlessly. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/kernel/process.c')
-rw-r--r--arch/arm/kernel/process.c63
1 files changed, 35 insertions, 28 deletions
diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c
index 5d6e6523598..842361777d4 100644
--- a/arch/arm/kernel/process.c
+++ b/arch/arm/kernel/process.c
@@ -28,6 +28,7 @@
28#include <linux/elfcore.h> 28#include <linux/elfcore.h>
29#include <linux/pm.h> 29#include <linux/pm.h>
30#include <linux/tick.h> 30#include <linux/tick.h>
31#include <linux/utsname.h>
31 32
32#include <asm/leds.h> 33#include <asm/leds.h>
33#include <asm/processor.h> 34#include <asm/processor.h>
@@ -199,16 +200,19 @@ void machine_restart(char * __unused)
199 200
200void __show_regs(struct pt_regs *regs) 201void __show_regs(struct pt_regs *regs)
201{ 202{
202 unsigned long flags = condition_codes(regs); 203 unsigned long flags;
204 char buf[64];
203 205
204 printk("CPU: %d\n", smp_processor_id()); 206 printk("CPU: %d %s (%s %.*s)\n",
207 smp_processor_id(), print_tainted(), init_utsname()->release,
208 (int)strcspn(init_utsname()->version, " "),
209 init_utsname()->version);
205 print_symbol("PC is at %s\n", instruction_pointer(regs)); 210 print_symbol("PC is at %s\n", instruction_pointer(regs));
206 print_symbol("LR is at %s\n", regs->ARM_lr); 211 print_symbol("LR is at %s\n", regs->ARM_lr);
207 printk("pc : [<%08lx>] lr : [<%08lx>] %s\n" 212 printk("pc : [<%08lx>] lr : [<%08lx>] psr: %08lx\n"
208 "sp : %08lx ip : %08lx fp : %08lx\n", 213 "sp : %08lx ip : %08lx fp : %08lx\n",
209 instruction_pointer(regs), 214 regs->ARM_pc, regs->ARM_lr, regs->ARM_cpsr,
210 regs->ARM_lr, print_tainted(), regs->ARM_sp, 215 regs->ARM_sp, regs->ARM_ip, regs->ARM_fp);
211 regs->ARM_ip, regs->ARM_fp);
212 printk("r10: %08lx r9 : %08lx r8 : %08lx\n", 216 printk("r10: %08lx r9 : %08lx r8 : %08lx\n",
213 regs->ARM_r10, regs->ARM_r9, 217 regs->ARM_r10, regs->ARM_r9,
214 regs->ARM_r8); 218 regs->ARM_r8);
@@ -218,36 +222,39 @@ void __show_regs(struct pt_regs *regs)
218 printk("r3 : %08lx r2 : %08lx r1 : %08lx r0 : %08lx\n", 222 printk("r3 : %08lx r2 : %08lx r1 : %08lx r0 : %08lx\n",
219 regs->ARM_r3, regs->ARM_r2, 223 regs->ARM_r3, regs->ARM_r2,
220 regs->ARM_r1, regs->ARM_r0); 224 regs->ARM_r1, regs->ARM_r0);
221 printk("Flags: %c%c%c%c", 225
222 flags & PSR_N_BIT ? 'N' : 'n', 226 flags = regs->ARM_cpsr;
223 flags & PSR_Z_BIT ? 'Z' : 'z', 227 buf[0] = flags & PSR_N_BIT ? 'N' : 'n';
224 flags & PSR_C_BIT ? 'C' : 'c', 228 buf[1] = flags & PSR_Z_BIT ? 'Z' : 'z';
225 flags & PSR_V_BIT ? 'V' : 'v'); 229 buf[2] = flags & PSR_C_BIT ? 'C' : 'c';
226 printk(" IRQs o%s FIQs o%s Mode %s%s Segment %s\n", 230 buf[3] = flags & PSR_V_BIT ? 'V' : 'v';
227 interrupts_enabled(regs) ? "n" : "ff", 231 buf[4] = '\0';
232
233 printk("Flags: %s IRQs o%s FIQs o%s Mode %s%s Segment %s\n",
234 buf, interrupts_enabled(regs) ? "n" : "ff",
228 fast_interrupts_enabled(regs) ? "n" : "ff", 235 fast_interrupts_enabled(regs) ? "n" : "ff",
229 processor_modes[processor_mode(regs)], 236 processor_modes[processor_mode(regs)],
230 thumb_mode(regs) ? " (T)" : "", 237 thumb_mode(regs) ? " (T)" : "",
231 get_fs() == get_ds() ? "kernel" : "user"); 238 get_fs() == get_ds() ? "kernel" : "user");
232#if CONFIG_CPU_CP15 239#ifdef CONFIG_CPU_CP15
233 { 240 {
234 unsigned int ctrl; 241 unsigned int ctrl;
235 __asm__ ( 242
236 " mrc p15, 0, %0, c1, c0\n" 243 buf[0] = '\0';
237 : "=r" (ctrl));
238 printk("Control: %04X\n", ctrl);
239 }
240#ifdef CONFIG_CPU_CP15_MMU 244#ifdef CONFIG_CPU_CP15_MMU
241 { 245 {
242 unsigned int transbase, dac; 246 unsigned int transbase, dac;
243 __asm__ ( 247 asm("mrc p15, 0, %0, c2, c0\n\t"
244 " mrc p15, 0, %0, c2, c0\n" 248 "mrc p15, 0, %1, c3, c0\n"
245 " mrc p15, 0, %1, c3, c0\n" 249 : "=r" (transbase), "=r" (dac));
246 : "=r" (transbase), "=r" (dac)); 250 snprintf(buf, sizeof(buf), " Table: %08x DAC: %08x",
247 printk("Table: %08X DAC: %08X\n", 251 transbase, dac);
248 transbase, dac); 252 }
249 }
250#endif 253#endif
254 asm("mrc p15, 0, %0, c1, c0\n" : "=r" (ctrl));
255
256 printk("Control: %08x%s\n", ctrl, buf);
257 }
251#endif 258#endif
252} 259}
253 260