Annotation of kernel/machdep/ppc/PseudoKernel.h, revision 1.1.1.1

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:           PseudoKernelPriv.h
                     27: 
                     28:        Contains:       Interfaces for the TruBlue environment's PseudoKernel
                     29: 
                     30:        Version:        Rhapsody
                     31: 
                     32:        Copyright:      ) 1996-1997 by Apple Computer, Inc., all rights reserved.
                     33: 
                     34:        File Ownership:
                     35: 
                     36:                DRI:            Bob Abeles
                     37: 
                     38:                Other Contact:  Jeff Robbin
                     39: 
                     40:                Technology:     TruBlue& Virtual Machine
                     41: 
                     42:        Writers:
                     43: 
                     44:                (JM3)   Jim Murphy
                     45:                (BEA)   Bob Abeles
                     46: 
                     47:        Change History (most recent first):
                     48: 
                     49: */
                     50: 
                     51: 
                     52: typedef unsigned char  UInt8;
                     53: typedef unsigned short UInt16;
                     54: typedef unsigned long  UInt32;
                     55: 
                     56: 
                     57: /* Support firmware CallPseudoKernel architectural extension */
                     58: 
                     59: struct CallPseudoKernelDescriptor {
                     60:        UInt32                          pc;
                     61:        UInt32                          gpr0;
                     62:        UInt32                          intControlAddr;
                     63:        UInt32                          newState;
                     64:        UInt32                          intStateMask;
                     65:        UInt32                          intCR2Mask;
                     66:        UInt32                          intCR2Shift;
                     67:        UInt32                          sysContextState;
                     68: };
                     69: typedef struct CallPseudoKernelDescriptor CallPseudoKernelDescriptor;
                     70: typedef CallPseudoKernelDescriptor * CallPseudoKernelDescriptorPtr;
                     71: typedef CallPseudoKernelDescriptor CPKD_t;
                     72: 
                     73: 
                     74: 
                     75: /* Support firmware ExitPseudoKernel architectural extension */
                     76: 
                     77: struct ExitPseudoKernelDescriptor {
                     78:        UInt32                          pc;
                     79:        UInt32                          sp;
                     80:        UInt32                          gpr0;
                     81:        UInt32                          gpr3;
                     82:        UInt32                          cr;
                     83:        UInt32                          intControlAddr;
                     84:        UInt32                          newState;
                     85:        UInt32                          intStateMask;
                     86:        UInt32                          intCR2Mask;
                     87:        UInt32                          intCR2Shift;
                     88:        UInt32                          sysContextState;
                     89:        UInt32                          intPendingMask;
                     90:        UInt32                          intPendingPC;
                     91:        UInt32                          msrUpdate;
                     92: };
                     93: typedef struct ExitPseudoKernelDescriptor ExitPseudoKernelDescriptor;
                     94: typedef ExitPseudoKernelDescriptor * ExitPseudoKernelDescriptorPtr;
                     95: typedef ExitPseudoKernelDescriptor EPKD_t;
                     96: 
                     97: 
                     98: //
                     99: //     EmulatorDescriptor
                    100: //
                    101: //     Emulator image descriptor record appended to the 68K emulator
                    102: //     image by the BootPowerPC project. 
                    103: //
                    104: struct EmulatorDescriptor {
                    105:        UInt8           regMap[16];             // table mapping 68K D0..D7, A0..A7 register to PowerPC registers
                    106:        UInt32          bootstrapVersionOffset; // offset within emulator data page of the bootstrap version string
                    107:        UInt32          ecbOffset;              // offset within emulator data page of the ECB
                    108:        UInt32          intModeLevelOffset;     // offset within emulator data page of the interrupt mode level
                    109:        UInt32          entryAddress;           // offset within text of the emulator's main entry point
                    110:        UInt32          kcallTrapTableOffset;   // offset within text of the nanokernel(!) call trap table
                    111:        UInt32          postIntMask;            // post interrupt mask
                    112:        UInt32          clearIntMask;           // clear interrupt mask
                    113:        UInt32          testIntMask;            // test interrupt mask
                    114:        UInt32          codeSize;               // total size of emulator object code (interpretive + DR)
                    115:        UInt32          hashTableSize;          // size of DR emulator's hash table
                    116:        UInt32          drCodeStartOffset;      // offset within text of the DR emulator's object code
                    117:        UInt32          drInitOffset;           // offset within DR emulator of its initialization entry point
                    118:        UInt32          drAllocateCache;        // offset within DR emulator of its cache allocation entry point
                    119:        UInt32          dispatchTableOffset;    // offset within text of the encoded instruction dispatch table 
                    120: };
                    121: typedef struct EmulatorDescriptor EmulatorDescriptor;
                    122: typedef EmulatorDescriptor *EmulatorDescriptorPtr;
                    123: 
                    124:        
                    125: enum {
                    126:                                                                                        // The following define the UInt32 gInterruptState
                    127:        kInUninitialized        =       0,                      // State not yet initialized
                    128:        kInPseudoKernel         =       1,                      // Currently executing within pseudo kernel
                    129:        kInSystemContext        =       2,                      // Currently executing within the system (emulator) context
                    130:        kInAlternateContext     =       3,                      // Currently executing within an alternate (native) context
                    131:        kInExceptionHandler     =       4,                      // Currently executing an exception handler
                    132:        kOutsideBlue            =       5,                      // Currently executing outside of the blue box
                    133: 
                    134:        kInterruptStateMask     =       0x000F0000,     // Mask to extract interrupt state from gInterruptState
                    135:        kInterruptStateShift    =       16,                     // Shift count to align interrupt state
                    136: 
                    137:        kBackupCR2Mask          =       0x0000000F,     // Mask to extract backup CR2 from gInterruptState
                    138:        kCR2ToBackupShift       =       31-11,          // Shift count to align CR2 into the backup CR2 of gInterruptState
                    139:                                                                                        //  (and vice versa)
                    140:        kCR2Mask                =       0x00F00000  // Mask to extract CR2 from the PPC CR register 
                    141: };
                    142: 
                    143: 
                    144: enum {
                    145:        kcReturnFromException           = 0,    
                    146:        kcRunAlternateContext           = 1,
                    147:        kcResetSystem                           = 2,
                    148:        kcVMDispatch                            = 3,
                    149:        kcPrioritizeInterrupts          = 4,
                    150:        kcPowerDispatch                         = 5,
                    151:        kcRTASDispatch                          = 6,
                    152:        kcGetAdapterProcPtrsPPC         = 12,
                    153:        kcGetAdapterProcPtrs            = 13,
                    154:        kcCallAdapterProc                       = 14,
                    155:        kcSystemCrash                           = 15
                    156: };

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.