aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorRussell King <rmk@dyn-67.arm.linux.org.uk>2007-06-17 08:38:27 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2007-06-17 08:40:39 -0400
commitd9202429e60d16d39c427cd4e4408cf1827ab9e9 (patch)
tree2b080c06880cca1881b506b9436b01129b768724 /arch/arm
parent188e1f81ba31af1b65a2f3611df4c670b092bbac (diff)
[ARM] Add support for pause_on_oops and display preempt/smp options
Add calls to oops_enter() and oops_exit() to __die(), so that things like lockdep know when an oops occurs. Add suffixes to the oops report to indicate whether the running kernel has been built with preempt or smp support. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/kernel/traps.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c
index 10ff36e4e414..1b68d365d0e1 100644
--- a/arch/arm/kernel/traps.c
+++ b/arch/arm/kernel/traps.c
@@ -204,12 +204,24 @@ void show_stack(struct task_struct *tsk, unsigned long *sp)
204 barrier(); 204 barrier();
205} 205}
206 206
207#ifdef CONFIG_PREEMPT
208#define S_PREEMPT " PREEMPT"
209#else
210#define S_PREEMPT ""
211#endif
212#ifdef CONFIG_SMP
213#define S_SMP " SMP"
214#else
215#define S_SMP ""
216#endif
217
207static void __die(const char *str, int err, struct thread_info *thread, struct pt_regs *regs) 218static void __die(const char *str, int err, struct thread_info *thread, struct pt_regs *regs)
208{ 219{
209 struct task_struct *tsk = thread->task; 220 struct task_struct *tsk = thread->task;
210 static int die_counter; 221 static int die_counter;
211 222
212 printk("Internal error: %s: %x [#%d]\n", str, err, ++die_counter); 223 printk("Internal error: %s: %x [#%d]" S_PREEMPT S_SMP "\n",
224 str, err, ++die_counter);
213 print_modules(); 225 print_modules();
214 __show_regs(regs); 226 __show_regs(regs);
215 printk("Process %s (pid: %d, stack limit = 0x%p)\n", 227 printk("Process %s (pid: %d, stack limit = 0x%p)\n",
@@ -232,6 +244,8 @@ NORET_TYPE void die(const char *str, struct pt_regs *regs, int err)
232{ 244{
233 struct thread_info *thread = current_thread_info(); 245 struct thread_info *thread = current_thread_info();
234 246
247 oops_enter();
248
235 console_verbose(); 249 console_verbose();
236 spin_lock_irq(&die_lock); 250 spin_lock_irq(&die_lock);
237 bust_spinlocks(1); 251 bust_spinlocks(1);
@@ -239,9 +253,13 @@ NORET_TYPE void die(const char *str, struct pt_regs *regs, int err)
239 bust_spinlocks(0); 253 bust_spinlocks(0);
240 spin_unlock_irq(&die_lock); 254 spin_unlock_irq(&die_lock);
241 255
256 if (in_interrupt())
257 panic("Fatal exception in interrupt");
258
242 if (panic_on_oops) 259 if (panic_on_oops)
243 panic("Fatal exception"); 260 panic("Fatal exception");
244 261
262 oops_exit();
245 do_exit(SIGSEGV); 263 do_exit(SIGSEGV);
246} 264}
247 265