signal.c 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521
  1. /*
  2. * Architecture-specific signal handling support.
  3. *
  4. * Copyright (C) 1999-2004 Hewlett-Packard Co
  5. * David Mosberger-Tang <davidm@hpl.hp.com>
  6. *
  7. * Derived from i386 and Alpha versions.
  8. */
  9. #include <linux/errno.h>
  10. #include <linux/kernel.h>
  11. #include <linux/mm.h>
  12. #include <linux/ptrace.h>
  13. #include <linux/tracehook.h>
  14. #include <linux/sched.h>
  15. #include <linux/signal.h>
  16. #include <linux/smp.h>
  17. #include <linux/stddef.h>
  18. #include <linux/tty.h>
  19. #include <linux/binfmts.h>
  20. #include <linux/unistd.h>
  21. #include <linux/wait.h>
  22. #include <asm/intrinsics.h>
  23. #include <asm/uaccess.h>
  24. #include <asm/rse.h>
  25. #include <asm/sigcontext.h>
  26. #include "sigframe.h"
  27. #define DEBUG_SIG 0
  28. #define STACK_ALIGN 16 /* minimal alignment for stack pointer */
  29. #if _NSIG_WORDS > 1
  30. # define PUT_SIGSET(k,u) __copy_to_user((u)->sig, (k)->sig, sizeof(sigset_t))
  31. # define GET_SIGSET(k,u) __copy_from_user((k)->sig, (u)->sig, sizeof(sigset_t))
  32. #else
  33. # define PUT_SIGSET(k,u) __put_user((k)->sig[0], &(u)->sig[0])
  34. # define GET_SIGSET(k,u) __get_user((k)->sig[0], &(u)->sig[0])
  35. #endif
  36. asmlinkage long
  37. sys_sigaltstack (const stack_t __user *uss, stack_t __user *uoss, long arg2,
  38. long arg3, long arg4, long arg5, long arg6, long arg7,
  39. struct pt_regs regs)
  40. {
  41. return do_sigaltstack(uss, uoss, regs.r12);
  42. }
  43. static long
  44. restore_sigcontext (struct sigcontext __user *sc, struct sigscratch *scr)
  45. {
  46. unsigned long ip, flags, nat, um, cfm, rsc;
  47. long err;
  48. /* Always make any pending restarted system calls return -EINTR */
  49. current_thread_info()->restart_block.fn = do_no_restart_syscall;
  50. /* restore scratch that always needs gets updated during signal delivery: */
  51. err = __get_user(flags, &sc->sc_flags);
  52. err |= __get_user(nat, &sc->sc_nat);
  53. err |= __get_user(ip, &sc->sc_ip); /* instruction pointer */
  54. err |= __get_user(cfm, &sc->sc_cfm);
  55. err |= __get_user(um, &sc->sc_um); /* user mask */
  56. err |= __get_user(rsc, &sc->sc_ar_rsc);
  57. err |= __get_user(scr->pt.ar_unat, &sc->sc_ar_unat);
  58. err |= __get_user(scr->pt.ar_fpsr, &sc->sc_ar_fpsr);
  59. err |= __get_user(scr->pt.ar_pfs, &sc->sc_ar_pfs);
  60. err |= __get_user(scr->pt.pr, &sc->sc_pr); /* predicates */
  61. err |= __get_user(scr->pt.b0, &sc->sc_br[0]); /* b0 (rp) */
  62. err |= __get_user(scr->pt.b6, &sc->sc_br[6]); /* b6 */
  63. err |= __copy_from_user(&scr->pt.r1, &sc->sc_gr[1], 8); /* r1 */
  64. err |= __copy_from_user(&scr->pt.r8, &sc->sc_gr[8], 4*8); /* r8-r11 */
  65. err |= __copy_from_user(&scr->pt.r12, &sc->sc_gr[12], 2*8); /* r12-r13 */
  66. err |= __copy_from_user(&scr->pt.r15, &sc->sc_gr[15], 8); /* r15 */
  67. scr->pt.cr_ifs = cfm | (1UL << 63);
  68. scr->pt.ar_rsc = rsc | (3 << 2); /* force PL3 */
  69. /* establish new instruction pointer: */
  70. scr->pt.cr_iip = ip & ~0x3UL;
  71. ia64_psr(&scr->pt)->ri = ip & 0x3;
  72. scr->pt.cr_ipsr = (scr->pt.cr_ipsr & ~IA64_PSR_UM) | (um & IA64_PSR_UM);
  73. scr->scratch_unat = ia64_put_scratch_nat_bits(&scr->pt, nat);
  74. if (!(flags & IA64_SC_FLAG_IN_SYSCALL)) {
  75. /* Restore most scratch-state only when not in syscall. */
  76. err |= __get_user(scr->pt.ar_ccv, &sc->sc_ar_ccv); /* ar.ccv */
  77. err |= __get_user(scr->pt.b7, &sc->sc_br[7]); /* b7 */
  78. err |= __get_user(scr->pt.r14, &sc->sc_gr[14]); /* r14 */
  79. err |= __copy_from_user(&scr->pt.ar_csd, &sc->sc_ar25, 2*8); /* ar.csd & ar.ssd */
  80. err |= __copy_from_user(&scr->pt.r2, &sc->sc_gr[2], 2*8); /* r2-r3 */
  81. err |= __copy_from_user(&scr->pt.r16, &sc->sc_gr[16], 16*8); /* r16-r31 */
  82. }
  83. if ((flags & IA64_SC_FLAG_FPH_VALID) != 0) {
  84. struct ia64_psr *psr = ia64_psr(&scr->pt);
  85. err |= __copy_from_user(current->thread.fph, &sc->sc_fr[32], 96*16);
  86. psr->mfh = 0; /* drop signal handler's fph contents... */
  87. preempt_disable();
  88. if (psr->dfh)
  89. ia64_drop_fpu(current);
  90. else {
  91. /* We already own the local fph, otherwise psr->dfh wouldn't be 0. */
  92. __ia64_load_fpu(current->thread.fph);
  93. ia64_set_local_fpu_owner(current);
  94. }
  95. preempt_enable();
  96. }
  97. return err;
  98. }
  99. int
  100. copy_siginfo_to_user (siginfo_t __user *to, siginfo_t *from)
  101. {
  102. if (!access_ok(VERIFY_WRITE, to, sizeof(siginfo_t)))
  103. return -EFAULT;
  104. if (from->si_code < 0) {
  105. if (__copy_to_user(to, from, sizeof(siginfo_t)))
  106. return -EFAULT;
  107. return 0;
  108. } else {
  109. int err;
  110. /*
  111. * If you change siginfo_t structure, please be sure this code is fixed
  112. * accordingly. It should never copy any pad contained in the structure
  113. * to avoid security leaks, but must copy the generic 3 ints plus the
  114. * relevant union member.
  115. */
  116. err = __put_user(from->si_signo, &to->si_signo);
  117. err |= __put_user(from->si_errno, &to->si_errno);
  118. err |= __put_user((short)from->si_code, &to->si_code);
  119. switch (from->si_code >> 16) {
  120. case __SI_FAULT >> 16:
  121. err |= __put_user(from->si_flags, &to->si_flags);
  122. err |= __put_user(from->si_isr, &to->si_isr);
  123. case __SI_POLL >> 16:
  124. err |= __put_user(from->si_addr, &to->si_addr);
  125. err |= __put_user(from->si_imm, &to->si_imm);
  126. break;
  127. case __SI_TIMER >> 16:
  128. err |= __put_user(from->si_tid, &to->si_tid);
  129. err |= __put_user(from->si_overrun, &to->si_overrun);
  130. err |= __put_user(from->si_ptr, &to->si_ptr);
  131. break;
  132. case __SI_RT >> 16: /* Not generated by the kernel as of now. */
  133. case __SI_MESGQ >> 16:
  134. err |= __put_user(from->si_uid, &to->si_uid);
  135. err |= __put_user(from->si_pid, &to->si_pid);
  136. err |= __put_user(from->si_ptr, &to->si_ptr);
  137. break;
  138. case __SI_CHLD >> 16:
  139. err |= __put_user(from->si_utime, &to->si_utime);
  140. err |= __put_user(from->si_stime, &to->si_stime);
  141. err |= __put_user(from->si_status, &to->si_status);
  142. default:
  143. err |= __put_user(from->si_uid, &to->si_uid);
  144. err |= __put_user(from->si_pid, &to->si_pid);
  145. break;
  146. }
  147. return err;
  148. }
  149. }
  150. long
  151. ia64_rt_sigreturn (struct sigscratch *scr)
  152. {
  153. extern char ia64_strace_leave_kernel, ia64_leave_kernel;
  154. struct sigcontext __user *sc;
  155. struct siginfo si;
  156. sigset_t set;
  157. long retval;
  158. sc = &((struct sigframe __user *) (scr->pt.r12 + 16))->sc;
  159. /*
  160. * When we return to the previously executing context, r8 and r10 have already
  161. * been setup the way we want them. Indeed, if the signal wasn't delivered while
  162. * in a system call, we must not touch r8 or r10 as otherwise user-level state
  163. * could be corrupted.
  164. */
  165. retval = (long) &ia64_leave_kernel;
  166. if (test_thread_flag(TIF_SYSCALL_TRACE)
  167. || test_thread_flag(TIF_SYSCALL_AUDIT))
  168. /*
  169. * strace expects to be notified after sigreturn returns even though the
  170. * context to which we return may not be in the middle of a syscall.
  171. * Thus, the return-value that strace displays for sigreturn is
  172. * meaningless.
  173. */
  174. retval = (long) &ia64_strace_leave_kernel;
  175. if (!access_ok(VERIFY_READ, sc, sizeof(*sc)))
  176. goto give_sigsegv;
  177. if (GET_SIGSET(&set, &sc->sc_mask))
  178. goto give_sigsegv;
  179. set_current_blocked(&set);
  180. if (restore_sigcontext(sc, scr))
  181. goto give_sigsegv;
  182. #if DEBUG_SIG
  183. printk("SIG return (%s:%d): sp=%lx ip=%lx\n",
  184. current->comm, current->pid, scr->pt.r12, scr->pt.cr_iip);
  185. #endif
  186. /*
  187. * It is more difficult to avoid calling this function than to
  188. * call it and ignore errors.
  189. */
  190. do_sigaltstack(&sc->sc_stack, NULL, scr->pt.r12);
  191. return retval;
  192. give_sigsegv:
  193. si.si_signo = SIGSEGV;
  194. si.si_errno = 0;
  195. si.si_code = SI_KERNEL;
  196. si.si_pid = task_pid_vnr(current);
  197. si.si_uid = current_uid();
  198. si.si_addr = sc;
  199. force_sig_info(SIGSEGV, &si, current);
  200. return retval;
  201. }
  202. /*
  203. * This does just the minimum required setup of sigcontext.
  204. * Specifically, it only installs data that is either not knowable at
  205. * the user-level or that gets modified before execution in the
  206. * trampoline starts. Everything else is done at the user-level.
  207. */
  208. static long
  209. setup_sigcontext (struct sigcontext __user *sc, sigset_t *mask, struct sigscratch *scr)
  210. {
  211. unsigned long flags = 0, ifs, cfm, nat;
  212. long err = 0;
  213. ifs = scr->pt.cr_ifs;
  214. if (on_sig_stack((unsigned long) sc))
  215. flags |= IA64_SC_FLAG_ONSTACK;
  216. if ((ifs & (1UL << 63)) == 0)
  217. /* if cr_ifs doesn't have the valid bit set, we got here through a syscall */
  218. flags |= IA64_SC_FLAG_IN_SYSCALL;
  219. cfm = ifs & ((1UL << 38) - 1);
  220. ia64_flush_fph(current);
  221. if ((current->thread.flags & IA64_THREAD_FPH_VALID)) {
  222. flags |= IA64_SC_FLAG_FPH_VALID;
  223. err = __copy_to_user(&sc->sc_fr[32], current->thread.fph, 96*16);
  224. }
  225. nat = ia64_get_scratch_nat_bits(&scr->pt, scr->scratch_unat);
  226. err |= __put_user(flags, &sc->sc_flags);
  227. err |= __put_user(nat, &sc->sc_nat);
  228. err |= PUT_SIGSET(mask, &sc->sc_mask);
  229. err |= __put_user(cfm, &sc->sc_cfm);
  230. err |= __put_user(scr->pt.cr_ipsr & IA64_PSR_UM, &sc->sc_um);
  231. err |= __put_user(scr->pt.ar_rsc, &sc->sc_ar_rsc);
  232. err |= __put_user(scr->pt.ar_unat, &sc->sc_ar_unat); /* ar.unat */
  233. err |= __put_user(scr->pt.ar_fpsr, &sc->sc_ar_fpsr); /* ar.fpsr */
  234. err |= __put_user(scr->pt.ar_pfs, &sc->sc_ar_pfs);
  235. err |= __put_user(scr->pt.pr, &sc->sc_pr); /* predicates */
  236. err |= __put_user(scr->pt.b0, &sc->sc_br[0]); /* b0 (rp) */
  237. err |= __put_user(scr->pt.b6, &sc->sc_br[6]); /* b6 */
  238. err |= __copy_to_user(&sc->sc_gr[1], &scr->pt.r1, 8); /* r1 */
  239. err |= __copy_to_user(&sc->sc_gr[8], &scr->pt.r8, 4*8); /* r8-r11 */
  240. err |= __copy_to_user(&sc->sc_gr[12], &scr->pt.r12, 2*8); /* r12-r13 */
  241. err |= __copy_to_user(&sc->sc_gr[15], &scr->pt.r15, 8); /* r15 */
  242. err |= __put_user(scr->pt.cr_iip + ia64_psr(&scr->pt)->ri, &sc->sc_ip);
  243. if (!(flags & IA64_SC_FLAG_IN_SYSCALL)) {
  244. /* Copy scratch regs to sigcontext if the signal didn't interrupt a syscall. */
  245. err |= __put_user(scr->pt.ar_ccv, &sc->sc_ar_ccv); /* ar.ccv */
  246. err |= __put_user(scr->pt.b7, &sc->sc_br[7]); /* b7 */
  247. err |= __put_user(scr->pt.r14, &sc->sc_gr[14]); /* r14 */
  248. err |= __copy_to_user(&sc->sc_ar25, &scr->pt.ar_csd, 2*8); /* ar.csd & ar.ssd */
  249. err |= __copy_to_user(&sc->sc_gr[2], &scr->pt.r2, 2*8); /* r2-r3 */
  250. err |= __copy_to_user(&sc->sc_gr[16], &scr->pt.r16, 16*8); /* r16-r31 */
  251. }
  252. return err;
  253. }
  254. /*
  255. * Check whether the register-backing store is already on the signal stack.
  256. */
  257. static inline int
  258. rbs_on_sig_stack (unsigned long bsp)
  259. {
  260. return (bsp - current->sas_ss_sp < current->sas_ss_size);
  261. }
  262. static long
  263. force_sigsegv_info (int sig, void __user *addr)
  264. {
  265. unsigned long flags;
  266. struct siginfo si;
  267. if (sig == SIGSEGV) {
  268. /*
  269. * Acquiring siglock around the sa_handler-update is almost
  270. * certainly overkill, but this isn't a
  271. * performance-critical path and I'd rather play it safe
  272. * here than having to debug a nasty race if and when
  273. * something changes in kernel/signal.c that would make it
  274. * no longer safe to modify sa_handler without holding the
  275. * lock.
  276. */
  277. spin_lock_irqsave(&current->sighand->siglock, flags);
  278. current->sighand->action[sig - 1].sa.sa_handler = SIG_DFL;
  279. spin_unlock_irqrestore(&current->sighand->siglock, flags);
  280. }
  281. si.si_signo = SIGSEGV;
  282. si.si_errno = 0;
  283. si.si_code = SI_KERNEL;
  284. si.si_pid = task_pid_vnr(current);
  285. si.si_uid = current_uid();
  286. si.si_addr = addr;
  287. force_sig_info(SIGSEGV, &si, current);
  288. return 0;
  289. }
  290. static long
  291. setup_frame (int sig, struct k_sigaction *ka, siginfo_t *info, sigset_t *set,
  292. struct sigscratch *scr)
  293. {
  294. extern char __kernel_sigtramp[];
  295. unsigned long tramp_addr, new_rbs = 0, new_sp;
  296. struct sigframe __user *frame;
  297. long err;
  298. new_sp = scr->pt.r12;
  299. tramp_addr = (unsigned long) __kernel_sigtramp;
  300. if (ka->sa.sa_flags & SA_ONSTACK) {
  301. int onstack = sas_ss_flags(new_sp);
  302. if (onstack == 0) {
  303. new_sp = current->sas_ss_sp + current->sas_ss_size;
  304. /*
  305. * We need to check for the register stack being on the
  306. * signal stack separately, because it's switched
  307. * separately (memory stack is switched in the kernel,
  308. * register stack is switched in the signal trampoline).
  309. */
  310. if (!rbs_on_sig_stack(scr->pt.ar_bspstore))
  311. new_rbs = ALIGN(current->sas_ss_sp,
  312. sizeof(long));
  313. } else if (onstack == SS_ONSTACK) {
  314. unsigned long check_sp;
  315. /*
  316. * If we are on the alternate signal stack and would
  317. * overflow it, don't. Return an always-bogus address
  318. * instead so we will die with SIGSEGV.
  319. */
  320. check_sp = (new_sp - sizeof(*frame)) & -STACK_ALIGN;
  321. if (!likely(on_sig_stack(check_sp)))
  322. return force_sigsegv_info(sig, (void __user *)
  323. check_sp);
  324. }
  325. }
  326. frame = (void __user *) ((new_sp - sizeof(*frame)) & -STACK_ALIGN);
  327. if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame)))
  328. return force_sigsegv_info(sig, frame);
  329. err = __put_user(sig, &frame->arg0);
  330. err |= __put_user(&frame->info, &frame->arg1);
  331. err |= __put_user(&frame->sc, &frame->arg2);
  332. err |= __put_user(new_rbs, &frame->sc.sc_rbs_base);
  333. err |= __put_user(0, &frame->sc.sc_loadrs); /* initialize to zero */
  334. err |= __put_user(ka->sa.sa_handler, &frame->handler);
  335. err |= copy_siginfo_to_user(&frame->info, info);
  336. err |= __put_user(current->sas_ss_sp, &frame->sc.sc_stack.ss_sp);
  337. err |= __put_user(current->sas_ss_size, &frame->sc.sc_stack.ss_size);
  338. err |= __put_user(sas_ss_flags(scr->pt.r12), &frame->sc.sc_stack.ss_flags);
  339. err |= setup_sigcontext(&frame->sc, set, scr);
  340. if (unlikely(err))
  341. return force_sigsegv_info(sig, frame);
  342. scr->pt.r12 = (unsigned long) frame - 16; /* new stack pointer */
  343. scr->pt.ar_fpsr = FPSR_DEFAULT; /* reset fpsr for signal handler */
  344. scr->pt.cr_iip = tramp_addr;
  345. ia64_psr(&scr->pt)->ri = 0; /* start executing in first slot */
  346. ia64_psr(&scr->pt)->be = 0; /* force little-endian byte-order */
  347. /*
  348. * Force the interruption function mask to zero. This has no effect when a
  349. * system-call got interrupted by a signal (since, in that case, scr->pt_cr_ifs is
  350. * ignored), but it has the desirable effect of making it possible to deliver a
  351. * signal with an incomplete register frame (which happens when a mandatory RSE
  352. * load faults). Furthermore, it has no negative effect on the getting the user's
  353. * dirty partition preserved, because that's governed by scr->pt.loadrs.
  354. */
  355. scr->pt.cr_ifs = (1UL << 63);
  356. /*
  357. * Note: this affects only the NaT bits of the scratch regs (the ones saved in
  358. * pt_regs), which is exactly what we want.
  359. */
  360. scr->scratch_unat = 0; /* ensure NaT bits of r12 is clear */
  361. #if DEBUG_SIG
  362. printk("SIG deliver (%s:%d): sig=%d sp=%lx ip=%lx handler=%p\n",
  363. current->comm, current->pid, sig, scr->pt.r12, frame->sc.sc_ip, frame->handler);
  364. #endif
  365. return 1;
  366. }
  367. static long
  368. handle_signal (unsigned long sig, struct k_sigaction *ka, siginfo_t *info,
  369. struct sigscratch *scr)
  370. {
  371. if (!setup_frame(sig, ka, info, sigmask_to_save(), scr))
  372. return 0;
  373. signal_delivered(sig, info, ka, &scr->pt,
  374. test_thread_flag(TIF_SINGLESTEP));
  375. return 1;
  376. }
  377. /*
  378. * Note that `init' is a special process: it doesn't get signals it doesn't want to
  379. * handle. Thus you cannot kill init even with a SIGKILL even by mistake.
  380. */
  381. void
  382. ia64_do_signal (struct sigscratch *scr, long in_syscall)
  383. {
  384. struct k_sigaction ka;
  385. siginfo_t info;
  386. long restart = in_syscall;
  387. long errno = scr->pt.r8;
  388. /*
  389. * In the ia64_leave_kernel code path, we want the common case to go fast, which
  390. * is why we may in certain cases get here from kernel mode. Just return without
  391. * doing anything if so.
  392. */
  393. if (!user_mode(&scr->pt))
  394. return;
  395. /*
  396. * This only loops in the rare cases of handle_signal() failing, in which case we
  397. * need to push through a forced SIGSEGV.
  398. */
  399. while (1) {
  400. int signr = get_signal_to_deliver(&info, &ka, &scr->pt, NULL);
  401. /*
  402. * get_signal_to_deliver() may have run a debugger (via notify_parent())
  403. * and the debugger may have modified the state (e.g., to arrange for an
  404. * inferior call), thus it's important to check for restarting _after_
  405. * get_signal_to_deliver().
  406. */
  407. if ((long) scr->pt.r10 != -1)
  408. /*
  409. * A system calls has to be restarted only if one of the error codes
  410. * ERESTARTNOHAND, ERESTARTSYS, or ERESTARTNOINTR is returned. If r10
  411. * isn't -1 then r8 doesn't hold an error code and we don't need to
  412. * restart the syscall, so we can clear the "restart" flag here.
  413. */
  414. restart = 0;
  415. if (signr <= 0)
  416. break;
  417. if (unlikely(restart)) {
  418. switch (errno) {
  419. case ERESTART_RESTARTBLOCK:
  420. case ERESTARTNOHAND:
  421. scr->pt.r8 = EINTR;
  422. /* note: scr->pt.r10 is already -1 */
  423. break;
  424. case ERESTARTSYS:
  425. if ((ka.sa.sa_flags & SA_RESTART) == 0) {
  426. scr->pt.r8 = EINTR;
  427. /* note: scr->pt.r10 is already -1 */
  428. break;
  429. }
  430. case ERESTARTNOINTR:
  431. ia64_decrement_ip(&scr->pt);
  432. restart = 0; /* don't restart twice if handle_signal() fails... */
  433. }
  434. }
  435. /*
  436. * Whee! Actually deliver the signal. If the delivery failed, we need to
  437. * continue to iterate in this loop so we can deliver the SIGSEGV...
  438. */
  439. if (handle_signal(signr, &ka, &info, scr))
  440. return;
  441. }
  442. /* Did we come from a system call? */
  443. if (restart) {
  444. /* Restart the system call - no handlers present */
  445. if (errno == ERESTARTNOHAND || errno == ERESTARTSYS || errno == ERESTARTNOINTR
  446. || errno == ERESTART_RESTARTBLOCK)
  447. {
  448. /*
  449. * Note: the syscall number is in r15 which is saved in
  450. * pt_regs so all we need to do here is adjust ip so that
  451. * the "break" instruction gets re-executed.
  452. */
  453. ia64_decrement_ip(&scr->pt);
  454. if (errno == ERESTART_RESTARTBLOCK)
  455. scr->pt.r15 = __NR_restart_syscall;
  456. }
  457. }
  458. /* if there's no signal to deliver, we just put the saved sigmask
  459. * back */
  460. restore_saved_sigmask();
  461. }