home *** CD-ROM | disk | FTP | other *** search
/ QuickTime 2.0 Beta / Quicktime 2.0 Beta.iso / Programming Stuff / Interfaces / Universal Interfaces / MachineExceptions.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-01-30  |  4.1 KB  |  207 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        MachineExceptions.h
  3.  
  4.     Copyright:    Â© 1984-1993 by Apple Computer, Inc., all rights reserved.
  5.  
  6.     WARNING
  7.     This file was auto generated by the interfacer tool. Modifications
  8.     must be made to the master file.
  9.  
  10. */
  11.  
  12. #ifndef        __MACHINEEXCEPTIONS__
  13. #define __MACHINEEXCEPTIONS__
  14.  
  15. #ifndef        __TYPES__
  16. #include <Types.h>
  17. /*    #include <ConditionalMacros.h>                                */
  18. /*    #include <MixedMode.h>                                        */
  19. /*        #include <Traps.h>                                        */
  20. #endif
  21.  
  22.  
  23. /*
  24.     Some basic declarations used throughout the kernel
  25. */
  26.  
  27. typedef void *Ref;
  28.  
  29. typedef long OSStatus;
  30.  
  31. typedef Ref AreaID;
  32.  
  33. typedef Ref LogicalAddress;
  34.  
  35.  
  36. /*
  37.     Machine Dependent types for PowerPC
  38. */
  39.  
  40. #if defined(powerc) || defined (__powerc)
  41. #pragma options align=mac68k
  42. #endif
  43. struct MachineInformation {
  44.     UnsignedWide                CTR;
  45.     UnsignedWide                LR;
  46.     UnsignedWide                PC;
  47.     unsigned long                CR;
  48.     unsigned long                XER;
  49.     unsigned long                MSR;
  50. };
  51. #if defined(powerc) || defined(__powerc)
  52. #pragma options align=reset
  53. #endif
  54.  
  55. typedef struct MachineInformation MachineInformation;
  56.  
  57. #if defined(powerc) || defined (__powerc)
  58. #pragma options align=mac68k
  59. #endif
  60. struct RegisterInformation {
  61.     UnsignedWide                R0;
  62.     UnsignedWide                R1;
  63.     UnsignedWide                R2;
  64.     UnsignedWide                R3;
  65.     UnsignedWide                R4;
  66.     UnsignedWide                R5;
  67.     UnsignedWide                R6;
  68.     UnsignedWide                R7;
  69.     UnsignedWide                R8;
  70.     UnsignedWide                R9;
  71.     UnsignedWide                R10;
  72.     UnsignedWide                R11;
  73.     UnsignedWide                R12;
  74.     UnsignedWide                R13;
  75.     UnsignedWide                R14;
  76.     UnsignedWide                R15;
  77.     UnsignedWide                R16;
  78.     UnsignedWide                R17;
  79.     UnsignedWide                R18;
  80.     UnsignedWide                R19;
  81.     UnsignedWide                R20;
  82.     UnsignedWide                R21;
  83.     UnsignedWide                R22;
  84.     UnsignedWide                R23;
  85.     UnsignedWide                R24;
  86.     UnsignedWide                R25;
  87.     UnsignedWide                R26;
  88.     UnsignedWide                R27;
  89.     UnsignedWide                R28;
  90.     UnsignedWide                R29;
  91.     UnsignedWide                R30;
  92.     UnsignedWide                R31;
  93. };
  94. #if defined(powerc) || defined(__powerc)
  95. #pragma options align=reset
  96. #endif
  97.  
  98. typedef struct RegisterInformation RegisterInformation;
  99.  
  100. #if defined(powerc) || defined (__powerc)
  101. #pragma options align=mac68k
  102. #endif
  103. struct FPUInformation {
  104.     UnsignedWide                Registers[32];
  105.     unsigned long                FPSCR;
  106. };
  107. #if defined(powerc) || defined(__powerc)
  108. #pragma options align=reset
  109. #endif
  110.  
  111. typedef struct FPUInformation FPUInformation;
  112.  
  113.  
  114. /*
  115.     Exception related declarations
  116. */
  117.  
  118.  
  119. //    Memory exceptions
  120.  
  121. enum  {
  122.     writeReference                = 0,
  123.     readReference                = 1,
  124.     fetchReference                = 2
  125. };
  126.  
  127. typedef unsigned long MemoryReferenceKind;
  128.  
  129. #if defined(powerc) || defined (__powerc)
  130. #pragma options align=mac68k
  131. #endif
  132. struct MemoryExceptionInformation {
  133.     AreaID                        theArea;
  134.     LogicalAddress                theAddress;
  135.     OSStatus                    theError;
  136.     MemoryReferenceKind            theReference;
  137. };
  138. #if defined(powerc) || defined(__powerc)
  139. #pragma options align=reset
  140. #endif
  141.  
  142. typedef struct MemoryExceptionInformation MemoryExceptionInformation;
  143.  
  144. enum  {
  145.     unknownException            = 0,
  146.     illegalInstructionException    = 1,
  147.     trapException                = 2,
  148.     accessException                = 3,
  149.     unmappedMemoryException        = 4,
  150.     excludedMemoryException        = 5,
  151.     readOnlyMemoryException        = 6,
  152.     unresolvablePageFaultException = 7,
  153.     privilegeViolationException    = 8,
  154.     traceException                = 9,
  155.     instructionBreakpointException = 10,
  156.     dataBreakpointException        = 11,
  157.     integerException            = 12,
  158.     floatingPointException        = 13,
  159.     stackOverflowException        = 14,
  160.     terminationException        = 15
  161. };
  162.  
  163. typedef unsigned long ExceptionKind;
  164.  
  165. #if defined(powerc) || defined (__powerc)
  166. #pragma options align=mac68k
  167. #endif
  168. struct ExceptionInformation {
  169.     ExceptionKind                theKind;
  170.     MachineInformation            *machineState;
  171.     RegisterInformation            *registerImage;
  172.     FPUInformation                *FPUImage;
  173.     union {
  174.         MemoryExceptionInformation    *memoryInfo;
  175.     }                            info;
  176. };
  177. #if defined(powerc) || defined(__powerc)
  178. #pragma options align=reset
  179. #endif
  180.  
  181. typedef struct ExceptionInformation ExceptionInformation;
  182.  
  183.  
  184. /*
  185.     Note: An ExceptionHandler is NOT a UniversalProcPtr’s. It must be
  186.     a native PowerPC transition vector with NO routine descriptor.
  187. */
  188.  
  189. typedef OSStatus (*ExceptionHandler)(ExceptionInformation *theException);
  190.  
  191.  
  192. /*
  193.     Routines for installing per-process exception handlers
  194. */
  195.  
  196. #ifdef __cplusplus
  197. extern "C" {
  198. #endif
  199.  
  200. extern ExceptionHandler InstallExceptionHandler(ExceptionHandler theHandler);
  201. #ifdef __cplusplus
  202. }
  203. #endif
  204.  
  205. #endif
  206.  
  207.