|
|
1.1 ! root 1: /* ! 2: * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. ! 3: * ! 4: * @APPLE_LICENSE_HEADER_START@ ! 5: * ! 6: * Portions Copyright (c) 1999 Apple Computer, Inc. All Rights ! 7: * Reserved. This file contains Original Code and/or Modifications of ! 8: * Original Code as defined in and that are subject to the Apple Public ! 9: * Source License Version 1.1 (the "License"). You may not use this file ! 10: * except in compliance with the License. Please obtain a copy of the ! 11: * License at http://www.apple.com/publicsource and read it before using ! 12: * this file. ! 13: * ! 14: * The Original Code and all software distributed under the License are ! 15: * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER ! 16: * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, ! 17: * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, ! 18: * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the ! 19: * License for the specific language governing rights and limitations ! 20: * under the License. ! 21: * ! 22: * @APPLE_LICENSE_HEADER_END@ ! 23: */ ! 24: ! 25: /* ! 26: File: MachineExceptions.h ! 27: ! 28: Contains: Processor Exception Handling Interfaces. ! 29: ! 30: Version: Mac OS 8 ! 31: ! 32: DRI: Jim Murphy ! 33: ! 34: Copyright: � 1993-1998 by Apple Computer, Inc., all rights reserved. ! 35: ! 36: Warning: *** APPLE INTERNAL USE ONLY *** ! 37: This file may contain unreleased API's ! 38: ! 39: BuildInfo: Built by: Naga Pappireddi ! 40: With Interfacer: 3.0d9 (PowerPC native) ! 41: From: MachineExceptions.i ! 42: Revision: 27 ! 43: Dated: 6/15/98 ! 44: Last change by: ALX ! 45: Last comment: Make VMX stuff public. ! 46: ! 47: Bugs: Report bugs to Radar component "System Interfaces", "Latest" ! 48: List the version information (from above) in the Problem Description. ! 49: ! 50: */ ! 51: #ifndef __MACHINEEXCEPTIONS__ ! 52: #define __MACHINEEXCEPTIONS__ ! 53: ! 54: #ifndef __MACTYPES__ ! 55: //naga#include <MacTypes.h> ! 56: #endif ! 57: ! 58: ! 59: ! 60: #if PRAGMA_ONCE ! 61: #pragma once ! 62: #endif ! 63: ! 64: #ifdef __cplusplus ! 65: extern "C" { ! 66: #endif ! 67: ! 68: #if PRAGMA_IMPORT ! 69: #pragma import on ! 70: #endif ! 71: ! 72: #if PRAGMA_STRUCT_ALIGN ! 73: #pragma options align=power ! 74: #elif PRAGMA_STRUCT_PACKPUSH ! 75: #pragma pack(push, 2) ! 76: #elif PRAGMA_STRUCT_PACK ! 77: #pragma pack(2) ! 78: #endif ! 79: ! 80: /* Some basic declarations used throughout the kernel */ ! 81: typedef struct OpaqueAreaID* AreaID; ! 82: //naga#if TARGET_OS_MAC ! 83: /* Machine Dependent types for PowerPC: */ ! 84: ! 85: struct MachineInformationPowerPC { ! 86: UnsignedWide CTR; ! 87: UnsignedWide LR; ! 88: UnsignedWide PC; ! 89: unsigned long CR; ! 90: unsigned long XER; ! 91: unsigned long MSR; ! 92: unsigned long MQ; ! 93: unsigned long ExceptKind; ! 94: unsigned long DSISR; ! 95: UnsignedWide DAR; ! 96: UnsignedWide Reserved; ! 97: }; ! 98: typedef struct MachineInformationPowerPC MachineInformationPowerPC; ! 99: ! 100: struct RegisterInformationPowerPC { ! 101: UnsignedWide R0; ! 102: UnsignedWide R1; ! 103: UnsignedWide R2; ! 104: UnsignedWide R3; ! 105: UnsignedWide R4; ! 106: UnsignedWide R5; ! 107: UnsignedWide R6; ! 108: UnsignedWide R7; ! 109: UnsignedWide R8; ! 110: UnsignedWide R9; ! 111: UnsignedWide R10; ! 112: UnsignedWide R11; ! 113: UnsignedWide R12; ! 114: UnsignedWide R13; ! 115: UnsignedWide R14; ! 116: UnsignedWide R15; ! 117: UnsignedWide R16; ! 118: UnsignedWide R17; ! 119: UnsignedWide R18; ! 120: UnsignedWide R19; ! 121: UnsignedWide R20; ! 122: UnsignedWide R21; ! 123: UnsignedWide R22; ! 124: UnsignedWide R23; ! 125: UnsignedWide R24; ! 126: UnsignedWide R25; ! 127: UnsignedWide R26; ! 128: UnsignedWide R27; ! 129: UnsignedWide R28; ! 130: UnsignedWide R29; ! 131: UnsignedWide R30; ! 132: UnsignedWide R31; ! 133: }; ! 134: typedef struct RegisterInformationPowerPC RegisterInformationPowerPC; ! 135: ! 136: struct FPUInformationPowerPC { ! 137: UnsignedWide Registers[32]; ! 138: unsigned long FPSCR; ! 139: unsigned long Reserved; ! 140: }; ! 141: typedef struct FPUInformationPowerPC FPUInformationPowerPC; ! 142: ! 143: union Vector128 { ! 144: #ifdef __VEC__ ! 145: vector unsigned long v; ! 146: #endif ! 147: unsigned long l[4]; ! 148: unsigned short s[8]; ! 149: unsigned char c[16]; ! 150: }; ! 151: typedef union Vector128 Vector128; ! 152: ! 153: struct VectorInformationPowerPC { ! 154: Vector128 Registers[32]; ! 155: Vector128 VSCR; ! 156: UInt32 VRsave; ! 157: }; ! 158: typedef struct VectorInformationPowerPC VectorInformationPowerPC; ! 159: /* Exception related declarations */ ! 160: ! 161: enum { ! 162: kWriteReference = 0, ! 163: kReadReference = 1, ! 164: kFetchReference = 2, ! 165: writeReference = kWriteReference, /* Obsolete name*/ ! 166: readReference = kReadReference, /* Obsolete name*/ ! 167: fetchReference = kFetchReference /* Obsolete name*/ ! 168: }; ! 169: ! 170: ! 171: typedef unsigned long MemoryReferenceKind; ! 172: ! 173: struct MemoryExceptionInformation { ! 174: AreaID theArea; ! 175: LogicalAddress theAddress; ! 176: OSStatus theError; ! 177: MemoryReferenceKind theReference; ! 178: }; ! 179: typedef struct MemoryExceptionInformation MemoryExceptionInformation; ! 180: ! 181: enum { ! 182: kUnknownException = 0, ! 183: kIllegalInstructionException = 1, ! 184: kTrapException = 2, ! 185: kAccessException = 3, ! 186: kUnmappedMemoryException = 4, ! 187: kExcludedMemoryException = 5, ! 188: kReadOnlyMemoryException = 6, ! 189: kUnresolvablePageFaultException = 7, ! 190: kPrivilegeViolationException = 8, ! 191: kTraceException = 9, ! 192: kInstructionBreakpointException = 10, ! 193: kDataBreakpointException = 11, ! 194: kIntegerException = 12, ! 195: kFloatingPointException = 13, ! 196: kStackOverflowException = 14, ! 197: kTaskTerminationException = 15, ! 198: kTaskCreationException = 16 ! 199: }; ! 200: ! 201: #if OLDROUTINENAMES ! 202: ! 203: enum { ! 204: unknownException = kUnknownException, /* Obsolete name*/ ! 205: illegalInstructionException = kIllegalInstructionException, /* Obsolete name*/ ! 206: trapException = kTrapException, /* Obsolete name*/ ! 207: accessException = kAccessException, /* Obsolete name*/ ! 208: unmappedMemoryException = kUnmappedMemoryException, /* Obsolete name*/ ! 209: excludedMemoryException = kExcludedMemoryException, /* Obsolete name*/ ! 210: readOnlyMemoryException = kReadOnlyMemoryException, /* Obsolete name*/ ! 211: unresolvablePageFaultException = kUnresolvablePageFaultException, /* Obsolete name*/ ! 212: privilegeViolationException = kPrivilegeViolationException, /* Obsolete name*/ ! 213: traceException = kTraceException, /* Obsolete name*/ ! 214: instructionBreakpointException = kInstructionBreakpointException, /* Obsolete name*/ ! 215: dataBreakpointException = kDataBreakpointException, /* Obsolete name*/ ! 216: integerException = kIntegerException, /* Obsolete name*/ ! 217: floatingPointException = kFloatingPointException, /* Obsolete name*/ ! 218: stackOverflowException = kStackOverflowException, /* Obsolete name*/ ! 219: terminationException = kTaskTerminationException, /* Obsolete name*/ ! 220: kTerminationException = kTaskTerminationException /* Obsolete name*/ ! 221: }; ! 222: ! 223: #endif /* OLDROUTINENAMES */ ! 224: ! 225: ! 226: typedef unsigned long ExceptionKind; ! 227: ! 228: union ExceptionInfo { ! 229: MemoryExceptionInformation * memoryInfo; ! 230: }; ! 231: typedef union ExceptionInfo ExceptionInfo; ! 232: ! 233: struct ExceptionInformationPowerPC { ! 234: ExceptionKind theKind; ! 235: MachineInformationPowerPC * machineState; ! 236: RegisterInformationPowerPC * registerImage; ! 237: FPUInformationPowerPC * FPUImage; ! 238: ExceptionInfo info; ! 239: VectorInformationPowerPC * vectorImage; ! 240: }; ! 241: typedef struct ExceptionInformationPowerPC ExceptionInformationPowerPC; ! 242: ! 243: typedef ExceptionInformationPowerPC ExceptionInformation; ! 244: typedef MachineInformationPowerPC MachineInformation; ! 245: typedef RegisterInformationPowerPC RegisterInformation; ! 246: typedef FPUInformationPowerPC FPUInformation; ! 247: typedef VectorInformationPowerPC VectorInformation; ! 248: /* ! 249: Note: An ExceptionHandler is NOT a UniversalProcPtr. ! 250: It must be a PowerPC function pointer with NO routine descriptor. ! 251: */ ! 252: typedef CALLBACK_API_C( OSStatus , ExceptionHandler )(ExceptionInformationPowerPC *theException); ! 253: /* Routine for installing per-process exception handlers */ ! 254: EXTERN_API( ExceptionHandler ) InstallExceptionHandler(ExceptionHandler theHandler); ! 255: ! 256: //#endif /* TARGET_OS_MAC */ ! 257: ! 258: ! 259: ! 260: #if PRAGMA_STRUCT_ALIGN ! 261: #pragma options align=reset ! 262: #elif PRAGMA_STRUCT_PACKPUSH ! 263: #pragma pack(pop) ! 264: #elif PRAGMA_STRUCT_PACK ! 265: #pragma pack() ! 266: #endif ! 267: ! 268: #ifdef PRAGMA_IMPORT_OFF ! 269: #pragma import off ! 270: #elif PRAGMA_IMPORT ! 271: #pragma import reset ! 272: #endif ! 273: ! 274: #ifdef __cplusplus ! 275: } ! 276: #endif ! 277: ! 278: #endif /* __MACHINEEXCEPTIONS__ */ ! 279:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.