home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / sibdemo3.zip / SOURCE.DAT / SOURCE / RTL / BSEEXCPT.PAS < prev    next >
Pascal/Delphi Source File  |  1995-07-30  |  8KB  |  200 lines

  1. UNIT BseExcpt;
  2.  
  3. {*************************** MODULE HEADER ********************************
  4.  *                                                                        *
  5.  * Source File Name: BseExcpt.PAS                                         *
  6.  *                                                                        *
  7.  * Descriptive Name: Thread Exception Constants and Structure Definitions.*
  8.  *                                                                        *
  9.  *                                                                        *
  10.  **************************************************************************}
  11.  
  12. INTERFACE
  13.  
  14. USES OS2Def;
  15.  
  16. { User Exception Handler Return Codes: }
  17.  
  18.  
  19. CONST
  20.        XCPT_CONTINUE_SEARCH    =$00000000;     { exception not handled   }
  21.        XCPT_CONTINUE_EXECUTION =$FFFFFFFF;     { exception handled       }
  22.        XCPT_CONTINUE_STOP      =$00716668;     { exception handled by    }
  23.                                                 { debugger (VIA DosDebug) }
  24.  
  25. {
  26.  * fHandlerFlags values (see ExceptionReportRecord):
  27.  *
  28.  * The user may only set (but not clear) the EH_NONCONTINUABLE flag.
  29.  * All other flags are set by the system.
  30.  *
  31.  }
  32.  
  33.        EH_NONCONTINUABLE   =$1;         { Noncontinuable exception }
  34.        EH_UNWINDING        =$2;         { Unwind is in progress }
  35.        EH_EXIT_UNWIND      =$4;         { Exit unwind is in progress }
  36.        EH_STACK_INVALID    =$8;         { Stack out of limits or unaligned }
  37.        EH_NESTED_CALL      =$10;        { Nested exception handler call }
  38.  
  39.  
  40. {
  41.  * Unwind all exception handlers (see DosUnwindException API)
  42.  }
  43.        UNWIND_ALL          =0;
  44.  
  45.  
  46. {
  47.  *   Exception values are 32 bit values layed out as follows:
  48.  *
  49.  *   3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1
  50.  *   1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
  51.  *   +---+-+-------------------------+-------------------------------+
  52.  *   |Sev|C|       Facility          |               Code            |
  53.  *   +---+-+-------------------------+-------------------------------+
  54.  *
  55.  *   where
  56.  *
  57.  *       Sev - is the severity code
  58.  *           00 - Success
  59.  *           01 - Informational
  60.  *           10 - Warning
  61.  *           11 - Error
  62.  *
  63.  *       C - is the Customer code flag
  64.  *
  65.  *       Facility - is the facility code
  66.  *
  67.  *       Code - is the facility's status code
  68.  *
  69.  *   Exceptions specific to OS/2 2.0 (e.g. XCPT_SIGNAL) will be marked
  70.  *   with a facility code of 1.
  71.  *
  72.  *   System defined exceptions have a facility code of zero.
  73.  *
  74.  *   Each exception may also have several pieces of additional information.
  75.  *   These are stored in the ExceptionInfo fields of the
  76.  *   ExceptionReportRecord. They are documented here with the exceptions
  77.  *   only for ease of reference.
  78.  }
  79.  
  80.        XCPT_FATAL_EXCEPTION    =$C0000000;
  81.        XCPT_SEVERITY_CODE      =$C0000000;
  82.        XCPT_CUSTOMER_CODE      =$20000000;
  83.        XCPT_FACILITY_CODE      =$1FFF0000;
  84.        XCPT_EXCEPTION_CODE     =$0000FFFF;
  85.  
  86. {  Violation flags in ExceptionInfo }
  87.  
  88.        XCPT_UNKNOWN_ACCESS     =$00000000;     { Unknown access }
  89.        XCPT_READ_ACCESS        =$00000001;     { Read access    }
  90.        XCPT_WRITE_ACCESS       =$00000002;     { Write access   }
  91.        XCPT_EXECUTE_ACCESS     =$00000004;     { Execute access }
  92.        XCPT_SPACE_ACCESS       =$00000008;     { Address space access }
  93.        XCPT_LIMIT_ACCESS       =$00000010;     { Address space limit violation }
  94.        XCPT_DATA_UNKNOWN       =$FFFFFFFF;
  95.  
  96. {  Signal numbers for XCPT_SIGNAL }
  97.  
  98.        XCPT_SIGNAL_INTR        =1;
  99.        XCPT_SIGNAL_KILLPROC    =3;
  100.        XCPT_SIGNAL_BREAK       =4;
  101.  
  102. {  Portable non-fatal software generated exceptions }
  103.  
  104.        XCPT_GUARD_PAGE_VIOLATION       =$80000001;
  105.       { ExceptionInfo[ 0 ] - Access Code: XCPT_READ_ACCESS
  106.                                            XCPT_WRITE_ACCESS }
  107.       { ExceptionInfo[ 1 ] - FaultAddr }
  108.  
  109.        XCPT_UNABLE_TO_GROW_STACK       =$80010001;
  110.  
  111. {  Portable fatal hardware generated exceptions }
  112.  
  113.        XCPT_DATATYPE_MISALIGNMENT      =$C000009E;
  114.       { ExceptionInfo[ 0 ] - Access Code: XCPT_READ_ACCESS
  115.                                            XCPT_WRITE_ACCESS }
  116.       { ExceptionInfo[ 1 ] - Alignment }
  117.       { ExceptionInfo[ 2 ] - FaultAddr }
  118.  
  119.        XCPT_BREAKPOINT                 =$C000009F;
  120.        XCPT_SINGLE_STEP                =$C00000A0;
  121.        XCPT_ACCESS_VIOLATION           =$C0000005;
  122.       { ExceptionInfo[ 0 ] - Access Code: XCPT_READ_ACCESS
  123.                                            XCPT_WRITE_ACCESS
  124.                                            XCPT_SPACE_ACCESS
  125.                                            XCPT_LIMIT_ACCESS
  126.                                            XCPT_UNKNOWN_ACCESS }
  127.       { ExceptionInfo[ 1 ] - FaultAddr (XCPT_READ_ACCESS/XCPT_WRITE_ACCESS)
  128.                               Selector  (XCPT_SPACE_ACCESS)
  129.                               -1        (XCPT_LIMIT_ACCESS) }
  130.  
  131.        XCPT_ILLEGAL_INSTRUCTION        =$C000001C;
  132.        XCPT_FLOAT_DENORMAL_OPERAND     =$C0000094;
  133.        XCPT_FLOAT_DIVIDE_BY_ZERO       =$C0000095;
  134.        XCPT_FLOAT_INEXACT_RESULT       =$C0000096;
  135.        XCPT_FLOAT_INVALID_OPERATION    =$C0000097;
  136.        XCPT_FLOAT_OVERFLOW             =$C0000098;
  137.        XCPT_FLOAT_STACK_CHECK          =$C0000099;
  138.        XCPT_FLOAT_UNDERFLOW            =$C000009A;
  139.        XCPT_INTEGER_DIVIDE_BY_ZERO     =$C000009B;
  140.        XCPT_INTEGER_OVERFLOW           =$C000009C;
  141.        XCPT_PRIVILEGED_INSTRUCTION     =$C000009D;
  142.  
  143. {  Portable fatal software generated exceptions }
  144.  
  145.        XCPT_IN_PAGE_ERROR              =$C0000006;
  146.       { ExceptionInfo[ 0 ] - FaultAddr }
  147.  
  148.        XCPT_PROCESS_TERMINATE          =$C0010001;
  149.        XCPT_ASYNC_PROCESS_TERMINATE    =$C0010002;
  150.       { ExceptionInfo[ 0 ] - TID of 'terminator' thread }
  151.  
  152.        XCPT_NONCONTINUABLE_EXCEPTION   =$C0000024;
  153.        XCPT_INVALID_DISPOSITION        =$C0000025;
  154.  
  155. {  Non-portable fatal exceptions }
  156.  
  157.        XCPT_INVALID_LOCK_SEQUENCE      =$C000001D;
  158.        XCPT_ARRAY_BOUNDS_EXCEEDED      =$C0000093;
  159.        XCPT_B1NPX_ERRATA_02            =$C0010004;
  160.  
  161. {  Misc exceptions }
  162.  
  163.        XCPT_UNWIND                     =$C0000026;
  164.        XCPT_BAD_STACK                  =$C0000027;
  165.        XCPT_INVALID_UNWIND_TARGET      =$C0000028;
  166.  
  167. {  Signal Exceptions }
  168.  
  169.        XCPT_SIGNAL                     =$C0010003;
  170.       { ExceptionInfo[ 0 ] - Signal Number }
  171.  
  172. {
  173.  * ContextRecord
  174.  *
  175.  * This is the machine specific register contents for the thread
  176.  * at the time of the exception. Note that only the register sets
  177.  * specified by ContextFlags contain valid data. Conversely, only
  178.  * registers specified in ContextFlags will be restored if an exception
  179.  * is handled.
  180.  }
  181.  
  182. {  The following flags control the contents of the CONTEXT structure. }
  183.  
  184.        CONTEXT_CONTROL         =$00000001;     { SS:ESP, CS:EIP, EFLAGS,  }
  185.                                                 { EBP                      }
  186.        CONTEXT_INTEGER         =$00000002;     { EAX, EBX, ECX, EDX, ESI, }
  187.                                                 { EDI                      }
  188.        CONTEXT_SEGMENTS        =$00000004;     { DS, ES, FS, GS           }
  189.        CONTEXT_FLOATING_POINT  =$00000008;     { numeric coprocessor state }
  190.  
  191.        CONTEXT_FULL            =CONTEXT_CONTROL OR CONTEXT_INTEGER OR
  192.                                 CONTEXT_SEGMENTS OR CONTEXT_FLOATING_POINT;
  193.  
  194.  
  195. IMPLEMENTATION
  196.  
  197. BEGIN
  198. END.
  199.  
  200.