aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/ia32
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/ia32')
-rw-r--r--arch/x86/ia32/ia32_aout.c30
-rw-r--r--arch/x86/ia32/ia32_binfmt.c42
-rw-r--r--arch/x86/ia32/ia32_signal.c100
-rw-r--r--arch/x86/ia32/ptrace32.c44
-rw-r--r--arch/x86/ia32/sys_ia32.c6
5 files changed, 111 insertions, 111 deletions
diff --git a/arch/x86/ia32/ia32_aout.c b/arch/x86/ia32/ia32_aout.c
index a764e4e95314..f1a0f83676dc 100644
--- a/arch/x86/ia32/ia32_aout.c
+++ b/arch/x86/ia32/ia32_aout.c
@@ -53,7 +53,7 @@ static void dump_thread32(struct pt_regs *regs, struct user32 *dump)
53/* changed the size calculations - should hopefully work better. lbt */ 53/* changed the size calculations - should hopefully work better. lbt */
54 dump->magic = CMAGIC; 54 dump->magic = CMAGIC;
55 dump->start_code = 0; 55 dump->start_code = 0;
56 dump->start_stack = regs->rsp & ~(PAGE_SIZE - 1); 56 dump->start_stack = regs->sp & ~(PAGE_SIZE - 1);
57 dump->u_tsize = ((unsigned long) current->mm->end_code) >> PAGE_SHIFT; 57 dump->u_tsize = ((unsigned long) current->mm->end_code) >> PAGE_SHIFT;
58 dump->u_dsize = ((unsigned long) 58 dump->u_dsize = ((unsigned long)
59 (current->mm->brk + (PAGE_SIZE-1))) >> PAGE_SHIFT; 59 (current->mm->brk + (PAGE_SIZE-1))) >> PAGE_SHIFT;
@@ -75,22 +75,22 @@ static void dump_thread32(struct pt_regs *regs, struct user32 *dump)
75 dump->u_ssize = tmp >> PAGE_SHIFT; 75 dump->u_ssize = tmp >> PAGE_SHIFT;
76 } 76 }
77 77
78 dump->regs.ebx = regs->rbx; 78 dump->regs.bx = regs->bx;
79 dump->regs.ecx = regs->rcx; 79 dump->regs.cx = regs->cx;
80 dump->regs.edx = regs->rdx; 80 dump->regs.dx = regs->dx;
81 dump->regs.esi = regs->rsi; 81 dump->regs.si = regs->si;
82 dump->regs.edi = regs->rdi; 82 dump->regs.di = regs->di;
83 dump->regs.ebp = regs->rbp; 83 dump->regs.bp = regs->bp;
84 dump->regs.eax = regs->rax; 84 dump->regs.ax = regs->ax;
85 dump->regs.ds = current->thread.ds; 85 dump->regs.ds = current->thread.ds;
86 dump->regs.es = current->thread.es; 86 dump->regs.es = current->thread.es;
87 asm("movl %%fs,%0" : "=r" (fs)); dump->regs.fs = fs; 87 asm("movl %%fs,%0" : "=r" (fs)); dump->regs.fs = fs;
88 asm("movl %%gs,%0" : "=r" (gs)); dump->regs.gs = gs; 88 asm("movl %%gs,%0" : "=r" (gs)); dump->regs.gs = gs;
89 dump->regs.orig_eax = regs->orig_rax; 89 dump->regs.orig_ax = regs->orig_ax;
90 dump->regs.eip = regs->rip; 90 dump->regs.ip = regs->ip;
91 dump->regs.cs = regs->cs; 91 dump->regs.cs = regs->cs;
92 dump->regs.eflags = regs->eflags; 92 dump->regs.flags = regs->flags;
93 dump->regs.esp = regs->rsp; 93 dump->regs.sp = regs->sp;
94 dump->regs.ss = regs->ss; 94 dump->regs.ss = regs->ss;
95 95
96#if 1 /* FIXME */ 96#if 1 /* FIXME */
@@ -432,9 +432,9 @@ beyond_if:
432 asm volatile("movl %0,%%fs" :: "r" (0)); \ 432 asm volatile("movl %0,%%fs" :: "r" (0)); \
433 asm volatile("movl %0,%%es; movl %0,%%ds": :"r" (__USER32_DS)); 433 asm volatile("movl %0,%%es; movl %0,%%ds": :"r" (__USER32_DS));
434 load_gs_index(0); 434 load_gs_index(0);
435 (regs)->rip = ex.a_entry; 435 (regs)->ip = ex.a_entry;
436 (regs)->rsp = current->mm->start_stack; 436 (regs)->sp = current->mm->start_stack;
437 (regs)->eflags = 0x200; 437 (regs)->flags = 0x200;
438 (regs)->cs = __USER32_CS; 438 (regs)->cs = __USER32_CS;
439 (regs)->ss = __USER32_DS; 439 (regs)->ss = __USER32_DS;
440 regs->r8 = regs->r9 = regs->r10 = regs->r11 = 440 regs->r8 = regs->r9 = regs->r10 = regs->r11 =
diff --git a/arch/x86/ia32/ia32_binfmt.c b/arch/x86/ia32/ia32_binfmt.c
index e32974c3dd3b..806135c3f975 100644
--- a/arch/x86/ia32/ia32_binfmt.c
+++ b/arch/x86/ia32/ia32_binfmt.c
@@ -73,22 +73,22 @@ struct file;
73/* Assumes current==process to be dumped */ 73/* Assumes current==process to be dumped */
74#undef ELF_CORE_COPY_REGS 74#undef ELF_CORE_COPY_REGS
75#define ELF_CORE_COPY_REGS(pr_reg, regs) \ 75#define ELF_CORE_COPY_REGS(pr_reg, regs) \
76 pr_reg[0] = regs->rbx; \ 76 pr_reg[0] = regs->bx; \
77 pr_reg[1] = regs->rcx; \ 77 pr_reg[1] = regs->cx; \
78 pr_reg[2] = regs->rdx; \ 78 pr_reg[2] = regs->dx; \
79 pr_reg[3] = regs->rsi; \ 79 pr_reg[3] = regs->si; \
80 pr_reg[4] = regs->rdi; \ 80 pr_reg[4] = regs->di; \
81 pr_reg[5] = regs->rbp; \ 81 pr_reg[5] = regs->bp; \
82 pr_reg[6] = regs->rax; \ 82 pr_reg[6] = regs->ax; \
83 pr_reg[7] = _GET_SEG(ds); \ 83 pr_reg[7] = _GET_SEG(ds); \
84 pr_reg[8] = _GET_SEG(es); \ 84 pr_reg[8] = _GET_SEG(es); \
85 pr_reg[9] = _GET_SEG(fs); \ 85 pr_reg[9] = _GET_SEG(fs); \
86 pr_reg[10] = _GET_SEG(gs); \ 86 pr_reg[10] = _GET_SEG(gs); \
87 pr_reg[11] = regs->orig_rax; \ 87 pr_reg[11] = regs->orig_ax; \
88 pr_reg[12] = regs->rip; \ 88 pr_reg[12] = regs->ip; \
89 pr_reg[13] = regs->cs; \ 89 pr_reg[13] = regs->cs; \
90 pr_reg[14] = regs->eflags; \ 90 pr_reg[14] = regs->flags; \
91 pr_reg[15] = regs->rsp; \ 91 pr_reg[15] = regs->sp; \
92 pr_reg[16] = regs->ss; 92 pr_reg[16] = regs->ss;
93 93
94 94
@@ -205,9 +205,9 @@ do { \
205 asm volatile("movl %0,%%fs" :: "r" (0)); \ 205 asm volatile("movl %0,%%fs" :: "r" (0)); \
206 asm volatile("movl %0,%%es; movl %0,%%ds": :"r" (__USER32_DS)); \ 206 asm volatile("movl %0,%%es; movl %0,%%ds": :"r" (__USER32_DS)); \
207 load_gs_index(0); \ 207 load_gs_index(0); \
208 (regs)->rip = (new_rip); \ 208 (regs)->ip = (new_rip); \
209 (regs)->rsp = (new_rsp); \ 209 (regs)->sp = (new_rsp); \
210 (regs)->eflags = 0x200; \ 210 (regs)->flags = X86_EFLAGS_IF; \
211 (regs)->cs = __USER32_CS; \ 211 (regs)->cs = __USER32_CS; \
212 (regs)->ss = __USER32_DS; \ 212 (regs)->ss = __USER32_DS; \
213 set_fs(USER_DS); \ 213 set_fs(USER_DS); \
@@ -233,13 +233,13 @@ extern int syscall32_setup_pages(struct linux_binprm *, int exstack);
233static void elf32_init(struct pt_regs *regs) 233static void elf32_init(struct pt_regs *regs)
234{ 234{
235 struct task_struct *me = current; 235 struct task_struct *me = current;
236 regs->rdi = 0; 236 regs->di = 0;
237 regs->rsi = 0; 237 regs->si = 0;
238 regs->rdx = 0; 238 regs->dx = 0;
239 regs->rcx = 0; 239 regs->cx = 0;
240 regs->rax = 0; 240 regs->ax = 0;
241 regs->rbx = 0; 241 regs->bx = 0;
242 regs->rbp = 0; 242 regs->bp = 0;
243 regs->r8 = regs->r9 = regs->r10 = regs->r11 = regs->r12 = 243 regs->r8 = regs->r9 = regs->r10 = regs->r11 = regs->r12 =
244 regs->r13 = regs->r14 = regs->r15 = 0; 244 regs->r13 = regs->r14 = regs->r15 = 0;
245 me->thread.fs = 0; 245 me->thread.fs = 0;
diff --git a/arch/x86/ia32/ia32_signal.c b/arch/x86/ia32/ia32_signal.c
index 39356a756b28..f2da443f8c7b 100644
--- a/arch/x86/ia32/ia32_signal.c
+++ b/arch/x86/ia32/ia32_signal.c
@@ -154,7 +154,7 @@ asmlinkage long sys32_sigaltstack(const stack_ia32_t __user *uss_ptr,
154 } 154 }
155 seg = get_fs(); 155 seg = get_fs();
156 set_fs(KERNEL_DS); 156 set_fs(KERNEL_DS);
157 ret = do_sigaltstack(uss_ptr ? &uss : NULL, &uoss, regs->rsp); 157 ret = do_sigaltstack(uss_ptr ? &uss : NULL, &uoss, regs->sp);
158 set_fs(seg); 158 set_fs(seg);
159 if (ret >= 0 && uoss_ptr) { 159 if (ret >= 0 && uoss_ptr) {
160 if (!access_ok(VERIFY_WRITE, uoss_ptr, sizeof(stack_ia32_t)) || 160 if (!access_ok(VERIFY_WRITE, uoss_ptr, sizeof(stack_ia32_t)) ||
@@ -195,7 +195,7 @@ struct rt_sigframe
195#define COPY(x) { \ 195#define COPY(x) { \
196 unsigned int reg; \ 196 unsigned int reg; \
197 err |= __get_user(reg, &sc->e ##x); \ 197 err |= __get_user(reg, &sc->e ##x); \
198 regs->r ## x = reg; \ 198 regs->x = reg; \
199} 199}
200 200
201#define RELOAD_SEG(seg,mask) \ 201#define RELOAD_SEG(seg,mask) \
@@ -220,7 +220,7 @@ static int ia32_restore_sigcontext(struct pt_regs *regs,
220#if DEBUG_SIG 220#if DEBUG_SIG
221 printk(KERN_DEBUG "SIG restore_sigcontext: " 221 printk(KERN_DEBUG "SIG restore_sigcontext: "
222 "sc=%p err(%x) eip(%x) cs(%x) flg(%x)\n", 222 "sc=%p err(%x) eip(%x) cs(%x) flg(%x)\n",
223 sc, sc->err, sc->eip, sc->cs, sc->eflags); 223 sc, sc->err, sc->ip, sc->cs, sc->flags);
224#endif 224#endif
225 225
226 /* 226 /*
@@ -249,9 +249,9 @@ static int ia32_restore_sigcontext(struct pt_regs *regs,
249 regs->ss |= 3; 249 regs->ss |= 3;
250 250
251 err |= __get_user(tmpflags, &sc->eflags); 251 err |= __get_user(tmpflags, &sc->eflags);
252 regs->eflags = (regs->eflags & ~0x40DD5) | (tmpflags & 0x40DD5); 252 regs->flags = (regs->flags & ~0x40DD5) | (tmpflags & 0x40DD5);
253 /* disable syscall checks */ 253 /* disable syscall checks */
254 regs->orig_rax = -1; 254 regs->orig_ax = -1;
255 255
256 err |= __get_user(tmp, &sc->fpstate); 256 err |= __get_user(tmp, &sc->fpstate);
257 buf = compat_ptr(tmp); 257 buf = compat_ptr(tmp);
@@ -279,9 +279,9 @@ badframe:
279 279
280asmlinkage long sys32_sigreturn(struct pt_regs *regs) 280asmlinkage long sys32_sigreturn(struct pt_regs *regs)
281{ 281{
282 struct sigframe __user *frame = (struct sigframe __user *)(regs->rsp-8); 282 struct sigframe __user *frame = (struct sigframe __user *)(regs->sp-8);
283 sigset_t set; 283 sigset_t set;
284 unsigned int eax; 284 unsigned int ax;
285 285
286 if (!access_ok(VERIFY_READ, frame, sizeof(*frame))) 286 if (!access_ok(VERIFY_READ, frame, sizeof(*frame)))
287 goto badframe; 287 goto badframe;
@@ -298,9 +298,9 @@ asmlinkage long sys32_sigreturn(struct pt_regs *regs)
298 recalc_sigpending(); 298 recalc_sigpending();
299 spin_unlock_irq(&current->sighand->siglock); 299 spin_unlock_irq(&current->sighand->siglock);
300 300
301 if (ia32_restore_sigcontext(regs, &frame->sc, &eax)) 301 if (ia32_restore_sigcontext(regs, &frame->sc, &ax))
302 goto badframe; 302 goto badframe;
303 return eax; 303 return ax;
304 304
305badframe: 305badframe:
306 signal_fault(regs, frame, "32bit sigreturn"); 306 signal_fault(regs, frame, "32bit sigreturn");
@@ -311,10 +311,10 @@ asmlinkage long sys32_rt_sigreturn(struct pt_regs *regs)
311{ 311{
312 struct rt_sigframe __user *frame; 312 struct rt_sigframe __user *frame;
313 sigset_t set; 313 sigset_t set;
314 unsigned int eax; 314 unsigned int ax;
315 struct pt_regs tregs; 315 struct pt_regs tregs;
316 316
317 frame = (struct rt_sigframe __user *)(regs->rsp - 4); 317 frame = (struct rt_sigframe __user *)(regs->sp - 4);
318 318
319 if (!access_ok(VERIFY_READ, frame, sizeof(*frame))) 319 if (!access_ok(VERIFY_READ, frame, sizeof(*frame)))
320 goto badframe; 320 goto badframe;
@@ -327,14 +327,14 @@ asmlinkage long sys32_rt_sigreturn(struct pt_regs *regs)
327 recalc_sigpending(); 327 recalc_sigpending();
328 spin_unlock_irq(&current->sighand->siglock); 328 spin_unlock_irq(&current->sighand->siglock);
329 329
330 if (ia32_restore_sigcontext(regs, &frame->uc.uc_mcontext, &eax)) 330 if (ia32_restore_sigcontext(regs, &frame->uc.uc_mcontext, &ax))
331 goto badframe; 331 goto badframe;
332 332
333 tregs = *regs; 333 tregs = *regs;
334 if (sys32_sigaltstack(&frame->uc.uc_stack, NULL, &tregs) == -EFAULT) 334 if (sys32_sigaltstack(&frame->uc.uc_stack, NULL, &tregs) == -EFAULT)
335 goto badframe; 335 goto badframe;
336 336
337 return eax; 337 return ax;
338 338
339badframe: 339badframe:
340 signal_fault(regs, frame, "32bit rt sigreturn"); 340 signal_fault(regs, frame, "32bit rt sigreturn");
@@ -361,21 +361,21 @@ static int ia32_setup_sigcontext(struct sigcontext_ia32 __user *sc,
361 __asm__("movl %%es,%0" : "=r"(tmp): "0"(tmp)); 361 __asm__("movl %%es,%0" : "=r"(tmp): "0"(tmp));
362 err |= __put_user(tmp, (unsigned int __user *)&sc->es); 362 err |= __put_user(tmp, (unsigned int __user *)&sc->es);
363 363
364 err |= __put_user((u32)regs->rdi, &sc->edi); 364 err |= __put_user((u32)regs->di, &sc->edi);
365 err |= __put_user((u32)regs->rsi, &sc->esi); 365 err |= __put_user((u32)regs->si, &sc->esi);
366 err |= __put_user((u32)regs->rbp, &sc->ebp); 366 err |= __put_user((u32)regs->bp, &sc->ebp);
367 err |= __put_user((u32)regs->rsp, &sc->esp); 367 err |= __put_user((u32)regs->sp, &sc->esp);
368 err |= __put_user((u32)regs->rbx, &sc->ebx); 368 err |= __put_user((u32)regs->bx, &sc->ebx);
369 err |= __put_user((u32)regs->rdx, &sc->edx); 369 err |= __put_user((u32)regs->dx, &sc->edx);
370 err |= __put_user((u32)regs->rcx, &sc->ecx); 370 err |= __put_user((u32)regs->cx, &sc->ecx);
371 err |= __put_user((u32)regs->rax, &sc->eax); 371 err |= __put_user((u32)regs->ax, &sc->eax);
372 err |= __put_user((u32)regs->cs, &sc->cs); 372 err |= __put_user((u32)regs->cs, &sc->cs);
373 err |= __put_user((u32)regs->ss, &sc->ss); 373 err |= __put_user((u32)regs->ss, &sc->ss);
374 err |= __put_user(current->thread.trap_no, &sc->trapno); 374 err |= __put_user(current->thread.trap_no, &sc->trapno);
375 err |= __put_user(current->thread.error_code, &sc->err); 375 err |= __put_user(current->thread.error_code, &sc->err);
376 err |= __put_user((u32)regs->rip, &sc->eip); 376 err |= __put_user((u32)regs->ip, &sc->eip);
377 err |= __put_user((u32)regs->eflags, &sc->eflags); 377 err |= __put_user((u32)regs->flags, &sc->eflags);
378 err |= __put_user((u32)regs->rsp, &sc->esp_at_signal); 378 err |= __put_user((u32)regs->sp, &sc->esp_at_signal);
379 379
380 tmp = save_i387_ia32(current, fpstate, regs, 0); 380 tmp = save_i387_ia32(current, fpstate, regs, 0);
381 if (tmp < 0) 381 if (tmp < 0)
@@ -400,28 +400,28 @@ static int ia32_setup_sigcontext(struct sigcontext_ia32 __user *sc,
400static void __user *get_sigframe(struct k_sigaction *ka, struct pt_regs *regs, 400static void __user *get_sigframe(struct k_sigaction *ka, struct pt_regs *regs,
401 size_t frame_size) 401 size_t frame_size)
402{ 402{
403 unsigned long rsp; 403 unsigned long sp;
404 404
405 /* Default to using normal stack */ 405 /* Default to using normal stack */
406 rsp = regs->rsp; 406 sp = regs->sp;
407 407
408 /* This is the X/Open sanctioned signal stack switching. */ 408 /* This is the X/Open sanctioned signal stack switching. */
409 if (ka->sa.sa_flags & SA_ONSTACK) { 409 if (ka->sa.sa_flags & SA_ONSTACK) {
410 if (sas_ss_flags(rsp) == 0) 410 if (sas_ss_flags(sp) == 0)
411 rsp = current->sas_ss_sp + current->sas_ss_size; 411 sp = current->sas_ss_sp + current->sas_ss_size;
412 } 412 }
413 413
414 /* This is the legacy signal stack switching. */ 414 /* This is the legacy signal stack switching. */
415 else if ((regs->ss & 0xffff) != __USER_DS && 415 else if ((regs->ss & 0xffff) != __USER_DS &&
416 !(ka->sa.sa_flags & SA_RESTORER) && 416 !(ka->sa.sa_flags & SA_RESTORER) &&
417 ka->sa.sa_restorer) 417 ka->sa.sa_restorer)
418 rsp = (unsigned long) ka->sa.sa_restorer; 418 sp = (unsigned long) ka->sa.sa_restorer;
419 419
420 rsp -= frame_size; 420 sp -= frame_size;
421 /* Align the stack pointer according to the i386 ABI, 421 /* Align the stack pointer according to the i386 ABI,
422 * i.e. so that on function entry ((sp + 4) & 15) == 0. */ 422 * i.e. so that on function entry ((sp + 4) & 15) == 0. */
423 rsp = ((rsp + 4) & -16ul) - 4; 423 sp = ((sp + 4) & -16ul) - 4;
424 return (void __user *) rsp; 424 return (void __user *) sp;
425} 425}
426 426
427int ia32_setup_frame(int sig, struct k_sigaction *ka, 427int ia32_setup_frame(int sig, struct k_sigaction *ka,
@@ -486,13 +486,13 @@ int ia32_setup_frame(int sig, struct k_sigaction *ka,
486 goto give_sigsegv; 486 goto give_sigsegv;
487 487
488 /* Set up registers for signal handler */ 488 /* Set up registers for signal handler */
489 regs->rsp = (unsigned long) frame; 489 regs->sp = (unsigned long) frame;
490 regs->rip = (unsigned long) ka->sa.sa_handler; 490 regs->ip = (unsigned long) ka->sa.sa_handler;
491 491
492 /* Make -mregparm=3 work */ 492 /* Make -mregparm=3 work */
493 regs->rax = sig; 493 regs->ax = sig;
494 regs->rdx = 0; 494 regs->dx = 0;
495 regs->rcx = 0; 495 regs->cx = 0;
496 496
497 asm volatile("movl %0,%%ds" :: "r" (__USER32_DS)); 497 asm volatile("movl %0,%%ds" :: "r" (__USER32_DS));
498 asm volatile("movl %0,%%es" :: "r" (__USER32_DS)); 498 asm volatile("movl %0,%%es" :: "r" (__USER32_DS));
@@ -501,13 +501,13 @@ int ia32_setup_frame(int sig, struct k_sigaction *ka,
501 regs->ss = __USER32_DS; 501 regs->ss = __USER32_DS;
502 502
503 set_fs(USER_DS); 503 set_fs(USER_DS);
504 regs->eflags &= ~TF_MASK; 504 regs->flags &= ~TF_MASK;
505 if (test_thread_flag(TIF_SINGLESTEP)) 505 if (test_thread_flag(TIF_SINGLESTEP))
506 ptrace_notify(SIGTRAP); 506 ptrace_notify(SIGTRAP);
507 507
508#if DEBUG_SIG 508#if DEBUG_SIG
509 printk(KERN_DEBUG "SIG deliver (%s:%d): sp=%p pc=%lx ra=%u\n", 509 printk(KERN_DEBUG "SIG deliver (%s:%d): sp=%p pc=%lx ra=%u\n",
510 current->comm, current->pid, frame, regs->rip, frame->pretcode); 510 current->comm, current->pid, frame, regs->ip, frame->pretcode);
511#endif 511#endif
512 512
513 return 0; 513 return 0;
@@ -556,7 +556,7 @@ int ia32_setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
556 err |= __put_user(0, &frame->uc.uc_flags); 556 err |= __put_user(0, &frame->uc.uc_flags);
557 err |= __put_user(0, &frame->uc.uc_link); 557 err |= __put_user(0, &frame->uc.uc_link);
558 err |= __put_user(current->sas_ss_sp, &frame->uc.uc_stack.ss_sp); 558 err |= __put_user(current->sas_ss_sp, &frame->uc.uc_stack.ss_sp);
559 err |= __put_user(sas_ss_flags(regs->rsp), 559 err |= __put_user(sas_ss_flags(regs->sp),
560 &frame->uc.uc_stack.ss_flags); 560 &frame->uc.uc_stack.ss_flags);
561 err |= __put_user(current->sas_ss_size, &frame->uc.uc_stack.ss_size); 561 err |= __put_user(current->sas_ss_size, &frame->uc.uc_stack.ss_size);
562 err |= ia32_setup_sigcontext(&frame->uc.uc_mcontext, &frame->fpstate, 562 err |= ia32_setup_sigcontext(&frame->uc.uc_mcontext, &frame->fpstate,
@@ -581,18 +581,18 @@ int ia32_setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
581 goto give_sigsegv; 581 goto give_sigsegv;
582 582
583 /* Set up registers for signal handler */ 583 /* Set up registers for signal handler */
584 regs->rsp = (unsigned long) frame; 584 regs->sp = (unsigned long) frame;
585 regs->rip = (unsigned long) ka->sa.sa_handler; 585 regs->ip = (unsigned long) ka->sa.sa_handler;
586 586
587 /* Make -mregparm=3 work */ 587 /* Make -mregparm=3 work */
588 regs->rax = sig; 588 regs->ax = sig;
589 regs->rdx = (unsigned long) &frame->info; 589 regs->dx = (unsigned long) &frame->info;
590 regs->rcx = (unsigned long) &frame->uc; 590 regs->cx = (unsigned long) &frame->uc;
591 591
592 /* Make -mregparm=3 work */ 592 /* Make -mregparm=3 work */
593 regs->rax = sig; 593 regs->ax = sig;
594 regs->rdx = (unsigned long) &frame->info; 594 regs->dx = (unsigned long) &frame->info;
595 regs->rcx = (unsigned long) &frame->uc; 595 regs->cx = (unsigned long) &frame->uc;
596 596
597 asm volatile("movl %0,%%ds" :: "r" (__USER32_DS)); 597 asm volatile("movl %0,%%ds" :: "r" (__USER32_DS));
598 asm volatile("movl %0,%%es" :: "r" (__USER32_DS)); 598 asm volatile("movl %0,%%es" :: "r" (__USER32_DS));
@@ -601,13 +601,13 @@ int ia32_setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
601 regs->ss = __USER32_DS; 601 regs->ss = __USER32_DS;
602 602
603 set_fs(USER_DS); 603 set_fs(USER_DS);
604 regs->eflags &= ~TF_MASK; 604 regs->flags &= ~TF_MASK;
605 if (test_thread_flag(TIF_SINGLESTEP)) 605 if (test_thread_flag(TIF_SINGLESTEP))
606 ptrace_notify(SIGTRAP); 606 ptrace_notify(SIGTRAP);
607 607
608#if DEBUG_SIG 608#if DEBUG_SIG
609 printk(KERN_DEBUG "SIG deliver (%s:%d): sp=%p pc=%lx ra=%u\n", 609 printk(KERN_DEBUG "SIG deliver (%s:%d): sp=%p pc=%lx ra=%u\n",
610 current->comm, current->pid, frame, regs->rip, frame->pretcode); 610 current->comm, current->pid, frame, regs->ip, frame->pretcode);
611#endif 611#endif
612 612
613 return 0; 613 return 0;
diff --git a/arch/x86/ia32/ptrace32.c b/arch/x86/ia32/ptrace32.c
index 8c6fb9d8352b..1e382e3bd882 100644
--- a/arch/x86/ia32/ptrace32.c
+++ b/arch/x86/ia32/ptrace32.c
@@ -73,19 +73,19 @@ static int putreg32(struct task_struct *child, unsigned regno, u32 val)
73 stack[offsetof(struct pt_regs, cs)/8] = val & 0xffff; 73 stack[offsetof(struct pt_regs, cs)/8] = val & 0xffff;
74 break; 74 break;
75 75
76 R32(ebx, rbx); 76 R32(ebx, bx);
77 R32(ecx, rcx); 77 R32(ecx, cx);
78 R32(edx, rdx); 78 R32(edx, dx);
79 R32(edi, rdi); 79 R32(edi, di);
80 R32(esi, rsi); 80 R32(esi, si);
81 R32(ebp, rbp); 81 R32(ebp, bp);
82 R32(eax, rax); 82 R32(eax, ax);
83 R32(orig_eax, orig_rax); 83 R32(orig_eax, orig_ax);
84 R32(eip, rip); 84 R32(eip, ip);
85 R32(esp, rsp); 85 R32(esp, sp);
86 86
87 case offsetof(struct user32, regs.eflags): { 87 case offsetof(struct user32, regs.eflags): {
88 __u64 *flags = &stack[offsetof(struct pt_regs, eflags)/8]; 88 __u64 *flags = &stack[offsetof(struct pt_regs, flags)/8];
89 89
90 val &= FLAG_MASK; 90 val &= FLAG_MASK;
91 /* 91 /*
@@ -145,22 +145,22 @@ static int getreg32(struct task_struct *child, unsigned regno, u32 *val)
145 145
146 R32(cs, cs); 146 R32(cs, cs);
147 R32(ss, ss); 147 R32(ss, ss);
148 R32(ebx, rbx); 148 R32(ebx, bx);
149 R32(ecx, rcx); 149 R32(ecx, cx);
150 R32(edx, rdx); 150 R32(edx, dx);
151 R32(edi, rdi); 151 R32(edi, di);
152 R32(esi, rsi); 152 R32(esi, si);
153 R32(ebp, rbp); 153 R32(ebp, bp);
154 R32(eax, rax); 154 R32(eax, ax);
155 R32(orig_eax, orig_rax); 155 R32(orig_eax, orig_ax);
156 R32(eip, rip); 156 R32(eip, ip);
157 R32(esp, rsp); 157 R32(esp, sp);
158 158
159 case offsetof(struct user32, regs.eflags): 159 case offsetof(struct user32, regs.eflags):
160 /* 160 /*
161 * If the debugger set TF, hide it from the readout. 161 * If the debugger set TF, hide it from the readout.
162 */ 162 */
163 *val = stack[offsetof(struct pt_regs, eflags)/8]; 163 *val = stack[offsetof(struct pt_regs, flags)/8];
164 if (test_tsk_thread_flag(child, TIF_FORCED_TF)) 164 if (test_tsk_thread_flag(child, TIF_FORCED_TF))
165 *val &= ~X86_EFLAGS_TF; 165 *val &= ~X86_EFLAGS_TF;
166 break; 166 break;
diff --git a/arch/x86/ia32/sys_ia32.c b/arch/x86/ia32/sys_ia32.c
index 58991abc5b59..abf71d26fc2a 100644
--- a/arch/x86/ia32/sys_ia32.c
+++ b/arch/x86/ia32/sys_ia32.c
@@ -816,11 +816,11 @@ asmlinkage long sys32_execve(char __user *name, compat_uptr_t __user *argv,
816asmlinkage long sys32_clone(unsigned int clone_flags, unsigned int newsp, 816asmlinkage long sys32_clone(unsigned int clone_flags, unsigned int newsp,
817 struct pt_regs *regs) 817 struct pt_regs *regs)
818{ 818{
819 void __user *parent_tid = (void __user *)regs->rdx; 819 void __user *parent_tid = (void __user *)regs->dx;
820 void __user *child_tid = (void __user *)regs->rdi; 820 void __user *child_tid = (void __user *)regs->di;
821 821
822 if (!newsp) 822 if (!newsp)
823 newsp = regs->rsp; 823 newsp = regs->sp;
824 return do_fork(clone_flags, newsp, regs, 0, parent_tid, child_tid); 824 return do_fork(clone_flags, newsp, regs, 0, parent_tid, child_tid);
825} 825}
826 826