move code definitions from signal.h
authorMike Karels <karels@ucbvax.Berkeley.EDU>
Sun, 12 Jul 1987 06:26:01 +0000 (22:26 -0800)
committerMike Karels <karels@ucbvax.Berkeley.EDU>
Sun, 12 Jul 1987 06:26:01 +0000 (22:26 -0800)
SCCS-vsn: sys/tahoe/include/trap.h 1.3
SCCS-vsn: sys/vax/include/trap.h 7.3

usr/src/sys/tahoe/include/trap.h
usr/src/sys/vax/include/trap.h

index 7d1b1d5..46eb8f0 100644 (file)
@@ -1,10 +1,13 @@
 /*     trap.h  1.3     87/07/11        */
 
 /*     trap.h  1.3     87/07/11        */
 
-/*     first 3 constants known in system C files - don't change */
+/*
+ * Trap type values
+ * also known in trap.c for name strings
+ */
+
 #define        T_RESADFLT      0       /* reserved addressing */
 #define        T_PRIVINFLT     1       /* privileged instruction */
 #define        T_RESOPFLT      2       /* reserved operand */
 #define        T_RESADFLT      0       /* reserved addressing */
 #define        T_PRIVINFLT     1       /* privileged instruction */
 #define        T_RESOPFLT      2       /* reserved operand */
-/*     those constants shouldn't change        */
 #define        T_BPTFLT        3       /* breakpoint instruction */
 #define        T_SYSCALL       5       /* system call (kcall) */
 #define        T_ARITHTRAP     6       /* arithmetic trap */
 #define        T_BPTFLT        3       /* breakpoint instruction */
 #define        T_SYSCALL       5       /* system call (kcall) */
 #define        T_ARITHTRAP     6       /* arithmetic trap */
 #define        T_KSPNOTVAL     15      /* kernel stack pointer not valid */
 #define        T_BUSERR        16      /* bus error */
 #define        T_KDBTRAP       17      /* kernel debugger trap */
 #define        T_KSPNOTVAL     15      /* kernel stack pointer not valid */
 #define        T_BUSERR        16      /* bus error */
 #define        T_KDBTRAP       17      /* kernel debugger trap */
+
+/* definitions for <sys/signal.h> */
+#define            ILL_RESAD_FAULT     T_RESADFLT
+#define            ILL_PRIVIN_FAULT    T_PRIVINFLT
+#define            ILL_RESOP_FAULT     T_RESOPFLT
+#define            ILL_ALIGN_FAULT     T_ALIGNFLT
+
+/* codes for SIGFPE/ARITHTRAP */
+#define            FPE_INTOVF_TRAP     0x1     /* integer overflow */
+#define            FPE_INTDIV_TRAP     0x2     /* integer divide by zero */
+#define            FPE_FLTDIV_TRAP     0x3     /* floating/decimal divide by zero */
+#define            FPE_FLTOVF_TRAP     0x4     /* floating overflow */
+#define            FPE_FLTUND_TRAP     0x5     /* floating underflow */
index 07b0c3a..d1c42af 100644 (file)
@@ -3,18 +3,22 @@
  * All rights reserved.  The Berkeley software License Agreement
  * specifies the terms and conditions for redistribution.
  *
  * All rights reserved.  The Berkeley software License Agreement
  * specifies the terms and conditions for redistribution.
  *
- *     @(#)trap.h      7.2 (Berkeley) %G%
+ *     @(#)trap.h      7.3 (Berkeley) %G%
  */
 
 /*
  * Trap type values
  */
 
 /*
  * Trap type values
+ * also known in trap.c for name strings
  */
 
  */
 
-/* The first three constant values are known to the real world <signal.h> */
 #define        T_RESADFLT      0               /* reserved addressing fault */
 #define        T_PRIVINFLT     1               /* privileged instruction fault */
 #define        T_RESOPFLT      2               /* reserved operand fault */
 #define        T_RESADFLT      0               /* reserved addressing fault */
 #define        T_PRIVINFLT     1               /* privileged instruction fault */
 #define        T_RESOPFLT      2               /* reserved operand fault */
-/* End of known constants */
+/* definitions for <sys/signal.h> */
+#define            ILL_RESAD_FAULT     T_RESADFLT
+#define            ILL_PRIVIN_FAULT    T_PRIVINFLT
+#define            ILL_RESOP_FAULT     T_RESOPFLT
+/* CHME, CHMS, CHMU are not yet given back to users reasonably */
 #define        T_BPTFLT        3               /* bpt instruction fault */
 #define        T_XFCFLT        4               /* xfc instruction fault */
 #define        T_SYSCALL       5               /* chmk instruction (syscall trap) */
 #define        T_BPTFLT        3               /* bpt instruction fault */
 #define        T_XFCFLT        4               /* xfc instruction fault */
 #define        T_SYSCALL       5               /* chmk instruction (syscall trap) */
 #define        T_PAGEFLT       12              /* page fault */
 #define        T_TABLEFLT      13              /* page table fault */
 #define        T_KDBTRAP       14              /* kernel debugger trap */
 #define        T_PAGEFLT       12              /* page fault */
 #define        T_TABLEFLT      13              /* page table fault */
 #define        T_KDBTRAP       14              /* kernel debugger trap */
+
+/* codes for SIGFPE/ARITHTRAP */
+#define            FPE_INTOVF_TRAP     0x1     /* integer overflow */
+#define            FPE_INTDIV_TRAP     0x2     /* integer divide by zero */
+#define            FPE_FLTOVF_TRAP     0x3     /* floating overflow */
+#define            FPE_FLTDIV_TRAP     0x4     /* floating/decimal divide by zero */
+#define            FPE_FLTUND_TRAP     0x5     /* floating underflow */
+#define            FPE_DECOVF_TRAP     0x6     /* decimal overflow */
+#define            FPE_SUBRNG_TRAP     0x7     /* subscript out of range */
+#define            FPE_FLTOVF_FAULT    0x8     /* floating overflow fault */
+#define            FPE_FLTDIV_FAULT    0x9     /* divide by zero floating fault */
+#define            FPE_FLTUND_FAULT    0xa     /* floating underflow fault */