15 #include <linux/module.h>
16 #include <linux/signal.h>
18 #include <linux/personality.h>
28 #include <asm/cacheflush.h>
29 #include <asm/traps.h>
33 static void dump_mem(
const char *,
const char *,
unsigned long,
unsigned long);
38 #ifdef CONFIG_KALLSYMS
40 where, (
void *)where, from, (
void *)from);
52 static int verify_stack(
unsigned long sp)
55 (sp > (
unsigned long)high_memory && high_memory !=
NULL))
80 lvl, str, bottom, top);
82 for (first = bottom & ~31; first <
top; first += 32) {
84 char str[
sizeof(
" 12345678") * 8 + 1];
86 memset(str,
' ',
sizeof(str));
87 str[
sizeof(
str) - 1] =
'\0';
89 for (p = first, i = 0; i < 8 && p <
top; i++, p += 4) {
90 if (p >= bottom && p < top) {
93 sprintf(str + i * 9,
" %08lx", val);
95 sprintf(str + i * 9,
" ????????");
104 static void dump_instr(
const char *lvl,
struct pt_regs *
regs)
109 char str[
sizeof(
"00000000 ") * 5 + 2 + 1], *p = str;
120 for (i = -4; i < 1; i++) {
126 p +=
sprintf(p, i == 0 ?
"(%0*x) " :
"%0*x ",
129 p +=
sprintf(p,
"bad PC value");
152 fp = thread_saved_fp(tsk);
155 asm(
"mov %0, fp" :
"=r" (
fp) : :
"cc");
160 printk(
"no frame pointer");
162 }
else if (verify_stack(fp)) {
163 printk(
"invalid frame pointer 0x%08x", fp);
166 printk(
"frame pointer underflow");
181 dump_backtrace(
NULL, tsk);
189 static int die_counter;
193 str, err, ++die_counter);
198 if (ret == NOTIFY_STOP)
209 dump_backtrace(regs, tsk);
231 ret =
__die(str, err, thread, regs);
239 panic(
"Fatal exception in interrupt");
241 panic(
"Fatal exception");
242 if (ret != NOTIFY_STOP)
270 die(
"Oops - bad mode", regs, 0);
302 panic(
"Oops failed to kill thread");
323 memcpy((
void *)vectors + 0x200,