13 #include <linux/errno.h>
14 #include <linux/sched.h>
16 #include <linux/kernel.h>
18 #include <linux/elfcore.h>
20 #include <linux/stddef.h>
21 #include <linux/slab.h>
26 #include <linux/reboot.h>
29 #include <linux/module.h>
31 #include <linux/ptrace.h>
32 #include <linux/personality.h>
40 #include <asm/pgtable.h>
42 #include <asm/processor.h>
46 #ifdef CONFIG_MATH_EMULATION
52 #include <asm/tlbflush.h>
55 #include <asm/syscalls.h>
57 #include <asm/switch_to.h>
67 return ((
unsigned long *)tsk->thread.sp)[3];
73 unsigned long d0,
d1,
d2, d3, d6, d7;
75 unsigned short ss,
gs;
77 if (user_mode_vm(regs)) {
79 ss = regs->
ss & 0xffff;
80 gs = get_user_gs(regs);
92 print_symbol(
"EIP is at %s\n", regs->ip);
95 regs->ax, regs->bx, regs->cx, regs->dx);
97 regs->si, regs->di, regs->bp, sp);
99 (
u16)regs->ds, (
u16)regs->es, (
u16)regs->fs, gs, ss);
107 cr4 = read_cr4_safe();
139 p->
thread.sp0 = (
unsigned long) (childregs+1);
145 task_user_gs(p) = __KERNEL_STACK_CANARY;
148 childregs->fs = __KERNEL_PERCPU;
151 childregs->orig_ax = -1;
164 task_user_gs(p) = get_user_gs(regs);
176 if (!p->
thread.io_bitmap_ptr) {
177 p->
thread.io_bitmap_max = 0;
192 if (err && p->
thread.io_bitmap_ptr) {
194 p->
thread.io_bitmap_max = 0;
202 set_user_gs(regs, 0);
258 fpu = switch_fpu_prepare(prev_p, next_p, cpu);
275 lazy_save_gs(prev->
gs);
311 lazy_load_gs(
next->gs);
313 switch_fpu_finish(next_p, fpu);
320 #define top_esp (THREAD_SIZE - sizeof(unsigned long))
321 #define top_ebp (THREAD_SIZE - 2*sizeof(unsigned long))
325 unsigned long bp,
sp,
ip;
326 unsigned long stack_page;
332 if (!stack_page || sp < stack_page || sp >
top_esp+stack_page)
335 bp = *(
unsigned long *) sp;
337 if (bp < stack_page || bp >
top_ebp+stack_page)
339 ip = *(
unsigned long *) (bp+4);
342 bp = *(
unsigned long *) bp;
343 }
while (count++ < 16);