home *** CD-ROM | disk | FTP | other *** search
/ Il CD di internet / CD.iso / SOURCE / KERNEL-S / V1.2 / LINUX-1.2 / LINUX-1 / linux / arch / alpha / kernel / signal.c < prev    next >
Encoding:
C/C++ Source or Header  |  1995-01-16  |  1.7 KB  |  76 lines

  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. asmlinkage int sys_waitpid(pid_t pid,unsigned long * stat_addr, int options);
  22.  
  23. /*
  24.  * atomically swap in the new signal mask, and wait for a signal.
  25.  */
  26. asmlinkage int sys_sigsuspend(int restart, unsigned long oldmask, unsigned long set)
  27. {
  28.     unsigned long mask;
  29.     struct pt_regs * regs = (struct pt_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. asmlinkage int sys_sigreturn(unsigned long __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. void setup_frame(struct sigaction * sa, unsigned long ** fp, unsigned long pc,
  55.     struct pt_regs * regs, int signr, unsigned long oldmask)
  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. asmlinkage int do_signal(unsigned long oldmask, struct pt_regs * regs)
  72. {
  73.     halt();
  74.     return 1;
  75. }
  76.