2 * linux/arch/i386/kernel/stackoverflow.c
4 * Copyright (C) 2005 Marc E. Fiuczynski
9 * This file handles the architecture-dependent parts of stack overflow handling...
12 #include <linux/kernel.h>
13 #include <linux/thread_info.h>
14 #include <linux/sched.h>
15 #include <asm/processor.h>
17 void stack_overflow(void)
19 unsigned long esp = current_stack_pointer();
20 int panicing = ((esp&(THREAD_SIZE-1)) <= STACK_PANIC);
23 printk( "esp: 0x%lx masked: 0x%lx STACK_PANIC:0x%lx %d %d\n",
24 esp, (esp&(THREAD_SIZE-1)), STACK_PANIC,
25 (((esp&(THREAD_SIZE-1)) <= STACK_PANIC)), panicing);
26 show_trace(current,(void*)esp);
29 panic("stack overflow\n");
33 /* Just let it happen once per task, as otherwise it goes nuts
34 * in printing stack traces. This means that I need to dump
35 * the stack_overflowed boolean into the task or thread_info
36 * structure. For now just turn it off all together.
39 /* stack_overflowed = 0; */