home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Languages / MPW Oberon 2.1168 / OInterfaces / MachineExceptions.mod < prev    next >
Encoding:
Text File  |  1995-08-10  |  4.0 KB  |  162 lines  |  [TEXT/MPS ]

  1. (*
  2.      File:        MachineExceptions.mod
  3.  
  4.      Contains:    Processor Exception Handling Interfaces .
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Package:    Universal Interfaces 2.0 in “MPW Latest” on ETO #17
  8.  
  9.      Copyright:    © 1984-1995 by Apple Computer, Inc.
  10.                  All rights reserved.
  11.  
  12.      Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13.                  stack.  Include the file and version information (from above)
  14.                  in the problem description and send to:
  15.                      Internet:    apple.bugs.applelink.apple.com
  16.                      AppleLink:    APPLE.BUGS
  17.  
  18. *)
  19.  
  20. (*$TAGS-*)
  21. (*$CALLING PASCAL*)
  22. MODULE MachineExceptions;
  23.  
  24. IMPORT SYSTEM, Types;
  25.  
  26. (* $PUSH*)
  27. (* $ALIGN MAC68K*)
  28. (* $LibExport+*)
  29.     
  30. TYPE
  31.     AreaID* = Types.KernelID;
  32.  
  33. (* Machine Dependent types for PowerPC*: *)
  34.     MachineInformationPowerPC* = RECORD
  35.         CTR*:                    Types.UnsignedWide;
  36.         LR*:                        Types.UnsignedWide;
  37.         PC*:                        Types.UnsignedWide;
  38.         CR*:                        LONGINT;
  39.         XER*:                    LONGINT;
  40.         MSR*:                    LONGINT;
  41.     END;
  42.  
  43.     RegisterInformationPowerPC* = RECORD
  44.         R0*:                        Types.UnsignedWide;
  45.         R1*:                        Types.UnsignedWide;
  46.         R2*:                        Types.UnsignedWide;
  47.         R3*:                        Types.UnsignedWide;
  48.         R4*:                        Types.UnsignedWide;
  49.         R5*:                        Types.UnsignedWide;
  50.         R6*:                        Types.UnsignedWide;
  51.         R7*:                        Types.UnsignedWide;
  52.         R8*:                        Types.UnsignedWide;
  53.         R9*:                        Types.UnsignedWide;
  54.         R10*:                    Types.UnsignedWide;
  55.         R11*:                    Types.UnsignedWide;
  56.         R12*:                    Types.UnsignedWide;
  57.         R13*:                    Types.UnsignedWide;
  58.         R14*:                    Types.UnsignedWide;
  59.         R15*:                    Types.UnsignedWide;
  60.         R16*:                    Types.UnsignedWide;
  61.         R17*:                    Types.UnsignedWide;
  62.         R18*:                    Types.UnsignedWide;
  63.         R19*:                    Types.UnsignedWide;
  64.         R20*:                    Types.UnsignedWide;
  65.         R21*:                    Types.UnsignedWide;
  66.         R22*:                    Types.UnsignedWide;
  67.         R23*:                    Types.UnsignedWide;
  68.         R24*:                    Types.UnsignedWide;
  69.         R25*:                    Types.UnsignedWide;
  70.         R26*:                    Types.UnsignedWide;
  71.         R27*:                    Types.UnsignedWide;
  72.         R28*:                    Types.UnsignedWide;
  73.         R29*:                    Types.UnsignedWide;
  74.         R30*:                    Types.UnsignedWide;
  75.         R31*:                    Types.UnsignedWide;
  76.     END;
  77.  
  78.     FPUInformationPowerPC* = RECORD
  79.         Registers*:                ARRAY 32 (*ΔΔ[0..31]ΔΔ*) OF Types.UnsignedWide;
  80.         FPSCR*:                    LONGINT;
  81.         Reserved*:                LONGINT;
  82.     END;
  83.  
  84.  
  85. CONST
  86.     writeReference*                = 0;
  87.     readReference*                = 1;
  88.     fetchReference*                = 2;
  89.  
  90.     
  91. TYPE
  92.     MemoryReferenceKind* = LONGINT;
  93.  
  94.     MemoryExceptionInformation* = RECORD
  95.         theArea*:                AreaID;
  96.         theAddress*:                Types.LogicalAddress;
  97.         theError*:                Types.OSStatus;
  98.         theReference*:            MemoryReferenceKind;
  99.     END;
  100.  
  101.  
  102. CONST
  103.     unknownException*            = 0;
  104.     illegalInstructionException*    = 1;
  105.     trapException*                = 2;
  106.     accessException*                = 3;
  107.     unmappedMemoryException*        = 4;
  108.     excludedMemoryException*        = 5;
  109.     readOnlyMemoryException*        = 6;
  110.     unresolvablePageFaultException* = 7;
  111.     privilegeViolationException*    = 8;
  112.     traceException*                = 9;
  113.     instructionBreakpointException* = 10;
  114.     dataBreakpointException*        = 11;
  115.     integerException*            = 12;
  116.     floatingPointException*        = 13;
  117.     stackOverflowException*        = 14;
  118.     terminationException*        = 15;
  119.  
  120.     
  121. TYPE
  122.     ExceptionKind* = LONGINT;
  123.  
  124.     ExceptionInfo* = RECORD
  125.         (*ΔΔ CASE INTEGER OF
  126.         0: ( *)
  127.             memoryInfo*:                    POINTER TO MemoryExceptionInformation;
  128.            (*ΔΔ );*)
  129.     END;
  130.  
  131.     ExceptionInformationPowerPC* = RECORD
  132.         theKind*:                ExceptionKind;
  133.         machineState*:            POINTER TO MachineInformationPowerPC;
  134.         registerImage*:            POINTER TO RegisterInformationPowerPC;
  135.         FPUImage*:                POINTER TO FPUInformationPowerPC;
  136.         info*:                    ExceptionInfo;
  137.     END;
  138.  
  139. (*$IF GENERATINGPOWERPC *)
  140.     ExceptionInformation* = ExceptionInformationPowerPC;
  141.  
  142.     MachineInformation* = MachineInformationPowerPC;
  143.  
  144.     RegisterInformation* = RegisterInformationPowerPC;
  145.  
  146.     FPUInformation* = FPUInformationPowerPC;
  147.  
  148. (*$END*)
  149. (* Note*:    An ExceptionHandler is NOT a UniversalProcPtr.
  150.             It must be a native function pointer with NO routine descriptor. *)
  151.     ExceptionHandler* = (*ΔΔ Types.ProcPtr;*) PROCEDURE (VAR theException: ExceptionInformationPowerPC): Types.OSStatus;
  152.  
  153. (* Routine for installing per-process exception handlers *)
  154.  
  155. PROCEDURE InstallExceptionHandler*(theHandler: ExceptionHandler): ExceptionHandler;
  156.     EXTERNAL PASCAL;
  157.  
  158. (* $ALIGN RESET*)
  159. (* $POP*)
  160.  
  161.  END MachineExceptions.
  162.