home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 4 / DATAFILE_PDCD4.iso / utilities / utilss / sockets / include / sys / h / signal < prev    next >
Encoding:
Text File  |  1995-02-21  |  5.9 KB  |  182 lines

  1. /*
  2.  * $Header: /ax/networking:include/sys/signal.h:networking  1.2  $
  3.  * $Source: /ax/networking:include/sys/signal.h: $
  4.  *
  5.  * Copyright (c) 1988 Acorn Computers Ltd., Cambridge, England
  6.  *
  7.  * $Log:    signal.h,v $
  8.  * Revision 1.2  95/02/21  15:02:52  kwelton
  9.  * Removed declarations of unwanted RISC iX specific structures.  This
  10.  * has the benefit of removing an unnecessary include: arm/fp.h.
  11.  * 
  12.  * Revision 1.1  95/01/11  10:19:46  kwelton
  13.  * Initial revision
  14.  * 
  15.  * Revision 1.4  88/08/11  09:27:39  keith
  16.  * Addition of two kernel private psuedo-signals for FP context switching.
  17.  * Also #ifdef _SIGNAL_ to allow multiple inclusions.
  18.  * 
  19.  * Revision 1.3  88/06/17  20:21:05  beta
  20.  * Acorn Unix initial beta version
  21.  * 
  22.  */
  23. /* @(#)signal.h    1.3 87/05/29 3.2/4.3NFSSRC */
  24. /*
  25.  * Copyright (c) 1982, 1986 Regents of the University of California.
  26.  * All rights reserved.  The Berkeley software License Agreement
  27.  * specifies the terms and conditions for redistribution.
  28.  *
  29.  *    @(#)signal.h    7.1 (Berkeley) 6/4/86
  30.  */
  31.  
  32. #ifndef    _SIGNAL_
  33. #define    _SIGNAL_
  34.  
  35. #ifndef    NSIG
  36. #define NSIG    32
  37.  
  38. #define    SIGHUP    1    /* hangup */
  39. #define    SIGINT    2    /* interrupt */
  40. #define    SIGQUIT    3    /* quit */
  41. #define    SIGILL    4    /* illegal instruction (not reset when caught) */
  42. #define        ILL_RESAD_FAULT    0x0    /* reserved addressing fault */
  43. #define        ILL_PRIVIN_FAULT    0x1    /* privileged instruction fault */
  44. #define        ILL_RESOP_FAULT    0x2    /* reserved operand fault */
  45. /* CHME, CHMS, CHMU are not yet given back to users reasonably */
  46. #define    SIGTRAP    5    /* trace trap (not reset when caught) */
  47. #define    SIGIOT    6    /* IOT instruction */
  48. #define    SIGABRT    SIGIOT    /* compatibility */
  49. #define    SIGEMT    7    /* EMT instruction */
  50. #define    SIGFPE    8    /* floating point exception */
  51. #define        FPE_INTOVF_TRAP    0x1    /* integer overflow */
  52. #define        FPE_INTDIV_TRAP    0x2    /* integer divide by zero */
  53. #define        FPE_FLTOVF_TRAP    0x3    /* floating overflow */
  54. #define        FPE_FLTDIV_TRAP    0x4    /* floating/decimal divide by zero */
  55. #define        FPE_FLTUND_TRAP    0x5    /* floating underflow */
  56. #define        FPE_DECOVF_TRAP    0x6    /* decimal overflow */
  57. #define        FPE_SUBRNG_TRAP    0x7    /* subscript out of range */
  58. #define        FPE_FLTOVF_FAULT    0x8    /* floating overflow fault */
  59. #define        FPE_FLTDIV_FAULT    0x9    /* divide by zero floating fault */
  60. #define        FPE_FLTUND_FAULT    0xa    /* floating underflow fault */
  61. #define        FPE_INVALID_OP      0xb     /* floating invalid operand */
  62. #define     FPE_INEXACT         0xc    /* floating inexactitude! */
  63. #define    SIGKILL    9    /* kill (cannot be caught or ignored) */
  64. #define    SIGBUS    10    /* bus error */
  65. #define    SIGSEGV    11    /* segmentation violation */
  66. #define    SIGSYS    12    /* bad argument to system call */
  67. #define    SIGPIPE    13    /* write on a pipe with no one to read it */
  68. #define    SIGALRM    14    /* alarm clock */
  69. #define    SIGTERM    15    /* software termination signal from kill */
  70. #define    SIGURG    16    /* urgent condition on IO channel */
  71. #define    SIGSTOP    17    /* sendable stop signal not from tty */
  72. #define    SIGTSTP    18    /* stop signal from tty */
  73. #define    SIGCONT    19    /* continue a stopped process */
  74. #define    SIGCHLD    20    /* to parent on child stop or exit */
  75. #define    SIGCLD    SIGCHLD    /* compatibility */
  76. #define    SIGTTIN    21    /* to readers pgrp upon background tty read */
  77. #define    SIGTTOU    22    /* like TTIN for output if (tp->t_local<OSTOP) */
  78. #define    SIGIO    23    /* input/output possible signal */
  79. #define    SIGXCPU    24    /* exceeded CPU time limit */
  80. #define    SIGXFSZ    25    /* exceeded file size limit */
  81. #define    SIGVTALRM 26    /* virtual time alarm */
  82. #define    SIGPROF    27    /* profiling time alarm */
  83. #define SIGWINCH 28    /* window size changes */
  84. #define SIGUSR1 30    /* user defined signal 1 */
  85. #define SIGUSR2 31    /* user defined signal 2 */
  86. #define    SIGLOST 29    /* resource lost (eg, record-lock lost) */
  87.  
  88. /* The fp context changer uses two psuedo signals to invoke trampoline
  89.  * code to save/load floating point registers which cannot be accessed
  90.  * in supervisor mode.
  91.  */
  92. #ifdef    KERNEL
  93. #define    SIG_SAVE_FPREGS    NSIG+1
  94. #define    SIG_LOAD_FPREGS NSIG+2
  95. #endif    KERNEL
  96.  
  97.  
  98. #ifndef KERNEL
  99. int    (*signal())();
  100. #endif
  101.  
  102. /*
  103.  * Signal vector "template" used in sigvec call.
  104.  */
  105. struct    sigvec {
  106.     int    (*sv_handler)();    /* signal handler */
  107.     int    sv_mask;        /* signal mask to apply */
  108.     int    sv_flags;        /* see signal options below */
  109. };
  110. #define SV_ONSTACK    0x0001    /* take signal on signal stack */
  111. #define SV_INTERRUPT    0x0002    /* do not restart system on signal return */
  112. #define sv_onstack sv_flags    /* isn't compatibility wonderful! */
  113.  
  114. /*
  115.  * Structure used in sigstack call.
  116.  */
  117. struct    sigstack {
  118.     char    *ss_sp;            /* signal stack pointer */
  119.     int    ss_onstack;        /* current status */
  120. };
  121.  
  122. /*
  123.  * 950221 KWelton
  124.  *
  125.  * Remove all the RISC iX specific signal structures
  126.  */
  127. #ifdef __unix
  128.  
  129. #ifdef    KERNEL
  130. # include "arm/fp.h"
  131. #else
  132. # include "arm/fp.h"
  133. #endif    KERNEL
  134.  
  135. /*
  136.  * Information pushed on stack when a signal is delivered.
  137.  * This is used by the kernel to restore state following
  138.  * execution of the signal handler.  It is also made available
  139.  * to the handler to allow it to properly restore state if
  140.  * a non-standard exit is performed.
  141.  */
  142. struct    sigcontext {
  143.     int    sc_onstack;        /* sigstack state to restore */
  144.     int    sc_mask;        /* signal mask to restore */
  145.     int    sc_cpu_regs[16];    /* ARM cpu registers to restore */
  146.     struct    fp_regs sc_fp_regs;    /* floating point register to restore */
  147. };
  148.  
  149. struct    syslongjmpcontext {
  150.     int    sc_onstack;        /* sigstack state to restore */
  151.     int    sc_mask;        /* signal mask to restore */
  152.     int    sc_r4, sc_r5, sc_r6;    /* r4-r6 to restore */
  153.     int    sc_r7, sc_r8, sc_r9;    /* r7-r9 to restore */
  154.     int    sc_sb;            /* static base to restore */
  155.     int    sc_fp;            /* fp to restore */
  156.     int    sc_spt;            /* sp temporary to restore */
  157.     int    sc_sp;            /* sp to restore */
  158.     int    sc_lr;            /* lr to restore */
  159.     int    sc_pc;            /* pc to restore */
  160. };
  161.  
  162. #endif /* defined(__unix) */
  163.  
  164. #define    BADSIG        (int (*)())-1
  165. #define    SIG_DFL        (int (*)())0
  166. #define    SIG_IGN        (int (*)())1
  167.  
  168. #ifdef KERNEL
  169. #define    SIG_CATCH    (int (*)())2
  170. #define    SIG_HOLD    (int (*)())3
  171. #endif
  172. #endif
  173.  
  174. /*
  175.  * Macro for converting signal number to a mask suitable for
  176.  * sigblock().
  177.  */
  178. #define sigmask(m)    (1 << ((m)-1))
  179. #endif    _SIGNAL_
  180.  
  181. /* EOF signal.h */
  182.