home *** CD-ROM | disk | FTP | other *** search
/ Otherware / Otherware_1_SB_Development.iso / amiga / os / bsdss4.tz / bsdss4 / bsdss / server / i386 / trap.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-04-22  |  5.3 KB  |  131 lines

  1. /* 
  2.  * Mach Operating System
  3.  * Copyright (c) 1992 Carnegie Mellon University
  4.  * All Rights Reserved.
  5.  * 
  6.  * Permission to use, copy, modify and distribute this software and its
  7.  * documentation is hereby granted, provided that both the copyright
  8.  * notice and this permission notice appear in all copies of the
  9.  * software, derivative works or modified versions, and any portions
  10.  * thereof, and that both notices appear in supporting documentation.
  11.  * 
  12.  * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
  13.  * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
  14.  * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
  15.  * 
  16.  * Carnegie Mellon requests users of this software to return to
  17.  * 
  18.  *  Software Distribution Coordinator  or  Software.Distribution@CS.CMU.EDU
  19.  *  School of Computer Science
  20.  *  Carnegie Mellon University
  21.  *  Pittsburgh PA 15213-3890
  22.  * 
  23.  * any improvements or extensions that they make and grant Carnegie Mellon 
  24.  * the rights to redistribute these changes.
  25.  */
  26. /*
  27.  * HISTORY
  28.  * $Log:    trap.h,v $
  29.  * Revision 2.1  92/04/21  17:18:50  rwd
  30.  * BSDSS
  31.  * 
  32.  *
  33.  */
  34.  
  35. /*-
  36.  * Copyright (c) 1990 The Regents of the University of California.
  37.  * All rights reserved.
  38.  *
  39.  * This code is derived from software contributed to Berkeley by
  40.  * William Jolitz.
  41.  *
  42.  * Redistribution and use in source and binary forms, with or without
  43.  * modification, are permitted provided that the following conditions
  44.  * are met:
  45.  * 1. Redistributions of source code must retain the above copyright
  46.  *    notice, this list of conditions and the following disclaimer.
  47.  * 2. Redistributions in binary form must reproduce the above copyright
  48.  *    notice, this list of conditions and the following disclaimer in the
  49.  *    documentation and/or other materials provided with the distribution.
  50.  * 3. All advertising materials mentioning features or use of this software
  51.  *    must display the following acknowledgement:
  52.  *    This product includes software developed by the University of
  53.  *    California, Berkeley and its contributors.
  54.  * 4. Neither the name of the University nor the names of its contributors
  55.  *    may be used to endorse or promote products derived from this software
  56.  *    without specific prior written permission.
  57.  *
  58.  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  59.  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  60.  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  61.  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  62.  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  63.  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  64.  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  65.  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  66.  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  67.  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  68.  * SUCH DAMAGE.
  69.  *
  70.  *    @(#)trap.h    5.4 (Berkeley) 5/9/91
  71.  */
  72.  
  73. /*
  74.  * Trap type values
  75.  * also known in trap.c for name strings
  76.  */
  77.  
  78. #define    T_RESADFLT    0    /* reserved addressing */
  79. #define    T_PRIVINFLT    1    /* privileged instruction */
  80. #define    T_RESOPFLT    2    /* reserved operand */
  81. #define    T_BPTFLT    3    /* breakpoint instruction */
  82. #define    T_SYSCALL    5    /* system call (kcall) */
  83. #define    T_ARITHTRAP    6    /* arithmetic trap */
  84. #define    T_ASTFLT    7    /* system forced exception */
  85. #define    T_SEGFLT    8    /* segmentation (limit) fault */
  86. #define    T_PROTFLT    9    /* protection fault */
  87. #define    T_TRCTRAP    10    /* trace trap */
  88. #define    T_PAGEFLT    12    /* page fault */
  89. #define    T_TABLEFLT    13    /* page table fault */
  90. #define    T_ALIGNFLT    14    /* alignment fault */
  91. #define    T_KSPNOTVAL    15    /* kernel stack pointer not valid */
  92. #define    T_BUSERR    16    /* bus error */
  93. #define    T_KDBTRAP    17    /* kernel debugger trap */
  94.  
  95. #define    T_DIVIDE    18    /* integer divide fault */
  96. #define    T_NMI        19    /* non-maskable trap */
  97. #define    T_OFLOW        20    /* overflow trap */
  98. #define    T_BOUND        21    /* bound instruction fault */
  99. #define    T_DNA        22    /* device not available fault */
  100. #define    T_DOUBLEFLT    23    /* double fault */
  101. #define    T_FPOPFLT    24    /* fp coprocessor operand fetch fault */
  102. #define    T_TSSFLT    25    /* invalid tss fault */
  103. #define    T_SEGNPFLT    26    /* segment not present fault */
  104. #define    T_STKFLT    27    /* stack fault */
  105. #define    T_RESERVED    28    /* reserved fault base */
  106.  
  107. /* definitions for <sys/signal.h> */
  108. #define        ILL_RESAD_FAULT    T_RESADFLT
  109. #define        ILL_PRIVIN_FAULT    T_PRIVINFLT
  110. #define        ILL_RESOP_FAULT    T_RESOPFLT
  111. #define        ILL_ALIGN_FAULT    T_ALIGNFLT
  112. #define        ILL_FPOP_FAULT    T_FPOPFLT    /* coprocessor operand fault */
  113.  
  114. /* codes for SIGFPE/ARITHTRAP */
  115. #define        FPE_INTOVF_TRAP    0x1    /* integer overflow */
  116. #define        FPE_INTDIV_TRAP    0x2    /* integer divide by zero */
  117. #define        FPE_FLTDIV_TRAP    0x3    /* floating/decimal divide by zero */
  118. #define        FPE_FLTOVF_TRAP    0x4    /* floating overflow */
  119. #define        FPE_FLTUND_TRAP    0x5    /* floating underflow */
  120. #define        FPE_FPU_NP_TRAP    0x6    /* floating point unit not present */
  121. #define        FPE_SUBRNG_TRAP    0x7    /* subrange out of bounds */
  122.  
  123. /* codes for SIGBUS */
  124. #define        BUS_PAGE_FAULT    T_PAGEFLT    /* page fault protection base */
  125. #define        BUS_SEGNP_FAULT    T_SEGNPFLT    /* segment not present */
  126. #define        BUS_STK_FAULT    T_STKFLT    /* stack segment */
  127. #define        BUS_SEGM_FAULT    T_RESERVED    /* segment protection base */
  128.  
  129. /* Trap's coming from user mode */
  130. #define    T_USER    0x100
  131.