diff options
Diffstat (limited to 'arch/x86/kernel/signal_32.c')
-rw-r--r-- | arch/x86/kernel/signal_32.c | 192 |
1 files changed, 96 insertions, 96 deletions
diff --git a/arch/x86/kernel/signal_32.c b/arch/x86/kernel/signal_32.c index 0a7c812212c9..40fd3515ccf1 100644 --- a/arch/x86/kernel/signal_32.c +++ b/arch/x86/kernel/signal_32.c | |||
@@ -82,14 +82,14 @@ sys_sigaction(int sig, const struct old_sigaction __user *act, | |||
82 | } | 82 | } |
83 | 83 | ||
84 | asmlinkage int | 84 | asmlinkage int |
85 | sys_sigaltstack(unsigned long ebx) | 85 | sys_sigaltstack(unsigned long bx) |
86 | { | 86 | { |
87 | /* This is needed to make gcc realize it doesn't own the "struct pt_regs" */ | 87 | /* This is needed to make gcc realize it doesn't own the "struct pt_regs" */ |
88 | struct pt_regs *regs = (struct pt_regs *)&ebx; | 88 | struct pt_regs *regs = (struct pt_regs *)&bx; |
89 | const stack_t __user *uss = (const stack_t __user *)ebx; | 89 | const stack_t __user *uss = (const stack_t __user *)bx; |
90 | stack_t __user *uoss = (stack_t __user *)regs->ecx; | 90 | stack_t __user *uoss = (stack_t __user *)regs->cx; |
91 | 91 | ||
92 | return do_sigaltstack(uss, uoss, regs->esp); | 92 | return do_sigaltstack(uss, uoss, regs->sp); |
93 | } | 93 | } |
94 | 94 | ||
95 | 95 | ||
@@ -105,17 +105,17 @@ restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc, int *peax | |||
105 | /* Always make any pending restarted system calls return -EINTR */ | 105 | /* Always make any pending restarted system calls return -EINTR */ |
106 | current_thread_info()->restart_block.fn = do_no_restart_syscall; | 106 | current_thread_info()->restart_block.fn = do_no_restart_syscall; |
107 | 107 | ||
108 | #define COPY(x) err |= __get_user(regs->x, &sc->x) | 108 | #define COPY(x) err |= __get_user(regs->x, &sc->e ## x) |
109 | 109 | ||
110 | #define COPY_SEG(seg) \ | 110 | #define COPY_SEG(seg) \ |
111 | { unsigned short tmp; \ | 111 | { unsigned short tmp; \ |
112 | err |= __get_user(tmp, &sc->seg); \ | 112 | err |= __get_user(tmp, &sc->seg); \ |
113 | regs->x##seg = tmp; } | 113 | regs->seg = tmp; } |
114 | 114 | ||
115 | #define COPY_SEG_STRICT(seg) \ | 115 | #define COPY_SEG_STRICT(seg) \ |
116 | { unsigned short tmp; \ | 116 | { unsigned short tmp; \ |
117 | err |= __get_user(tmp, &sc->seg); \ | 117 | err |= __get_user(tmp, &sc->seg); \ |
118 | regs->x##seg = tmp|3; } | 118 | regs->seg = tmp|3; } |
119 | 119 | ||
120 | #define GET_SEG(seg) \ | 120 | #define GET_SEG(seg) \ |
121 | { unsigned short tmp; \ | 121 | { unsigned short tmp; \ |
@@ -131,22 +131,22 @@ restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc, int *peax | |||
131 | COPY_SEG(fs); | 131 | COPY_SEG(fs); |
132 | COPY_SEG(es); | 132 | COPY_SEG(es); |
133 | COPY_SEG(ds); | 133 | COPY_SEG(ds); |
134 | COPY(edi); | 134 | COPY(di); |
135 | COPY(esi); | 135 | COPY(si); |
136 | COPY(ebp); | 136 | COPY(bp); |
137 | COPY(esp); | 137 | COPY(sp); |
138 | COPY(ebx); | 138 | COPY(bx); |
139 | COPY(edx); | 139 | COPY(dx); |
140 | COPY(ecx); | 140 | COPY(cx); |
141 | COPY(eip); | 141 | COPY(ip); |
142 | COPY_SEG_STRICT(cs); | 142 | COPY_SEG_STRICT(cs); |
143 | COPY_SEG_STRICT(ss); | 143 | COPY_SEG_STRICT(ss); |
144 | 144 | ||
145 | { | 145 | { |
146 | unsigned int tmpflags; | 146 | unsigned int tmpflags; |
147 | err |= __get_user(tmpflags, &sc->eflags); | 147 | err |= __get_user(tmpflags, &sc->eflags); |
148 | regs->eflags = (regs->eflags & ~FIX_EFLAGS) | (tmpflags & FIX_EFLAGS); | 148 | regs->flags = (regs->flags & ~FIX_EFLAGS) | (tmpflags & FIX_EFLAGS); |
149 | regs->orig_eax = -1; /* disable syscall checks */ | 149 | regs->orig_ax = -1; /* disable syscall checks */ |
150 | } | 150 | } |
151 | 151 | ||
152 | { | 152 | { |
@@ -175,9 +175,9 @@ badframe: | |||
175 | asmlinkage int sys_sigreturn(unsigned long __unused) | 175 | asmlinkage int sys_sigreturn(unsigned long __unused) |
176 | { | 176 | { |
177 | struct pt_regs *regs = (struct pt_regs *) &__unused; | 177 | struct pt_regs *regs = (struct pt_regs *) &__unused; |
178 | struct sigframe __user *frame = (struct sigframe __user *)(regs->esp - 8); | 178 | struct sigframe __user *frame = (struct sigframe __user *)(regs->sp - 8); |
179 | sigset_t set; | 179 | sigset_t set; |
180 | int eax; | 180 | int ax; |
181 | 181 | ||
182 | if (!access_ok(VERIFY_READ, frame, sizeof(*frame))) | 182 | if (!access_ok(VERIFY_READ, frame, sizeof(*frame))) |
183 | goto badframe; | 183 | goto badframe; |
@@ -193,17 +193,17 @@ asmlinkage int sys_sigreturn(unsigned long __unused) | |||
193 | recalc_sigpending(); | 193 | recalc_sigpending(); |
194 | spin_unlock_irq(¤t->sighand->siglock); | 194 | spin_unlock_irq(¤t->sighand->siglock); |
195 | 195 | ||
196 | if (restore_sigcontext(regs, &frame->sc, &eax)) | 196 | if (restore_sigcontext(regs, &frame->sc, &ax)) |
197 | goto badframe; | 197 | goto badframe; |
198 | return eax; | 198 | return ax; |
199 | 199 | ||
200 | badframe: | 200 | badframe: |
201 | if (show_unhandled_signals && printk_ratelimit()) | 201 | if (show_unhandled_signals && printk_ratelimit()) |
202 | printk("%s%s[%d] bad frame in sigreturn frame:%p eip:%lx" | 202 | printk("%s%s[%d] bad frame in sigreturn frame:%p ip:%lx" |
203 | " esp:%lx oeax:%lx\n", | 203 | " sp:%lx oeax:%lx\n", |
204 | task_pid_nr(current) > 1 ? KERN_INFO : KERN_EMERG, | 204 | task_pid_nr(current) > 1 ? KERN_INFO : KERN_EMERG, |
205 | current->comm, task_pid_nr(current), frame, regs->eip, | 205 | current->comm, task_pid_nr(current), frame, regs->ip, |
206 | regs->esp, regs->orig_eax); | 206 | regs->sp, regs->orig_ax); |
207 | 207 | ||
208 | force_sig(SIGSEGV, current); | 208 | force_sig(SIGSEGV, current); |
209 | return 0; | 209 | return 0; |
@@ -212,9 +212,9 @@ badframe: | |||
212 | asmlinkage int sys_rt_sigreturn(unsigned long __unused) | 212 | asmlinkage int sys_rt_sigreturn(unsigned long __unused) |
213 | { | 213 | { |
214 | struct pt_regs *regs = (struct pt_regs *) &__unused; | 214 | struct pt_regs *regs = (struct pt_regs *) &__unused; |
215 | struct rt_sigframe __user *frame = (struct rt_sigframe __user *)(regs->esp - 4); | 215 | struct rt_sigframe __user *frame = (struct rt_sigframe __user *)(regs->sp - 4); |
216 | sigset_t set; | 216 | sigset_t set; |
217 | int eax; | 217 | int ax; |
218 | 218 | ||
219 | if (!access_ok(VERIFY_READ, frame, sizeof(*frame))) | 219 | if (!access_ok(VERIFY_READ, frame, sizeof(*frame))) |
220 | goto badframe; | 220 | goto badframe; |
@@ -227,13 +227,13 @@ asmlinkage int sys_rt_sigreturn(unsigned long __unused) | |||
227 | recalc_sigpending(); | 227 | recalc_sigpending(); |
228 | spin_unlock_irq(¤t->sighand->siglock); | 228 | spin_unlock_irq(¤t->sighand->siglock); |
229 | 229 | ||
230 | if (restore_sigcontext(regs, &frame->uc.uc_mcontext, &eax)) | 230 | if (restore_sigcontext(regs, &frame->uc.uc_mcontext, &ax)) |
231 | goto badframe; | 231 | goto badframe; |
232 | 232 | ||
233 | if (do_sigaltstack(&frame->uc.uc_stack, NULL, regs->esp) == -EFAULT) | 233 | if (do_sigaltstack(&frame->uc.uc_stack, NULL, regs->sp) == -EFAULT) |
234 | goto badframe; | 234 | goto badframe; |
235 | 235 | ||
236 | return eax; | 236 | return ax; |
237 | 237 | ||
238 | badframe: | 238 | badframe: |
239 | force_sig(SIGSEGV, current); | 239 | force_sig(SIGSEGV, current); |
@@ -250,27 +250,27 @@ setup_sigcontext(struct sigcontext __user *sc, struct _fpstate __user *fpstate, | |||
250 | { | 250 | { |
251 | int tmp, err = 0; | 251 | int tmp, err = 0; |
252 | 252 | ||
253 | err |= __put_user(regs->xfs, (unsigned int __user *)&sc->fs); | 253 | err |= __put_user(regs->fs, (unsigned int __user *)&sc->fs); |
254 | savesegment(gs, tmp); | 254 | savesegment(gs, tmp); |
255 | err |= __put_user(tmp, (unsigned int __user *)&sc->gs); | 255 | err |= __put_user(tmp, (unsigned int __user *)&sc->gs); |
256 | 256 | ||
257 | err |= __put_user(regs->xes, (unsigned int __user *)&sc->es); | 257 | err |= __put_user(regs->es, (unsigned int __user *)&sc->es); |
258 | err |= __put_user(regs->xds, (unsigned int __user *)&sc->ds); | 258 | err |= __put_user(regs->ds, (unsigned int __user *)&sc->ds); |
259 | err |= __put_user(regs->edi, &sc->edi); | 259 | err |= __put_user(regs->di, &sc->edi); |
260 | err |= __put_user(regs->esi, &sc->esi); | 260 | err |= __put_user(regs->si, &sc->esi); |
261 | err |= __put_user(regs->ebp, &sc->ebp); | 261 | err |= __put_user(regs->bp, &sc->ebp); |
262 | err |= __put_user(regs->esp, &sc->esp); | 262 | err |= __put_user(regs->sp, &sc->esp); |
263 | err |= __put_user(regs->ebx, &sc->ebx); | 263 | err |= __put_user(regs->bx, &sc->ebx); |
264 | err |= __put_user(regs->edx, &sc->edx); | 264 | err |= __put_user(regs->dx, &sc->edx); |
265 | err |= __put_user(regs->ecx, &sc->ecx); | 265 | err |= __put_user(regs->cx, &sc->ecx); |
266 | err |= __put_user(regs->eax, &sc->eax); | 266 | err |= __put_user(regs->ax, &sc->eax); |
267 | err |= __put_user(current->thread.trap_no, &sc->trapno); | 267 | err |= __put_user(current->thread.trap_no, &sc->trapno); |
268 | err |= __put_user(current->thread.error_code, &sc->err); | 268 | err |= __put_user(current->thread.error_code, &sc->err); |
269 | err |= __put_user(regs->eip, &sc->eip); | 269 | err |= __put_user(regs->ip, &sc->eip); |
270 | err |= __put_user(regs->xcs, (unsigned int __user *)&sc->cs); | 270 | err |= __put_user(regs->cs, (unsigned int __user *)&sc->cs); |
271 | err |= __put_user(regs->eflags, &sc->eflags); | 271 | err |= __put_user(regs->flags, &sc->eflags); |
272 | err |= __put_user(regs->esp, &sc->esp_at_signal); | 272 | err |= __put_user(regs->sp, &sc->esp_at_signal); |
273 | err |= __put_user(regs->xss, (unsigned int __user *)&sc->ss); | 273 | err |= __put_user(regs->ss, (unsigned int __user *)&sc->ss); |
274 | 274 | ||
275 | tmp = save_i387(fpstate); | 275 | tmp = save_i387(fpstate); |
276 | if (tmp < 0) | 276 | if (tmp < 0) |
@@ -291,36 +291,36 @@ setup_sigcontext(struct sigcontext __user *sc, struct _fpstate __user *fpstate, | |||
291 | static inline void __user * | 291 | static inline void __user * |
292 | get_sigframe(struct k_sigaction *ka, struct pt_regs * regs, size_t frame_size) | 292 | get_sigframe(struct k_sigaction *ka, struct pt_regs * regs, size_t frame_size) |
293 | { | 293 | { |
294 | unsigned long esp; | 294 | unsigned long sp; |
295 | 295 | ||
296 | /* Default to using normal stack */ | 296 | /* Default to using normal stack */ |
297 | esp = regs->esp; | 297 | sp = regs->sp; |
298 | 298 | ||
299 | /* | 299 | /* |
300 | * If we are on the alternate signal stack and would overflow it, don't. | 300 | * If we are on the alternate signal stack and would overflow it, don't. |
301 | * Return an always-bogus address instead so we will die with SIGSEGV. | 301 | * Return an always-bogus address instead so we will die with SIGSEGV. |
302 | */ | 302 | */ |
303 | if (on_sig_stack(esp) && !likely(on_sig_stack(esp - frame_size))) | 303 | if (on_sig_stack(sp) && !likely(on_sig_stack(sp - frame_size))) |
304 | return (void __user *) -1L; | 304 | return (void __user *) -1L; |
305 | 305 | ||
306 | /* This is the X/Open sanctioned signal stack switching. */ | 306 | /* This is the X/Open sanctioned signal stack switching. */ |
307 | if (ka->sa.sa_flags & SA_ONSTACK) { | 307 | if (ka->sa.sa_flags & SA_ONSTACK) { |
308 | if (sas_ss_flags(esp) == 0) | 308 | if (sas_ss_flags(sp) == 0) |
309 | esp = current->sas_ss_sp + current->sas_ss_size; | 309 | sp = current->sas_ss_sp + current->sas_ss_size; |
310 | } | 310 | } |
311 | 311 | ||
312 | /* This is the legacy signal stack switching. */ | 312 | /* This is the legacy signal stack switching. */ |
313 | else if ((regs->xss & 0xffff) != __USER_DS && | 313 | else if ((regs->ss & 0xffff) != __USER_DS && |
314 | !(ka->sa.sa_flags & SA_RESTORER) && | 314 | !(ka->sa.sa_flags & SA_RESTORER) && |
315 | ka->sa.sa_restorer) { | 315 | ka->sa.sa_restorer) { |
316 | esp = (unsigned long) ka->sa.sa_restorer; | 316 | sp = (unsigned long) ka->sa.sa_restorer; |
317 | } | 317 | } |
318 | 318 | ||
319 | esp -= frame_size; | 319 | sp -= frame_size; |
320 | /* Align the stack pointer according to the i386 ABI, | 320 | /* Align the stack pointer according to the i386 ABI, |
321 | * i.e. so that on function entry ((sp + 4) & 15) == 0. */ | 321 | * i.e. so that on function entry ((sp + 4) & 15) == 0. */ |
322 | esp = ((esp + 4) & -16ul) - 4; | 322 | sp = ((sp + 4) & -16ul) - 4; |
323 | return (void __user *) esp; | 323 | return (void __user *) sp; |
324 | } | 324 | } |
325 | 325 | ||
326 | /* These symbols are defined with the addresses in the vsyscall page. | 326 | /* These symbols are defined with the addresses in the vsyscall page. |
@@ -387,16 +387,16 @@ static int setup_frame(int sig, struct k_sigaction *ka, | |||
387 | goto give_sigsegv; | 387 | goto give_sigsegv; |
388 | 388 | ||
389 | /* Set up registers for signal handler */ | 389 | /* Set up registers for signal handler */ |
390 | regs->esp = (unsigned long) frame; | 390 | regs->sp = (unsigned long) frame; |
391 | regs->eip = (unsigned long) ka->sa.sa_handler; | 391 | regs->ip = (unsigned long) ka->sa.sa_handler; |
392 | regs->eax = (unsigned long) sig; | 392 | regs->ax = (unsigned long) sig; |
393 | regs->edx = (unsigned long) 0; | 393 | regs->dx = (unsigned long) 0; |
394 | regs->ecx = (unsigned long) 0; | 394 | regs->cx = (unsigned long) 0; |
395 | 395 | ||
396 | regs->xds = __USER_DS; | 396 | regs->ds = __USER_DS; |
397 | regs->xes = __USER_DS; | 397 | regs->es = __USER_DS; |
398 | regs->xss = __USER_DS; | 398 | regs->ss = __USER_DS; |
399 | regs->xcs = __USER_CS; | 399 | regs->cs = __USER_CS; |
400 | 400 | ||
401 | /* | 401 | /* |
402 | * Clear TF when entering the signal handler, but | 402 | * Clear TF when entering the signal handler, but |
@@ -404,13 +404,13 @@ static int setup_frame(int sig, struct k_sigaction *ka, | |||
404 | * The tracer may want to single-step inside the | 404 | * The tracer may want to single-step inside the |
405 | * handler too. | 405 | * handler too. |
406 | */ | 406 | */ |
407 | regs->eflags &= ~TF_MASK; | 407 | regs->flags &= ~TF_MASK; |
408 | if (test_thread_flag(TIF_SINGLESTEP)) | 408 | if (test_thread_flag(TIF_SINGLESTEP)) |
409 | ptrace_notify(SIGTRAP); | 409 | ptrace_notify(SIGTRAP); |
410 | 410 | ||
411 | #if DEBUG_SIG | 411 | #if DEBUG_SIG |
412 | printk("SIG deliver (%s:%d): sp=%p pc=%p ra=%p\n", | 412 | printk("SIG deliver (%s:%d): sp=%p pc=%p ra=%p\n", |
413 | current->comm, current->pid, frame, regs->eip, frame->pretcode); | 413 | current->comm, current->pid, frame, regs->ip, frame->pretcode); |
414 | #endif | 414 | #endif |
415 | 415 | ||
416 | return 0; | 416 | return 0; |
@@ -450,7 +450,7 @@ static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, | |||
450 | err |= __put_user(0, &frame->uc.uc_flags); | 450 | err |= __put_user(0, &frame->uc.uc_flags); |
451 | err |= __put_user(0, &frame->uc.uc_link); | 451 | err |= __put_user(0, &frame->uc.uc_link); |
452 | err |= __put_user(current->sas_ss_sp, &frame->uc.uc_stack.ss_sp); | 452 | err |= __put_user(current->sas_ss_sp, &frame->uc.uc_stack.ss_sp); |
453 | err |= __put_user(sas_ss_flags(regs->esp), | 453 | err |= __put_user(sas_ss_flags(regs->sp), |
454 | &frame->uc.uc_stack.ss_flags); | 454 | &frame->uc.uc_stack.ss_flags); |
455 | err |= __put_user(current->sas_ss_size, &frame->uc.uc_stack.ss_size); | 455 | err |= __put_user(current->sas_ss_size, &frame->uc.uc_stack.ss_size); |
456 | err |= setup_sigcontext(&frame->uc.uc_mcontext, &frame->fpstate, | 456 | err |= setup_sigcontext(&frame->uc.uc_mcontext, &frame->fpstate, |
@@ -466,7 +466,7 @@ static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, | |||
466 | err |= __put_user(restorer, &frame->pretcode); | 466 | err |= __put_user(restorer, &frame->pretcode); |
467 | 467 | ||
468 | /* | 468 | /* |
469 | * This is movl $,%eax ; int $0x80 | 469 | * This is movl $,%ax ; int $0x80 |
470 | * | 470 | * |
471 | * WE DO NOT USE IT ANY MORE! It's only left here for historical | 471 | * WE DO NOT USE IT ANY MORE! It's only left here for historical |
472 | * reasons and because gdb uses it as a signature to notice | 472 | * reasons and because gdb uses it as a signature to notice |
@@ -480,16 +480,16 @@ static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, | |||
480 | goto give_sigsegv; | 480 | goto give_sigsegv; |
481 | 481 | ||
482 | /* Set up registers for signal handler */ | 482 | /* Set up registers for signal handler */ |
483 | regs->esp = (unsigned long) frame; | 483 | regs->sp = (unsigned long) frame; |
484 | regs->eip = (unsigned long) ka->sa.sa_handler; | 484 | regs->ip = (unsigned long) ka->sa.sa_handler; |
485 | regs->eax = (unsigned long) usig; | 485 | regs->ax = (unsigned long) usig; |
486 | regs->edx = (unsigned long) &frame->info; | 486 | regs->dx = (unsigned long) &frame->info; |
487 | regs->ecx = (unsigned long) &frame->uc; | 487 | regs->cx = (unsigned long) &frame->uc; |
488 | 488 | ||
489 | regs->xds = __USER_DS; | 489 | regs->ds = __USER_DS; |
490 | regs->xes = __USER_DS; | 490 | regs->es = __USER_DS; |
491 | regs->xss = __USER_DS; | 491 | regs->ss = __USER_DS; |
492 | regs->xcs = __USER_CS; | 492 | regs->cs = __USER_CS; |
493 | 493 | ||
494 | /* | 494 | /* |
495 | * Clear TF when entering the signal handler, but | 495 | * Clear TF when entering the signal handler, but |
@@ -497,13 +497,13 @@ static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, | |||
497 | * The tracer may want to single-step inside the | 497 | * The tracer may want to single-step inside the |
498 | * handler too. | 498 | * handler too. |
499 | */ | 499 | */ |
500 | regs->eflags &= ~TF_MASK; | 500 | regs->flags &= ~TF_MASK; |
501 | if (test_thread_flag(TIF_SINGLESTEP)) | 501 | if (test_thread_flag(TIF_SINGLESTEP)) |
502 | ptrace_notify(SIGTRAP); | 502 | ptrace_notify(SIGTRAP); |
503 | 503 | ||
504 | #if DEBUG_SIG | 504 | #if DEBUG_SIG |
505 | printk("SIG deliver (%s:%d): sp=%p pc=%p ra=%p\n", | 505 | printk("SIG deliver (%s:%d): sp=%p pc=%p ra=%p\n", |
506 | current->comm, current->pid, frame, regs->eip, frame->pretcode); | 506 | current->comm, current->pid, frame, regs->ip, frame->pretcode); |
507 | #endif | 507 | #endif |
508 | 508 | ||
509 | return 0; | 509 | return 0; |
@@ -524,23 +524,23 @@ handle_signal(unsigned long sig, siginfo_t *info, struct k_sigaction *ka, | |||
524 | int ret; | 524 | int ret; |
525 | 525 | ||
526 | /* Are we from a system call? */ | 526 | /* Are we from a system call? */ |
527 | if (regs->orig_eax >= 0) { | 527 | if (regs->orig_ax >= 0) { |
528 | /* If so, check system call restarting.. */ | 528 | /* If so, check system call restarting.. */ |
529 | switch (regs->eax) { | 529 | switch (regs->ax) { |
530 | case -ERESTART_RESTARTBLOCK: | 530 | case -ERESTART_RESTARTBLOCK: |
531 | case -ERESTARTNOHAND: | 531 | case -ERESTARTNOHAND: |
532 | regs->eax = -EINTR; | 532 | regs->ax = -EINTR; |
533 | break; | 533 | break; |
534 | 534 | ||
535 | case -ERESTARTSYS: | 535 | case -ERESTARTSYS: |
536 | if (!(ka->sa.sa_flags & SA_RESTART)) { | 536 | if (!(ka->sa.sa_flags & SA_RESTART)) { |
537 | regs->eax = -EINTR; | 537 | regs->ax = -EINTR; |
538 | break; | 538 | break; |
539 | } | 539 | } |
540 | /* fallthrough */ | 540 | /* fallthrough */ |
541 | case -ERESTARTNOINTR: | 541 | case -ERESTARTNOINTR: |
542 | regs->eax = regs->orig_eax; | 542 | regs->ax = regs->orig_ax; |
543 | regs->eip -= 2; | 543 | regs->ip -= 2; |
544 | } | 544 | } |
545 | } | 545 | } |
546 | 546 | ||
@@ -548,9 +548,9 @@ handle_signal(unsigned long sig, siginfo_t *info, struct k_sigaction *ka, | |||
548 | * If TF is set due to a debugger (TIF_FORCED_TF), clear the TF | 548 | * If TF is set due to a debugger (TIF_FORCED_TF), clear the TF |
549 | * flag so that register information in the sigcontext is correct. | 549 | * flag so that register information in the sigcontext is correct. |
550 | */ | 550 | */ |
551 | if (unlikely(regs->eflags & X86_EFLAGS_TF) && | 551 | if (unlikely(regs->flags & X86_EFLAGS_TF) && |
552 | likely(test_and_clear_thread_flag(TIF_FORCED_TF))) | 552 | likely(test_and_clear_thread_flag(TIF_FORCED_TF))) |
553 | regs->eflags &= ~X86_EFLAGS_TF; | 553 | regs->flags &= ~X86_EFLAGS_TF; |
554 | 554 | ||
555 | /* Set up the stack frame */ | 555 | /* Set up the stack frame */ |
556 | if (ka->sa.sa_flags & SA_SIGINFO) | 556 | if (ka->sa.sa_flags & SA_SIGINFO) |
@@ -622,19 +622,19 @@ static void fastcall do_signal(struct pt_regs *regs) | |||
622 | } | 622 | } |
623 | 623 | ||
624 | /* Did we come from a system call? */ | 624 | /* Did we come from a system call? */ |
625 | if (regs->orig_eax >= 0) { | 625 | if (regs->orig_ax >= 0) { |
626 | /* Restart the system call - no handlers present */ | 626 | /* Restart the system call - no handlers present */ |
627 | switch (regs->eax) { | 627 | switch (regs->ax) { |
628 | case -ERESTARTNOHAND: | 628 | case -ERESTARTNOHAND: |
629 | case -ERESTARTSYS: | 629 | case -ERESTARTSYS: |
630 | case -ERESTARTNOINTR: | 630 | case -ERESTARTNOINTR: |
631 | regs->eax = regs->orig_eax; | 631 | regs->ax = regs->orig_ax; |
632 | regs->eip -= 2; | 632 | regs->ip -= 2; |
633 | break; | 633 | break; |
634 | 634 | ||
635 | case -ERESTART_RESTARTBLOCK: | 635 | case -ERESTART_RESTARTBLOCK: |
636 | regs->eax = __NR_restart_syscall; | 636 | regs->ax = __NR_restart_syscall; |
637 | regs->eip -= 2; | 637 | regs->ip -= 2; |
638 | break; | 638 | break; |
639 | } | 639 | } |
640 | } | 640 | } |
@@ -657,7 +657,7 @@ void do_notify_resume(struct pt_regs *regs, void *_unused, | |||
657 | { | 657 | { |
658 | /* Pending single-step? */ | 658 | /* Pending single-step? */ |
659 | if (thread_info_flags & _TIF_SINGLESTEP) { | 659 | if (thread_info_flags & _TIF_SINGLESTEP) { |
660 | regs->eflags |= TF_MASK; | 660 | regs->flags |= TF_MASK; |
661 | clear_thread_flag(TIF_SINGLESTEP); | 661 | clear_thread_flag(TIF_SINGLESTEP); |
662 | } | 662 | } |
663 | 663 | ||