signal_64.c 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595
  1. /*
  2. * linux/arch/ppc64/kernel/signal.c
  3. *
  4. * PowerPC version
  5. * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
  6. *
  7. * Derived from "arch/i386/kernel/signal.c"
  8. * Copyright (C) 1991, 1992 Linus Torvalds
  9. * 1997-11-28 Modified for POSIX.1b signals by Richard Henderson
  10. *
  11. * This program is free software; you can redistribute it and/or
  12. * modify it under the terms of the GNU General Public License
  13. * as published by the Free Software Foundation; either version
  14. * 2 of the License, or (at your option) any later version.
  15. */
  16. #include <linux/config.h>
  17. #include <linux/sched.h>
  18. #include <linux/mm.h>
  19. #include <linux/smp.h>
  20. #include <linux/smp_lock.h>
  21. #include <linux/kernel.h>
  22. #include <linux/signal.h>
  23. #include <linux/errno.h>
  24. #include <linux/wait.h>
  25. #include <linux/unistd.h>
  26. #include <linux/stddef.h>
  27. #include <linux/elf.h>
  28. #include <linux/ptrace.h>
  29. #include <linux/module.h>
  30. #include <asm/sigcontext.h>
  31. #include <asm/ucontext.h>
  32. #include <asm/uaccess.h>
  33. #include <asm/pgtable.h>
  34. #include <asm/unistd.h>
  35. #include <asm/cacheflush.h>
  36. #include <asm/vdso.h>
  37. #define DEBUG_SIG 0
  38. #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP)))
  39. #define GP_REGS_SIZE min(sizeof(elf_gregset_t), sizeof(struct pt_regs))
  40. #define FP_REGS_SIZE sizeof(elf_fpregset_t)
  41. #define TRAMP_TRACEBACK 3
  42. #define TRAMP_SIZE 6
  43. /*
  44. * When we have signals to deliver, we set up on the user stack,
  45. * going down from the original stack pointer:
  46. * 1) a rt_sigframe struct which contains the ucontext
  47. * 2) a gap of __SIGNAL_FRAMESIZE bytes which acts as a dummy caller
  48. * frame for the signal handler.
  49. */
  50. struct rt_sigframe {
  51. /* sys_rt_sigreturn requires the ucontext be the first field */
  52. struct ucontext uc;
  53. unsigned long _unused[2];
  54. unsigned int tramp[TRAMP_SIZE];
  55. struct siginfo *pinfo;
  56. void *puc;
  57. struct siginfo info;
  58. /* 64 bit ABI allows for 288 bytes below sp before decrementing it. */
  59. char abigap[288];
  60. } __attribute__ ((aligned (16)));
  61. /*
  62. * Atomically swap in the new signal mask, and wait for a signal.
  63. */
  64. long sys_rt_sigsuspend(sigset_t __user *unewset, size_t sigsetsize, int p3, int p4,
  65. int p6, int p7, struct pt_regs *regs)
  66. {
  67. sigset_t saveset, newset;
  68. /* XXX: Don't preclude handling different sized sigset_t's. */
  69. if (sigsetsize != sizeof(sigset_t))
  70. return -EINVAL;
  71. if (copy_from_user(&newset, unewset, sizeof(newset)))
  72. return -EFAULT;
  73. sigdelsetmask(&newset, ~_BLOCKABLE);
  74. spin_lock_irq(&current->sighand->siglock);
  75. saveset = current->blocked;
  76. current->blocked = newset;
  77. recalc_sigpending();
  78. spin_unlock_irq(&current->sighand->siglock);
  79. regs->result = -EINTR;
  80. regs->gpr[3] = EINTR;
  81. regs->ccr |= 0x10000000;
  82. while (1) {
  83. current->state = TASK_INTERRUPTIBLE;
  84. schedule();
  85. if (do_signal(&saveset, regs)) {
  86. set_thread_flag(TIF_RESTOREALL);
  87. return 0;
  88. }
  89. }
  90. }
  91. long sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss, unsigned long r5,
  92. unsigned long r6, unsigned long r7, unsigned long r8,
  93. struct pt_regs *regs)
  94. {
  95. return do_sigaltstack(uss, uoss, regs->gpr[1]);
  96. }
  97. /*
  98. * Set up the sigcontext for the signal frame.
  99. */
  100. static long setup_sigcontext(struct sigcontext __user *sc, struct pt_regs *regs,
  101. int signr, sigset_t *set, unsigned long handler)
  102. {
  103. /* When CONFIG_ALTIVEC is set, we _always_ setup v_regs even if the
  104. * process never used altivec yet (MSR_VEC is zero in pt_regs of
  105. * the context). This is very important because we must ensure we
  106. * don't lose the VRSAVE content that may have been set prior to
  107. * the process doing its first vector operation
  108. * Userland shall check AT_HWCAP to know wether it can rely on the
  109. * v_regs pointer or not
  110. */
  111. #ifdef CONFIG_ALTIVEC
  112. elf_vrreg_t __user *v_regs = (elf_vrreg_t __user *)(((unsigned long)sc->vmx_reserve + 15) & ~0xful);
  113. #endif
  114. long err = 0;
  115. flush_fp_to_thread(current);
  116. #ifdef CONFIG_ALTIVEC
  117. err |= __put_user(v_regs, &sc->v_regs);
  118. /* save altivec registers */
  119. if (current->thread.used_vr) {
  120. flush_altivec_to_thread(current);
  121. /* Copy 33 vec registers (vr0..31 and vscr) to the stack */
  122. err |= __copy_to_user(v_regs, current->thread.vr, 33 * sizeof(vector128));
  123. /* set MSR_VEC in the MSR value in the frame to indicate that sc->v_reg)
  124. * contains valid data.
  125. */
  126. regs->msr |= MSR_VEC;
  127. }
  128. /* We always copy to/from vrsave, it's 0 if we don't have or don't
  129. * use altivec.
  130. */
  131. err |= __put_user(current->thread.vrsave, (u32 __user *)&v_regs[33]);
  132. #else /* CONFIG_ALTIVEC */
  133. err |= __put_user(0, &sc->v_regs);
  134. #endif /* CONFIG_ALTIVEC */
  135. err |= __put_user(&sc->gp_regs, &sc->regs);
  136. if (!FULL_REGS(regs)) {
  137. /* Zero out the unsaved GPRs to avoid information
  138. leak, and set TIF_SAVE_NVGPRS to ensure that the
  139. registers do actually get saved later. */
  140. memset(&regs->gpr[14], 0, 18 * sizeof(unsigned long));
  141. set_thread_flag(TIF_SAVE_NVGPRS);
  142. current_thread_info()->nvgprs_frame = &sc->gp_regs;
  143. }
  144. err |= __copy_to_user(&sc->gp_regs, regs, GP_REGS_SIZE);
  145. err |= __copy_to_user(&sc->fp_regs, &current->thread.fpr, FP_REGS_SIZE);
  146. err |= __put_user(signr, &sc->signal);
  147. err |= __put_user(handler, &sc->handler);
  148. if (set != NULL)
  149. err |= __put_user(set->sig[0], &sc->oldmask);
  150. return err;
  151. }
  152. /*
  153. * Restore the sigcontext from the signal frame.
  154. */
  155. static long restore_sigcontext(struct pt_regs *regs, sigset_t *set, int sig,
  156. struct sigcontext __user *sc)
  157. {
  158. #ifdef CONFIG_ALTIVEC
  159. elf_vrreg_t __user *v_regs;
  160. #endif
  161. unsigned long err = 0;
  162. unsigned long save_r13 = 0;
  163. elf_greg_t *gregs = (elf_greg_t *)regs;
  164. #ifdef CONFIG_ALTIVEC
  165. unsigned long msr;
  166. #endif
  167. int i;
  168. /* If this is not a signal return, we preserve the TLS in r13 */
  169. if (!sig)
  170. save_r13 = regs->gpr[13];
  171. /* copy everything before MSR */
  172. err |= __copy_from_user(regs, &sc->gp_regs,
  173. PT_MSR*sizeof(unsigned long));
  174. /* skip MSR and SOFTE */
  175. for (i = PT_MSR+1; i <= PT_RESULT; i++) {
  176. if (i == PT_SOFTE)
  177. continue;
  178. err |= __get_user(gregs[i], &sc->gp_regs[i]);
  179. }
  180. if (!sig)
  181. regs->gpr[13] = save_r13;
  182. if (set != NULL)
  183. err |= __get_user(set->sig[0], &sc->oldmask);
  184. /*
  185. * Do this before updating the thread state in
  186. * current->thread.fpr/vr. That way, if we get preempted
  187. * and another task grabs the FPU/Altivec, it won't be
  188. * tempted to save the current CPU state into the thread_struct
  189. * and corrupt what we are writing there.
  190. */
  191. discard_lazy_cpu_state();
  192. err |= __copy_from_user(&current->thread.fpr, &sc->fp_regs, FP_REGS_SIZE);
  193. #ifdef CONFIG_ALTIVEC
  194. err |= __get_user(v_regs, &sc->v_regs);
  195. err |= __get_user(msr, &sc->gp_regs[PT_MSR]);
  196. if (err)
  197. return err;
  198. /* Copy 33 vec registers (vr0..31 and vscr) from the stack */
  199. if (v_regs != 0 && (msr & MSR_VEC) != 0)
  200. err |= __copy_from_user(current->thread.vr, v_regs,
  201. 33 * sizeof(vector128));
  202. else if (current->thread.used_vr)
  203. memset(current->thread.vr, 0, 33 * sizeof(vector128));
  204. /* Always get VRSAVE back */
  205. if (v_regs != 0)
  206. err |= __get_user(current->thread.vrsave, (u32 __user *)&v_regs[33]);
  207. else
  208. current->thread.vrsave = 0;
  209. #endif /* CONFIG_ALTIVEC */
  210. /* Force reload of FP/VEC */
  211. regs->msr &= ~(MSR_FP | MSR_FE0 | MSR_FE1 | MSR_VEC);
  212. return err;
  213. }
  214. /*
  215. * Allocate space for the signal frame
  216. */
  217. static inline void __user * get_sigframe(struct k_sigaction *ka, struct pt_regs *regs,
  218. size_t frame_size)
  219. {
  220. unsigned long newsp;
  221. /* Default to using normal stack */
  222. newsp = regs->gpr[1];
  223. if (ka->sa.sa_flags & SA_ONSTACK) {
  224. if (! on_sig_stack(regs->gpr[1]))
  225. newsp = (current->sas_ss_sp + current->sas_ss_size);
  226. }
  227. return (void __user *)((newsp - frame_size) & -16ul);
  228. }
  229. /*
  230. * Setup the trampoline code on the stack
  231. */
  232. static long setup_trampoline(unsigned int syscall, unsigned int __user *tramp)
  233. {
  234. int i;
  235. long err = 0;
  236. /* addi r1, r1, __SIGNAL_FRAMESIZE # Pop the dummy stackframe */
  237. err |= __put_user(0x38210000UL | (__SIGNAL_FRAMESIZE & 0xffff), &tramp[0]);
  238. /* li r0, __NR_[rt_]sigreturn| */
  239. err |= __put_user(0x38000000UL | (syscall & 0xffff), &tramp[1]);
  240. /* sc */
  241. err |= __put_user(0x44000002UL, &tramp[2]);
  242. /* Minimal traceback info */
  243. for (i=TRAMP_TRACEBACK; i < TRAMP_SIZE ;i++)
  244. err |= __put_user(0, &tramp[i]);
  245. if (!err)
  246. flush_icache_range((unsigned long) &tramp[0],
  247. (unsigned long) &tramp[TRAMP_SIZE]);
  248. return err;
  249. }
  250. /*
  251. * Restore the user process's signal mask (also used by signal32.c)
  252. */
  253. void restore_sigmask(sigset_t *set)
  254. {
  255. sigdelsetmask(set, ~_BLOCKABLE);
  256. spin_lock_irq(&current->sighand->siglock);
  257. current->blocked = *set;
  258. recalc_sigpending();
  259. spin_unlock_irq(&current->sighand->siglock);
  260. }
  261. /*
  262. * Handle {get,set,swap}_context operations
  263. */
  264. int sys_swapcontext(struct ucontext __user *old_ctx,
  265. struct ucontext __user *new_ctx,
  266. long ctx_size, long r6, long r7, long r8, struct pt_regs *regs)
  267. {
  268. unsigned char tmp;
  269. sigset_t set;
  270. /* Context size is for future use. Right now, we only make sure
  271. * we are passed something we understand
  272. */
  273. if (ctx_size < sizeof(struct ucontext))
  274. return -EINVAL;
  275. if (old_ctx != NULL) {
  276. if (!access_ok(VERIFY_WRITE, old_ctx, sizeof(*old_ctx))
  277. || setup_sigcontext(&old_ctx->uc_mcontext, regs, 0, NULL, 0)
  278. || __copy_to_user(&old_ctx->uc_sigmask,
  279. &current->blocked, sizeof(sigset_t)))
  280. return -EFAULT;
  281. }
  282. if (new_ctx == NULL)
  283. return 0;
  284. if (!access_ok(VERIFY_READ, new_ctx, sizeof(*new_ctx))
  285. || __get_user(tmp, (u8 __user *) new_ctx)
  286. || __get_user(tmp, (u8 __user *) (new_ctx + 1) - 1))
  287. return -EFAULT;
  288. /*
  289. * If we get a fault copying the context into the kernel's
  290. * image of the user's registers, we can't just return -EFAULT
  291. * because the user's registers will be corrupted. For instance
  292. * the NIP value may have been updated but not some of the
  293. * other registers. Given that we have done the access_ok
  294. * and successfully read the first and last bytes of the region
  295. * above, this should only happen in an out-of-memory situation
  296. * or if another thread unmaps the region containing the context.
  297. * We kill the task with a SIGSEGV in this situation.
  298. */
  299. if (__copy_from_user(&set, &new_ctx->uc_sigmask, sizeof(set)))
  300. do_exit(SIGSEGV);
  301. restore_sigmask(&set);
  302. if (restore_sigcontext(regs, NULL, 0, &new_ctx->uc_mcontext))
  303. do_exit(SIGSEGV);
  304. /* This returns like rt_sigreturn */
  305. set_thread_flag(TIF_RESTOREALL);
  306. return 0;
  307. }
  308. /*
  309. * Do a signal return; undo the signal stack.
  310. */
  311. int sys_rt_sigreturn(unsigned long r3, unsigned long r4, unsigned long r5,
  312. unsigned long r6, unsigned long r7, unsigned long r8,
  313. struct pt_regs *regs)
  314. {
  315. struct ucontext __user *uc = (struct ucontext __user *)regs->gpr[1];
  316. sigset_t set;
  317. /* Always make any pending restarted system calls return -EINTR */
  318. current_thread_info()->restart_block.fn = do_no_restart_syscall;
  319. if (!access_ok(VERIFY_READ, uc, sizeof(*uc)))
  320. goto badframe;
  321. if (__copy_from_user(&set, &uc->uc_sigmask, sizeof(set)))
  322. goto badframe;
  323. restore_sigmask(&set);
  324. if (restore_sigcontext(regs, NULL, 1, &uc->uc_mcontext))
  325. goto badframe;
  326. /* do_sigaltstack expects a __user pointer and won't modify
  327. * what's in there anyway
  328. */
  329. do_sigaltstack(&uc->uc_stack, NULL, regs->gpr[1]);
  330. set_thread_flag(TIF_RESTOREALL);
  331. return 0;
  332. badframe:
  333. #if DEBUG_SIG
  334. printk("badframe in sys_rt_sigreturn, regs=%p uc=%p &uc->uc_mcontext=%p\n",
  335. regs, uc, &uc->uc_mcontext);
  336. #endif
  337. force_sig(SIGSEGV, current);
  338. return 0;
  339. }
  340. static int setup_rt_frame(int signr, struct k_sigaction *ka, siginfo_t *info,
  341. sigset_t *set, struct pt_regs *regs)
  342. {
  343. /* Handler is *really* a pointer to the function descriptor for
  344. * the signal routine. The first entry in the function
  345. * descriptor is the entry address of signal and the second
  346. * entry is the TOC value we need to use.
  347. */
  348. func_descr_t __user *funct_desc_ptr;
  349. struct rt_sigframe __user *frame;
  350. unsigned long newsp = 0;
  351. long err = 0;
  352. frame = get_sigframe(ka, regs, sizeof(*frame));
  353. if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame)))
  354. goto badframe;
  355. err |= __put_user(&frame->info, &frame->pinfo);
  356. err |= __put_user(&frame->uc, &frame->puc);
  357. err |= copy_siginfo_to_user(&frame->info, info);
  358. if (err)
  359. goto badframe;
  360. /* Create the ucontext. */
  361. err |= __put_user(0, &frame->uc.uc_flags);
  362. err |= __put_user(0, &frame->uc.uc_link);
  363. err |= __put_user(current->sas_ss_sp, &frame->uc.uc_stack.ss_sp);
  364. err |= __put_user(sas_ss_flags(regs->gpr[1]),
  365. &frame->uc.uc_stack.ss_flags);
  366. err |= __put_user(current->sas_ss_size, &frame->uc.uc_stack.ss_size);
  367. err |= setup_sigcontext(&frame->uc.uc_mcontext, regs, signr, NULL,
  368. (unsigned long)ka->sa.sa_handler);
  369. err |= __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set));
  370. if (err)
  371. goto badframe;
  372. /* Make sure signal handler doesn't get spurious FP exceptions */
  373. current->thread.fpscr.val = 0;
  374. /* Set up to return from userspace. */
  375. if (vdso64_rt_sigtramp && current->thread.vdso_base) {
  376. regs->link = current->thread.vdso_base + vdso64_rt_sigtramp;
  377. } else {
  378. err |= setup_trampoline(__NR_rt_sigreturn, &frame->tramp[0]);
  379. if (err)
  380. goto badframe;
  381. regs->link = (unsigned long) &frame->tramp[0];
  382. }
  383. funct_desc_ptr = (func_descr_t __user *) ka->sa.sa_handler;
  384. /* Allocate a dummy caller frame for the signal handler. */
  385. newsp = (unsigned long)frame - __SIGNAL_FRAMESIZE;
  386. err |= put_user(regs->gpr[1], (unsigned long __user *)newsp);
  387. /* Set up "regs" so we "return" to the signal handler. */
  388. err |= get_user(regs->nip, &funct_desc_ptr->entry);
  389. regs->gpr[1] = newsp;
  390. err |= get_user(regs->gpr[2], &funct_desc_ptr->toc);
  391. regs->gpr[3] = signr;
  392. regs->result = 0;
  393. if (ka->sa.sa_flags & SA_SIGINFO) {
  394. err |= get_user(regs->gpr[4], (unsigned long __user *)&frame->pinfo);
  395. err |= get_user(regs->gpr[5], (unsigned long __user *)&frame->puc);
  396. regs->gpr[6] = (unsigned long) frame;
  397. } else {
  398. regs->gpr[4] = (unsigned long)&frame->uc.uc_mcontext;
  399. }
  400. if (err)
  401. goto badframe;
  402. return 1;
  403. badframe:
  404. #if DEBUG_SIG
  405. printk("badframe in setup_rt_frame, regs=%p frame=%p newsp=%lx\n",
  406. regs, frame, newsp);
  407. #endif
  408. force_sigsegv(signr, current);
  409. return 0;
  410. }
  411. /*
  412. * OK, we're invoking a handler
  413. */
  414. static int handle_signal(unsigned long sig, struct k_sigaction *ka,
  415. siginfo_t *info, sigset_t *oldset, struct pt_regs *regs)
  416. {
  417. int ret;
  418. /* Set up Signal Frame */
  419. ret = setup_rt_frame(sig, ka, info, oldset, regs);
  420. if (ret) {
  421. spin_lock_irq(&current->sighand->siglock);
  422. sigorsets(&current->blocked, &current->blocked, &ka->sa.sa_mask);
  423. if (!(ka->sa.sa_flags & SA_NODEFER))
  424. sigaddset(&current->blocked,sig);
  425. recalc_sigpending();
  426. spin_unlock_irq(&current->sighand->siglock);
  427. }
  428. return ret;
  429. }
  430. static inline void syscall_restart(struct pt_regs *regs, struct k_sigaction *ka)
  431. {
  432. switch ((int)regs->result) {
  433. case -ERESTART_RESTARTBLOCK:
  434. case -ERESTARTNOHAND:
  435. /* ERESTARTNOHAND means that the syscall should only be
  436. * restarted if there was no handler for the signal, and since
  437. * we only get here if there is a handler, we dont restart.
  438. */
  439. regs->result = -EINTR;
  440. regs->gpr[3] = EINTR;
  441. regs->ccr |= 0x10000000;
  442. break;
  443. case -ERESTARTSYS:
  444. /* ERESTARTSYS means to restart the syscall if there is no
  445. * handler or the handler was registered with SA_RESTART
  446. */
  447. if (!(ka->sa.sa_flags & SA_RESTART)) {
  448. regs->result = -EINTR;
  449. regs->gpr[3] = EINTR;
  450. regs->ccr |= 0x10000000;
  451. break;
  452. }
  453. /* fallthrough */
  454. case -ERESTARTNOINTR:
  455. /* ERESTARTNOINTR means that the syscall should be
  456. * called again after the signal handler returns.
  457. */
  458. regs->gpr[3] = regs->orig_gpr3;
  459. regs->nip -= 4;
  460. regs->result = 0;
  461. break;
  462. }
  463. }
  464. /*
  465. * Note that 'init' is a special process: it doesn't get signals it doesn't
  466. * want to handle. Thus you cannot kill init even with a SIGKILL even by
  467. * mistake.
  468. */
  469. int do_signal(sigset_t *oldset, struct pt_regs *regs)
  470. {
  471. siginfo_t info;
  472. int signr;
  473. struct k_sigaction ka;
  474. /*
  475. * If the current thread is 32 bit - invoke the
  476. * 32 bit signal handling code
  477. */
  478. if (test_thread_flag(TIF_32BIT))
  479. return do_signal32(oldset, regs);
  480. if (!oldset)
  481. oldset = &current->blocked;
  482. signr = get_signal_to_deliver(&info, &ka, regs, NULL);
  483. if (signr > 0) {
  484. /* Whee! Actually deliver the signal. */
  485. if (TRAP(regs) == 0x0C00)
  486. syscall_restart(regs, &ka);
  487. /*
  488. * Reenable the DABR before delivering the signal to
  489. * user space. The DABR will have been cleared if it
  490. * triggered inside the kernel.
  491. */
  492. if (current->thread.dabr)
  493. set_dabr(current->thread.dabr);
  494. return handle_signal(signr, &ka, &info, oldset, regs);
  495. }
  496. if (TRAP(regs) == 0x0C00) { /* System Call! */
  497. if ((int)regs->result == -ERESTARTNOHAND ||
  498. (int)regs->result == -ERESTARTSYS ||
  499. (int)regs->result == -ERESTARTNOINTR) {
  500. regs->gpr[3] = regs->orig_gpr3;
  501. regs->nip -= 4; /* Back up & retry system call */
  502. regs->result = 0;
  503. } else if ((int)regs->result == -ERESTART_RESTARTBLOCK) {
  504. regs->gpr[0] = __NR_restart_syscall;
  505. regs->nip -= 4;
  506. regs->result = 0;
  507. }
  508. }
  509. return 0;
  510. }
  511. EXPORT_SYMBOL(do_signal);