18 #include <linux/errno.h>
19 #include <linux/sched.h>
21 #include <linux/kernel.h>
23 #include <linux/elfcore.h>
25 #include <linux/slab.h>
29 #include <linux/module.h>
30 #include <linux/ptrace.h>
39 #include <asm/pgtable.h>
40 #include <asm/processor.h>
43 #include <asm/mmu_context.h>
49 #include <asm/syscalls.h>
51 #include <asm/switch_to.h>
61 unsigned long d0,
d1,
d2, d3, d6, d7;
62 unsigned int fsindex, gsindex;
71 regs->ax, regs->bx, regs->cx);
73 regs->dx, regs->si, regs->di);
75 regs->bp, regs->
r8, regs->
r9);
81 asm(
"movl %%ds,%0" :
"=r" (
ds));
82 asm(
"movl %%cs,%0" :
"=r" (
cs));
83 asm(
"movl %%es,%0" :
"=r" (
es));
84 asm(
"movl %%fs,%0" :
"=r" (fsindex));
85 asm(
"movl %%gs,%0" :
"=r" (gsindex));
100 fs, fsindex, gs, gsindex, shadowgs);
119 if (dead_task->
mm->context.size) {
120 pr_warn(
"WARNING: dead process %8s still has LDT? <%p/%d>\n",
122 dead_task->
mm->context.ldt,
123 dead_task->
mm->context.size);
145 return get_desc_base(&t->
thread.tls_array[tls]);
175 childregs->
sp = (
unsigned long)childregs;
179 childregs->orig_ax = -1;
195 if (!p->
thread.io_bitmap_ptr) {
196 p->
thread.io_bitmap_max = 0;
206 #ifdef CONFIG_IA32_EMULATION
218 if (err && p->
thread.io_bitmap_ptr) {
220 p->
thread.io_bitmap_max = 0;
227 start_thread_common(
struct pt_regs *
regs,
unsigned long new_ip,
228 unsigned long new_sp,
229 unsigned int _cs,
unsigned int _ss,
unsigned int _ds)
232 loadsegment(
es, _ds);
233 loadsegment(
ds, _ds);
235 current->thread.usersp = new_sp;
247 start_thread_common(regs, new_ip, new_sp,
251 #ifdef CONFIG_IA32_EMULATION
254 start_thread_common(regs, new_ip, new_sp,
278 unsigned fsindex, gsindex;
281 fpu = switch_fpu_prepare(prev_p, next_p, cpu);
292 savesegment(
es, prev->
es);
294 loadsegment(
es, next->
es);
296 savesegment(
ds, prev->
ds);
298 loadsegment(
ds, next->
ds);
306 savesegment(
fs, fsindex);
307 savesegment(
gs, gsindex);
351 switch_fpu_finish(next_p, fpu);
385 current->mm->context.ia32_compat = 0;
403 current->mm->context.ia32_compat = 1;
435 if (fp < (
unsigned long)stack ||
442 }
while (count++ < 16);
459 if (addr <= 0xffffffff) {
460 set_32bit_tls(task,
GS_TLS, addr);
485 if (addr <= 0xffffffff) {
486 set_32bit_tls(task,
FS_TLS, addr);
508 base = read_32bit_tls(task,
FS_TLS);
520 base = read_32bit_tls(task,
GS_TLS);
522 savesegment(
gs, gsindex);
548 return (test_tsk_thread_flag(task,
TIF_IA32)) ?