Annotation of XNU/iokit/Families/IONDRVSupport/IOPEFLoader.h, revision 1.1.1.1

1.1       root        1: /*
                      2:  * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved.
                      3:  *
                      4:  * @APPLE_LICENSE_HEADER_START@
                      5:  * 
                      6:  * The contents of this file constitute Original Code as defined in and
                      7:  * are subject to the Apple Public Source License Version 1.1 (the
                      8:  * "License").  You may not use this file except in compliance with the
                      9:  * License.  Please obtain a copy of the License at
                     10:  * http://www.apple.com/publicsource and read it before using this file.
                     11:  * 
                     12:  * This Original Code and all software distributed under the License are
                     13:  * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
                     14:  * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
                     15:  * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
                     16:  * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT.  Please see the
                     17:  * License for the specific language governing rights and limitations
                     18:  * under the License.
                     19:  * 
                     20:  * @APPLE_LICENSE_HEADER_END@
                     21:  */
                     22: /*
                     23:  * Copyright (c) 1997 Apple Computer, Inc.
                     24:  *
                     25:  *
                     26:  * HISTORY
                     27:  *
                     28:  * sdouglas  22 Oct 97 - first checked in.
                     29:  * sdouglas  21 July 98 - start IOKit
                     30:  * sdouglas  21 July 98 - start IOKit
                     31:  */
                     32: 
                     33: 
                     34: #ifndef _IOKIT_IOPEFLOADER_H
                     35: #define _IOKIT_IOPEFLOADER_H
                     36: 
                     37: 
                     38: #include <IOKit/ndrvsupport/IOMacOSTypes.h>
                     39: 
                     40: #ifdef __cplusplus
                     41: extern "C" {
                     42: #endif
                     43: 
                     44: 
                     45: enum {
                     46:     cfragFirstErrCode           = -2800,   /* The first value in the range of CFM errors.*/
                     47:     cfragContextIDErr           = -2800,   /* The context ID was not valid.*/
                     48:     cfragConnectionIDErr        = -2801,   /* The connection ID was not valid.*/
                     49:     cfragNoSymbolErr            = -2802,   /* The specified symbol was not found.*/
                     50:     cfragNoSectionErr           = -2803,   /* The specified section was not found.*/
                     51:     cfragNoLibraryErr           = -2804,   /* The named library was not found.*/
                     52:     cfragDupRegistrationErr     = -2805,   /* The registration name was already in use.*/
                     53:     cfragFragmentFormatErr      = -2806,   /* A fragment's container format is unknown.*/
                     54:     cfragUnresolvedErr          = -2807,   /* A fragment had "hard" unresolved imports.*/
                     55:     cfragNoPositionErr          = -2808,   /* The registration insertion point was not found.*/
                     56:     cfragNoPrivateMemErr        = -2809,   /* Out of memory for internal bookkeeping.*/
                     57:     cfragNoClientMemErr         = -2810,   /* Out of memory for fragment mapping or section instances.*/
                     58:     cfragNoIDsErr               = -2811,   /* No more CFM IDs for contexts, connections, etc.*/
                     59:     cfragInitOrderErr           = -2812,   /* */
                     60:     cfragImportTooOldErr        = -2813,   /* An import library was too old for a client.*/
                     61:     cfragImportTooNewErr        = -2814,   /* An import library was too new for a client.*/
                     62:     cfragInitLoopErr            = -2815,   /* Circularity in required initialization order.*/
                     63:     cfragInitAtBootErr          = -2816,   /* A boot library has an initialization function.  (System 7 only)*/
                     64:     cfragLibConnErr             = -2817,   /* */
                     65:     cfragCFMStartupErr          = -2818,   /* Internal error during CFM initialization.*/
                     66:     cfragCFMInternalErr         = -2819,   /* An internal inconstistancy has been detected.*/
                     67:     cfragFragmentCorruptErr     = -2820,   /* A fragment's container was corrupt (known format).*/
                     68:     cfragInitFunctionErr        = -2821,   /* A fragment's initialization routine returned an error.*/
                     69:     cfragNoApplicationErr       = -2822,   /* No application member found in the cfrg resource.*/
                     70:     cfragArchitectureErr        = -2823,   /* A fragment has an unacceptable architecture.*/
                     71:     cfragFragmentUsageErr       = -2824,   /* A semantic error in usage of the fragment.*/
                     72:     cfragFileSizeErr            = -2825,   /* A file was too large to be mapped.*/
                     73:     cfragNotClosureErr          = -2826,   /* The closure ID was actually a connection ID.*/
                     74:     cfragNoRegistrationErr      = -2827,   /* The registration name was not found.*/
                     75:     cfragContainerIDErr         = -2828,   /* The fragment container ID was not valid.*/
                     76:     cfragClosureIDErr           = -2829,   /* The closure ID was not valid.*/
                     77:     cfragAbortClosureErr        = -2830    /* Used by notification handlers to abort a closure.*/
                     78: };
                     79: 
                     80: enum {
                     81:     paramErr            = -50,
                     82:     unimpErr            = -4
                     83: };
                     84: 
                     85: 
                     86: typedef UInt32 CFragVersionNumber;
                     87: enum {
                     88:     kNullCFragVersion           = 0,
                     89:     kWildcardCFragVersion       = 0xFFFFFFFF
                     90: };
                     91: 
                     92: typedef UInt8 CFragSymbolClass;
                     93: enum {
                     94:     kCodeCFragSymbol            = 0,
                     95:     kDataCFragSymbol            = 1,
                     96:     kTVectorCFragSymbol         = 2,
                     97:     kTOCCFragSymbol             = 3,
                     98:     kGlueCFragSymbol            = 4
                     99: };
                    100: 
                    101: enum {
                    102:     kUnresolvedCFragSymbolAddress = 0
                    103: };
                    104: 
                    105: typedef UInt32 CFragShortVersionPair;
                    106: #define ComposeCFragShortVersionPair(current,older) (current << 16 | older)
                    107: #define GetCFragShortVersionCurrent(version)        (version >> 16)
                    108: #define GetCFragShortVersionOlder(version)          (version & 0xFFFF)
                    109: 
                    110: 
                    111: enum {
                    112:     kMainCFragSymbolIndex       = -1,
                    113:     kInitCFragSymbolIndex       = -2,
                    114:     kTermCFragSymbolIndex       = -3
                    115: };
                    116: 
                    117: typedef void * PCodeInstance;
                    118: 
                    119: OSStatus
                    120: PCodeOpen( LogicalAddress container, ByteCount containerSize, PCodeInstance * instance );
                    121: OSStatus
                    122: PCodeClose( PCodeInstance instance );
                    123: OSStatus
                    124: PCodeInstantiate( PCodeInstance instance );
                    125: OSStatus
                    126: PCodeFindExport( PCodeInstance instance, const char * symbolName, LogicalAddress * address, CFragSymbolClass * symbolClass );
                    127: OSStatus
                    128: PCodeFindMain( PCodeInstance instance, LogicalAddress * mainAddress );
                    129: 
                    130: 
                    131: struct TVector {
                    132:     LogicalAddress     pc;
                    133:     UInt32             toc;
                    134: };
                    135: typedef struct TVector TVector;
                    136: 
                    137: static __inline__ unsigned int get_R2(void)
                    138: {
                    139:     unsigned int result;
                    140:     __asm__ volatile("mr %0,   r2" : "=r" (result));
                    141:     return result;
                    142: }
                    143: 
                    144: static __inline__ void set_R2(unsigned int val)
                    145: {
                    146:     __asm__ volatile("mr r2,%0" : : "r" (val));
                    147:     return;
                    148: }
                    149: 
                    150: #ifdef __cplusplus
                    151: }
                    152: #endif
                    153: 
                    154: #endif /* ! _IOKIT_IOPEFLOADER_H */
                    155: 

unix.superglobalmegacorp.com

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