1 /* 2 * linux/arch/alpha/kernel/signal.c 3 * 4 * Copyright (C) 1995 Linus Torvalds 5 */ 6
7 #include <linux/sched.h>
8 #include <linux/kernel.h>
9 #include <linux/signal.h>
10 #include <linux/errno.h>
11 #include <linux/wait.h>
12 #include <linux/ptrace.h>
13 #include <linux/unistd.h>
14
15 #include <asm/segment.h>
16
17 #define_S(nr) (1<<((nr)-1))
18
19 #define_BLOCKABLE (~(_S(SIGKILL) | _S(SIGSTOP)))
20
21 asmlinkageintsys_waitpid(pid_tpid,unsignedlong * stat_addr, intoptions);
22
23 /* 24 * atomically swap in the new signal mask, and wait for a signal. 25 */ 26 asmlinkageint sys_sigsuspend(intrestart, unsignedlongoldmask, unsignedlongset)
/* */ 27 { 28 unsignedlongmask;
29 structpt_regs * regs = (structpt_regs *) &restart;
30
31 halt();
32 mask = current->blocked;
33 current->blocked = set & _BLOCKABLE;
34 while (1) { 35 current->state = TASK_INTERRUPTIBLE;
36 schedule();
37 if (do_signal(mask,regs))
38 return -EINTR;
39 } 40 } 41
42 /* 43 * this should do a signal return with the info on the stack.. 44 */ 45 asmlinkageint sys_sigreturn(unsignedlong__unused)
/* */ 46 { 47 halt();
48 return 0;
49 } 50
51 /* 52 * Set up a signal frame... I don't know what it should look like yet. 53 */ 54 voidsetup_frame(structsigaction * sa, unsignedlong ** fp, unsignedlongpc,
/* */ 55 structpt_regs * regs, intsignr, unsignedlongoldmask)
56 { 57 halt();
58 } 59
60 /* 61 * Note that 'init' is a special process: it doesn't get signals it doesn't 62 * want to handle. Thus you cannot kill init even with a SIGKILL even by 63 * mistake. 64 * 65 * Note that we go through the signals twice: once to check the signals that 66 * the kernel can handle, and then we build all the user-level signal handling 67 * stack-frames in one go after that. 68 * 69 * Not that any of this is actually implemented yet ;-) 70 */ 71 asmlinkageintdo_signal(unsignedlongoldmask, structpt_regs * regs)
/* */ 72 { 73 halt();
74 return 1;
75 }