Import 2.1.116pre2
[davej-history.git] / arch / i386 / kernel / signal.c
blob05e53287a6d98a3cca68302d10d5d76891803555
1 /*
2 * linux/arch/i386/kernel/signal.c
4 * Copyright (C) 1991, 1992 Linus Torvalds
6 * 1997-11-28 Modified for POSIX.1b signals by Richard Henderson
7 */
9 #include <linux/config.h>
11 #include <linux/sched.h>
12 #include <linux/mm.h>
13 #include <linux/smp.h>
14 #include <linux/smp_lock.h>
15 #include <linux/kernel.h>
16 #include <linux/signal.h>
17 #include <linux/errno.h>
18 #include <linux/wait.h>
19 #include <linux/ptrace.h>
20 #include <linux/unistd.h>
21 #include <linux/stddef.h>
22 #include <asm/ucontext.h>
23 #include <asm/uaccess.h>
25 #define DEBUG_SIG 0
27 #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP)))
29 asmlinkage int sys_wait4(pid_t pid, unsigned long *stat_addr,
30 int options, unsigned long *ru);
31 asmlinkage int do_signal(sigset_t *oldset, struct pt_regs *regs);
34 * Atomically swap in the new signal mask, and wait for a signal.
36 asmlinkage int
37 sys_sigsuspend(int history0, int history1, old_sigset_t mask)
39 struct pt_regs * regs = (struct pt_regs *) &history0;
40 sigset_t saveset;
42 mask &= _BLOCKABLE;
43 spin_lock_irq(&current->sigmask_lock);
44 saveset = current->blocked;
45 siginitset(&current->blocked, mask);
46 recalc_sigpending(current);
47 spin_unlock_irq(&current->sigmask_lock);
49 regs->eax = -EINTR;
50 while (1) {
51 current->state = TASK_INTERRUPTIBLE;
52 schedule();
53 if (do_signal(&saveset, regs))
54 return -EINTR;
58 asmlinkage int
59 sys_rt_sigsuspend(sigset_t *unewset, size_t sigsetsize)
61 struct pt_regs * regs = (struct pt_regs *) &unewset;
62 sigset_t saveset, newset;
64 /* XXX: Don't preclude handling different sized sigset_t's. */
65 if (sigsetsize != sizeof(sigset_t))
66 return -EINVAL;
68 if (copy_from_user(&newset, unewset, sizeof(newset)))
69 return -EFAULT;
70 sigdelsetmask(&newset, ~_BLOCKABLE);
72 spin_lock_irq(&current->sigmask_lock);
73 saveset = current->blocked;
74 current->blocked = newset;
75 recalc_sigpending(current);
76 spin_unlock_irq(&current->sigmask_lock);
78 regs->eax = -EINTR;
79 while (1) {
80 current->state = TASK_INTERRUPTIBLE;
81 schedule();
82 if (do_signal(&saveset, regs))
83 return -EINTR;
87 asmlinkage int
88 sys_sigaction(int sig, const struct old_sigaction *act,
89 struct old_sigaction *oact)
91 struct k_sigaction new_ka, old_ka;
92 int ret;
94 if (act) {
95 old_sigset_t mask;
96 if (verify_area(VERIFY_READ, act, sizeof(*act)) ||
97 __get_user(new_ka.sa.sa_handler, &act->sa_handler) ||
98 __get_user(new_ka.sa.sa_restorer, &act->sa_restorer))
99 return -EFAULT;
100 __get_user(new_ka.sa.sa_flags, &act->sa_flags);
101 __get_user(mask, &act->sa_mask);
102 siginitset(&new_ka.sa.sa_mask, mask);
105 ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL);
107 if (!ret && oact) {
108 if (verify_area(VERIFY_WRITE, oact, sizeof(*oact)) ||
109 __put_user(old_ka.sa.sa_handler, &oact->sa_handler) ||
110 __put_user(old_ka.sa.sa_restorer, &oact->sa_restorer))
111 return -EFAULT;
112 __put_user(old_ka.sa.sa_flags, &oact->sa_flags);
113 __put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask);
116 return ret;
119 asmlinkage int
120 sys_sigaltstack(const stack_t *uss, stack_t *uoss)
122 struct pt_regs *regs = (struct pt_regs *) &uss;
123 return do_sigaltstack(uss, uoss, regs->esp);
128 * Do a signal return; undo the signal stack.
131 struct sigframe
133 char *pretcode;
134 int sig;
135 struct sigcontext sc;
136 struct _fpstate fpstate;
137 unsigned long extramask[_NSIG_WORDS-1];
138 char retcode[8];
141 struct rt_sigframe
143 char *pretcode;
144 int sig;
145 struct siginfo *pinfo;
146 void *puc;
147 struct siginfo info;
148 struct ucontext uc;
149 struct _fpstate fpstate;
150 char retcode[8];
154 static inline int restore_i387_hard(struct _fpstate *buf)
156 if (current->flags & PF_USEDFPU) {
157 current->flags &= ~PF_USEDFPU;
158 stts();
160 return __copy_from_user(&current->tss.i387.hard, buf, sizeof(*buf));
163 static inline int restore_i387(struct _fpstate *buf)
165 int err;
166 #ifndef CONFIG_MATH_EMULATION
167 err = restore_i387_hard(buf);
168 #else
169 if (boot_cpu_data.hard_math)
170 err = restore_i387_hard(buf);
171 else
172 err = restore_i387_soft(&current->tss.i387.soft, buf);
173 #endif
174 current->used_math = 1;
175 return err;
178 static int
179 restore_sigcontext(struct pt_regs *regs, struct sigcontext *sc, int *peax)
181 unsigned int err = 0;
183 #define COPY(x) err |= __get_user(regs->x, &sc->x)
185 #define COPY_SEG(seg) \
186 { unsigned short tmp; \
187 err |= __get_user(tmp, &sc->seg); \
188 if ((tmp & 0xfffc) /* not a NULL selectors */ \
189 && (tmp & 0x4) != 0x4 /* not a LDT selector */ \
190 && (tmp & 3) != 3) /* not a RPL3 GDT selector */ \
191 goto badframe; \
192 regs->x##seg = tmp; }
194 #define COPY_SEG_STRICT(seg) \
195 { unsigned short tmp; \
196 err |= __get_user(tmp, &sc->seg); \
197 if ((tmp & 0xfffc) && (tmp & 3) != 3) goto badframe; \
198 regs->x##seg = tmp; }
200 #define GET_SEG(seg) \
201 { unsigned short tmp; \
202 err |= __get_user(tmp, &sc->seg); \
203 if ((tmp & 0xfffc) /* not a NULL selectors */ \
204 && (tmp & 0x4) != 0x4 /* not a LDT selector */ \
205 && (tmp & 3) != 3) /* not a RPL3 GDT selector */ \
206 goto badframe; \
207 loadsegment(seg,tmp); }
209 GET_SEG(gs);
210 GET_SEG(fs);
211 COPY_SEG(es);
212 COPY_SEG(ds);
213 COPY(edi);
214 COPY(esi);
215 COPY(ebp);
216 COPY(esp);
217 COPY(ebx);
218 COPY(edx);
219 COPY(ecx);
220 COPY(eip);
221 COPY_SEG_STRICT(cs);
222 COPY_SEG_STRICT(ss);
225 unsigned int tmpflags;
226 err |= __get_user(tmpflags, &sc->eflags);
227 regs->eflags = (regs->eflags & ~0x40DD5) | (tmpflags & 0x40DD5);
228 regs->orig_eax = -1; /* disable syscall checks */
232 struct _fpstate * buf;
233 err |= __get_user(buf, &sc->fpstate);
234 if (buf) {
235 if (verify_area(VERIFY_READ, buf, sizeof(*buf)))
236 goto badframe;
237 err |= restore_i387(buf);
241 err |= __get_user(*peax, &sc->eax);
242 return err;
244 badframe:
245 return 1;
248 asmlinkage int sys_sigreturn(unsigned long __unused)
250 struct pt_regs *regs = (struct pt_regs *) &__unused;
251 struct sigframe *frame = (struct sigframe *)(regs->esp - 8);
252 sigset_t set;
253 int eax;
255 if (verify_area(VERIFY_READ, frame, sizeof(*frame)))
256 goto badframe;
257 if (__get_user(set.sig[0], &frame->sc.oldmask)
258 || (_NSIG_WORDS > 1
259 && __copy_from_user(&set.sig[1], &frame->extramask,
260 sizeof(frame->extramask))))
261 goto badframe;
263 sigdelsetmask(&set, ~_BLOCKABLE);
264 spin_lock_irq(&current->sigmask_lock);
265 current->blocked = set;
266 recalc_sigpending(current);
267 spin_unlock_irq(&current->sigmask_lock);
269 if (restore_sigcontext(regs, &frame->sc, &eax))
270 goto badframe;
271 return eax;
273 badframe:
274 force_sig(SIGSEGV, current);
275 return 0;
278 asmlinkage int sys_rt_sigreturn(unsigned long __unused)
280 struct pt_regs *regs = (struct pt_regs *) &__unused;
281 struct rt_sigframe *frame = (struct rt_sigframe *)(regs->esp - 4);
282 sigset_t set;
283 stack_t st;
284 int eax;
286 if (verify_area(VERIFY_READ, frame, sizeof(*frame)))
287 goto badframe;
288 if (__copy_from_user(&set, &frame->uc.uc_sigmask, sizeof(set)))
289 goto badframe;
291 sigdelsetmask(&set, ~_BLOCKABLE);
292 spin_lock_irq(&current->sigmask_lock);
293 current->blocked = set;
294 recalc_sigpending(current);
295 spin_unlock_irq(&current->sigmask_lock);
297 if (restore_sigcontext(regs, &frame->uc.uc_mcontext, &eax))
298 goto badframe;
300 if (__copy_from_user(&st, &frame->uc.uc_stack, sizeof(st)))
301 goto badframe;
302 /* It is more difficult to avoid calling this function than to
303 call it and ignore errors. */
304 do_sigaltstack(&st, NULL, regs->esp);
306 return eax;
308 badframe:
309 force_sig(SIGSEGV, current);
310 return 0;
314 * Set up a signal frame.
317 static inline int save_i387_hard(struct _fpstate * buf)
319 if (current->flags & PF_USEDFPU) {
320 current->flags &= ~PF_USEDFPU;
321 __asm__ __volatile__("fnsave %0":"=m"(current->tss.i387.hard));
322 stts();
324 asm volatile("fwait");
325 current->tss.i387.hard.status = current->tss.i387.hard.swd;
326 if (__copy_to_user(buf, &current->tss.i387.hard, sizeof(*buf)))
327 return -1;
328 return 1;
331 static int save_i387(struct _fpstate *buf)
333 if (!current->used_math)
334 return 0;
336 /* This will cause a "finit" to be triggered by the next
337 attempted FPU operation by the 'current' process.
339 current->used_math = 0;
341 #ifndef CONFIG_MATH_EMULATION
342 return save_i387_hard(buf);
343 #else
344 return boot_cpu_data.hard_math ? save_i387_hard(buf)
345 : save_i387_soft(&current->tss.i387.soft, buf);
346 #endif
349 static int
350 setup_sigcontext(struct sigcontext *sc, struct _fpstate *fpstate,
351 struct pt_regs *regs, unsigned long mask)
353 int tmp, err = 0;
355 tmp = 0;
356 __asm__("movl %%gs,%w0" : "=r"(tmp): "0"(tmp));
357 err |= __put_user(tmp, (unsigned int *)&sc->gs);
358 __asm__("movl %%fs,%w0" : "=r"(tmp): "0"(tmp));
359 err |= __put_user(tmp, (unsigned int *)&sc->fs);
361 err |= __put_user(regs->xes, (unsigned int *)&sc->es);
362 err |= __put_user(regs->xds, (unsigned int *)&sc->ds);
363 err |= __put_user(regs->edi, &sc->edi);
364 err |= __put_user(regs->esi, &sc->esi);
365 err |= __put_user(regs->ebp, &sc->ebp);
366 err |= __put_user(regs->esp, &sc->esp);
367 err |= __put_user(regs->ebx, &sc->ebx);
368 err |= __put_user(regs->edx, &sc->edx);
369 err |= __put_user(regs->ecx, &sc->ecx);
370 err |= __put_user(regs->eax, &sc->eax);
371 err |= __put_user(current->tss.trap_no, &sc->trapno);
372 err |= __put_user(current->tss.error_code, &sc->err);
373 err |= __put_user(regs->eip, &sc->eip);
374 err |= __put_user(regs->xcs, (unsigned int *)&sc->cs);
375 err |= __put_user(regs->eflags, &sc->eflags);
376 err |= __put_user(regs->esp, &sc->esp_at_signal);
377 err |= __put_user(regs->xss, (unsigned int *)&sc->ss);
379 tmp = save_i387(fpstate);
380 if (tmp < 0)
381 err = 1;
382 else
383 err |= __put_user(tmp ? fpstate : NULL, &sc->fpstate);
385 /* non-iBCS2 extensions.. */
386 err |= __put_user(mask, &sc->oldmask);
387 err |= __put_user(current->tss.cr2, &sc->cr2);
389 return err;
393 * Determine which stack to use..
395 static inline void *
396 get_sigframe(struct k_sigaction *ka, struct pt_regs * regs, size_t frame_size)
398 unsigned long esp;
400 /* Default to using normal stack */
401 esp = regs->esp;
403 /* This is the X/Open sanctioned signal stack switching. */
404 if (ka->sa.sa_flags & SA_ONSTACK) {
405 if (! on_sig_stack(esp))
406 esp = current->sas_ss_sp + current->sas_ss_size;
409 /* This is the legacy signal stack switching. */
410 else if ((regs->xss & 0xffff) != __USER_DS &&
411 !(ka->sa.sa_flags & SA_RESTORER) &&
412 ka->sa.sa_restorer) {
413 esp = (unsigned long) ka->sa.sa_restorer;
416 return (void *)((esp - frame_size) & -8ul);
419 static void setup_frame(int sig, struct k_sigaction *ka,
420 sigset_t *set, struct pt_regs * regs)
422 struct sigframe *frame;
423 int err = 0;
425 frame = get_sigframe(ka, regs, sizeof(*frame));
427 if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame)))
428 goto give_sigsegv;
430 err |= __put_user((current->exec_domain
431 && current->exec_domain->signal_invmap
432 && sig < 32
433 ? current->exec_domain->signal_invmap[sig]
434 : sig),
435 &frame->sig);
437 err |= setup_sigcontext(&frame->sc, &frame->fpstate, regs, set->sig[0]);
439 if (_NSIG_WORDS > 1) {
440 err |= __copy_to_user(frame->extramask, &set->sig[1],
441 sizeof(frame->extramask));
444 /* Set up to return from userspace. If provided, use a stub
445 already in userspace. */
446 if (ka->sa.sa_flags & SA_RESTORER) {
447 err |= __put_user(ka->sa.sa_restorer, &frame->pretcode);
448 } else {
449 err |= __put_user(frame->retcode, &frame->pretcode);
450 /* This is popl %eax ; movl $,%eax ; int $0x80 */
451 err |= __put_user(0xb858, (short *)(frame->retcode+0));
452 err |= __put_user(__NR_sigreturn, (int *)(frame->retcode+2));
453 err |= __put_user(0x80cd, (short *)(frame->retcode+6));
456 if (err)
457 goto give_sigsegv;
459 /* Set up registers for signal handler */
460 regs->esp = (unsigned long) frame;
461 regs->eip = (unsigned long) ka->sa.sa_handler;
463 unsigned long seg = __USER_DS;
464 __asm__("movl %w0,%%fs ; movl %w0,%%gs": "=r"(seg) : "0"(seg));
465 set_fs(USER_DS);
466 regs->xds = seg;
467 regs->xes = seg;
468 regs->xss = seg;
469 regs->xcs = __USER_CS;
471 regs->eflags &= ~TF_MASK;
473 #if DEBUG_SIG
474 printk("SIG deliver (%s:%d): sp=%p pc=%p ra=%p\n",
475 current->comm, current->pid, frame, regs->eip, frame->pretcode);
476 #endif
478 return;
480 give_sigsegv:
481 if (sig == SIGSEGV)
482 ka->sa.sa_handler = SIG_DFL;
483 force_sig(SIGSEGV, current);
486 static void setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
487 sigset_t *set, struct pt_regs * regs)
489 struct rt_sigframe *frame;
490 int err = 0;
492 frame = get_sigframe(ka, regs, sizeof(*frame));
494 if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame)))
495 goto give_sigsegv;
497 err |= __put_user((current->exec_domain
498 && current->exec_domain->signal_invmap
499 && sig < 32
500 ? current->exec_domain->signal_invmap[sig]
501 : sig),
502 &frame->sig);
503 err |= __put_user(&frame->info, &frame->pinfo);
504 err |= __put_user(&frame->uc, &frame->puc);
505 err |= __copy_to_user(&frame->info, info, sizeof(*info));
507 /* Create the ucontext. */
508 err |= __put_user(0, &frame->uc.uc_flags);
509 err |= __put_user(0, &frame->uc.uc_link);
510 err |= __put_user(current->sas_ss_sp, &frame->uc.uc_stack.ss_sp);
511 err |= __put_user(sas_ss_flags(regs->esp),
512 &frame->uc.uc_stack.ss_flags);
513 err |= __put_user(current->sas_ss_size, &frame->uc.uc_stack.ss_size);
514 err |= setup_sigcontext(&frame->uc.uc_mcontext, &frame->fpstate,
515 regs, set->sig[0]);
516 err |= __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set));
518 /* Set up to return from userspace. If provided, use a stub
519 already in userspace. */
520 if (ka->sa.sa_flags & SA_RESTORER) {
521 err |= __put_user(ka->sa.sa_restorer, &frame->pretcode);
522 } else {
523 err |= __put_user(frame->retcode, &frame->pretcode);
524 /* This is movl $,%eax ; int $0x80 */
525 err |= __put_user(0xb8, (char *)(frame->retcode+0));
526 err |= __put_user(__NR_rt_sigreturn, (int *)(frame->retcode+1));
527 err |= __put_user(0x80cd, (short *)(frame->retcode+5));
530 if (err)
531 goto give_sigsegv;
533 /* Set up registers for signal handler */
534 regs->esp = (unsigned long) frame;
535 regs->eip = (unsigned long) ka->sa.sa_handler;
537 unsigned long seg = __USER_DS;
538 __asm__("movl %w0,%%fs ; movl %w0,%%gs": "=r"(seg) : "0"(seg));
539 set_fs(USER_DS);
540 regs->xds = seg;
541 regs->xes = seg;
542 regs->xss = seg;
543 regs->xcs = __USER_CS;
545 regs->eflags &= ~TF_MASK;
547 #if DEBUG_SIG
548 printk("SIG deliver (%s:%d): sp=%p pc=%p ra=%p\n",
549 current->comm, current->pid, frame, regs->eip, frame->pretcode);
550 #endif
552 return;
554 give_sigsegv:
555 if (sig == SIGSEGV)
556 ka->sa.sa_handler = SIG_DFL;
557 force_sig(SIGSEGV, current);
561 * OK, we're invoking a handler
564 static void
565 handle_signal(unsigned long sig, struct k_sigaction *ka,
566 siginfo_t *info, sigset_t *oldset, struct pt_regs * regs)
568 /* Are we from a system call? */
569 if (regs->orig_eax >= 0) {
570 /* If so, check system call restarting.. */
571 switch (regs->eax) {
572 case -ERESTARTNOHAND:
573 regs->eax = -EINTR;
574 break;
576 case -ERESTARTSYS:
577 if (!(ka->sa.sa_flags & SA_RESTART)) {
578 regs->eax = -EINTR;
579 break;
581 /* fallthrough */
582 case -ERESTARTNOINTR:
583 regs->eax = regs->orig_eax;
584 regs->eip -= 2;
588 /* Set up the stack frame */
589 if (ka->sa.sa_flags & SA_SIGINFO)
590 setup_rt_frame(sig, ka, info, oldset, regs);
591 else
592 setup_frame(sig, ka, oldset, regs);
594 if (ka->sa.sa_flags & SA_ONESHOT)
595 ka->sa.sa_handler = SIG_DFL;
597 if (!(ka->sa.sa_flags & SA_NODEFER)) {
598 spin_lock_irq(&current->sigmask_lock);
599 sigorsets(&current->blocked,&current->blocked,&ka->sa.sa_mask);
600 sigaddset(&current->blocked,sig);
601 recalc_sigpending(current);
602 spin_unlock_irq(&current->sigmask_lock);
607 * Note that 'init' is a special process: it doesn't get signals it doesn't
608 * want to handle. Thus you cannot kill init even with a SIGKILL even by
609 * mistake.
611 * Note that we go through the signals twice: once to check the signals that
612 * the kernel can handle, and then we build all the user-level signal handling
613 * stack-frames in one go after that.
615 asmlinkage int do_signal(sigset_t *oldset, struct pt_regs *regs)
617 siginfo_t info;
618 struct k_sigaction *ka;
621 * We want the common case to go fast, which
622 * is why we may in certain cases get here from
623 * kernel mode. Just return without doing anything
624 * if so.
626 if ((regs->xcs & 3) != 3)
627 return 1;
629 if (!oldset)
630 oldset = &current->blocked;
632 for (;;) {
633 unsigned long signr;
635 spin_lock_irq(&current->sigmask_lock);
636 signr = dequeue_signal(&current->blocked, &info);
637 spin_unlock_irq(&current->sigmask_lock);
639 if (!signr)
640 break;
642 if ((current->flags & PF_PTRACED) && signr != SIGKILL) {
643 /* Let the debugger run. */
644 current->exit_code = signr;
645 current->state = TASK_STOPPED;
646 notify_parent(current, SIGCHLD);
647 schedule();
649 /* We're back. Did the debugger cancel the sig? */
650 if (!(signr = current->exit_code))
651 continue;
652 current->exit_code = 0;
654 /* The debugger continued. Ignore SIGSTOP. */
655 if (signr == SIGSTOP)
656 continue;
658 /* Update the siginfo structure. Is this good? */
659 if (signr != info.si_signo) {
660 info.si_signo = signr;
661 info.si_errno = 0;
662 info.si_code = SI_USER;
663 info.si_pid = current->p_pptr->pid;
664 info.si_uid = current->p_pptr->uid;
667 /* If the (new) signal is now blocked, requeue it. */
668 if (sigismember(&current->blocked, signr)) {
669 send_sig_info(signr, &info, current);
670 continue;
674 ka = &current->sig->action[signr-1];
675 if (ka->sa.sa_handler == SIG_IGN) {
676 if (signr != SIGCHLD)
677 continue;
678 /* Check for SIGCHLD: it's special. */
679 while (sys_wait4(-1, NULL, WNOHANG, NULL) > 0)
680 /* nothing */;
681 continue;
684 if (ka->sa.sa_handler == SIG_DFL) {
685 int exit_code = signr;
687 /* Init gets no signals it doesn't want. */
688 if (current->pid == 1)
689 continue;
691 switch (signr) {
692 case SIGCONT: case SIGCHLD: case SIGWINCH:
693 continue;
695 case SIGTSTP: case SIGTTIN: case SIGTTOU:
696 if (is_orphaned_pgrp(current->pgrp))
697 continue;
698 /* FALLTHRU */
700 case SIGSTOP:
701 current->state = TASK_STOPPED;
702 current->exit_code = signr;
703 if (!(current->p_pptr->sig->action[SIGCHLD-1].sa.sa_flags & SA_NOCLDSTOP))
704 notify_parent(current, SIGCHLD);
705 schedule();
706 continue;
708 case SIGQUIT: case SIGILL: case SIGTRAP:
709 case SIGABRT: case SIGFPE: case SIGSEGV:
710 lock_kernel();
711 if (current->binfmt
712 && current->binfmt->core_dump
713 && current->binfmt->core_dump(signr, regs))
714 exit_code |= 0x80;
715 unlock_kernel();
716 /* FALLTHRU */
718 default:
719 lock_kernel();
720 sigaddset(&current->signal, signr);
721 current->flags |= PF_SIGNALED;
722 do_exit(exit_code);
723 /* NOTREACHED */
727 /* Whee! Actually deliver the signal. */
728 handle_signal(signr, ka, &info, oldset, regs);
729 return 1;
732 /* Did we come from a system call? */
733 if (regs->orig_eax >= 0) {
734 /* Restart the system call - no handlers present */
735 if (regs->eax == -ERESTARTNOHAND ||
736 regs->eax == -ERESTARTSYS ||
737 regs->eax == -ERESTARTNOINTR) {
738 regs->eax = regs->orig_eax;
739 regs->eip -= 2;
742 return 0;