This commit was manufactured by cvs2svn to create tag
[linux-2.6.git] / arch / i386 / kernel / process.c
index 7742df9..6c00d69 100644 (file)
@@ -28,7 +28,7 @@
 #include <linux/a.out.h>
 #include <linux/interrupt.h>
 #include <linux/config.h>
-#include <linux/utsname.h>
+#include <linux/version.h>
 #include <linux/delay.h>
 #include <linux/reboot.h>
 #include <linux/init.h>
@@ -59,9 +59,6 @@ asmlinkage void ret_from_fork(void) __asm__("ret_from_fork");
 
 int hlt_counter;
 
-unsigned long boot_option_idle_override = 0;
-EXPORT_SYMBOL(boot_option_idle_override);
-
 /*
  * Return saved PC of a blocked thread.
  */
@@ -101,8 +98,6 @@ void default_idle(void)
                        safe_halt();
                else
                        local_irq_enable();
-       } else {
-               cpu_relax();
        }
 }
 
@@ -221,12 +216,36 @@ static int __init idle_setup (char *str)
                pm_idle = default_idle;
        }
 
-       boot_option_idle_override = 1;
        return 1;
 }
 
 __setup("idle=", idle_setup);
 
+void stack_overflow(void)
+{
+        unsigned long esp = current_stack_pointer();
+       int panicing = ((esp&(THREAD_SIZE-1)) <= STACK_PANIC);
+
+       oops_in_progress = 1;
+       printk( "esp: 0x%lx masked: 0x%lx STACK_PANIC:0x%lx %d %d\n",
+               esp, (esp&(THREAD_SIZE-1)), STACK_PANIC, 
+               (((esp&(THREAD_SIZE-1)) <= STACK_PANIC)), panicing);
+       show_trace(current,(void*)esp);
+
+       if (panicing)
+         panic("stack overflow\n");
+
+       oops_in_progress = 0;
+
+       /* Just let it happen once per task, as otherwise it goes nuts
+        * in printing stack traces.  This means that I need to dump
+        * the stack_overflowed boolean into the task or thread_info
+        * structure.  For now just turn it off all together.
+        */
+
+       /* stack_overflowed = 0; */
+}
+
 void show_regs(struct pt_regs * regs)
 {
        unsigned long cr0 = 0L, cr2 = 0L, cr3 = 0L, cr4 = 0L;
@@ -238,8 +257,7 @@ void show_regs(struct pt_regs * regs)
 
        if (regs->xcs & 3)
                printk(" ESP: %04x:%08lx",0xffff & regs->xss,regs->esp);
-       printk(" EFLAGS: %08lx    %s  (%s)\n",
-              regs->eflags, print_tainted(), system_utsname.release);
+       printk(" EFLAGS: %08lx    %s  (%s)\n",regs->eflags, print_tainted(),UTS_RELEASE);
        printk("EAX: %08lx EBX: %08lx ECX: %08lx EDX: %08lx\n",
                regs->eax,regs->ebx,regs->ecx,regs->edx);
        printk("ESI: %08lx EDI: %08lx EBP: %08lx",
@@ -261,8 +279,6 @@ void show_regs(struct pt_regs * regs)
        show_trace(NULL, &regs->esp);
 }
 
-EXPORT_SYMBOL_GPL(show_regs);
-
 /*
  * This gets run with %ebx containing the
  * function to call, and %edx containing
@@ -355,7 +371,7 @@ void release_thread(struct task_struct *dead_task)
                }
        }
 
-       release_vm86_irqs(dead_task);
+       release_x86_irqs(dead_task);
 }
 
 /*
@@ -379,6 +395,7 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long esp,
        *childregs = *regs;
        childregs->eax = 0;
        childregs->esp = esp;
+       p->set_child_tid = p->clear_child_tid = NULL;
 
        p->thread.esp = (unsigned long) childregs;
        p->thread.esp0 = (unsigned long) (childregs+1);
@@ -668,9 +685,7 @@ asmlinkage int sys_execve(struct pt_regs regs)
                        (char __user * __user *) regs.edx,
                        &regs);
        if (error == 0) {
-               task_lock(current);
                current->ptrace &= ~PT_DTRACE;
-               task_unlock(current);
                /* Make sure we don't return using sysenter.. */
                set_thread_flag(TIF_IRET);
        }