|
|
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: * Copyright (c) 1997 Apple Computer, Inc.
26: *
27: *
28: * HISTORY
29: *
30: * Simon Douglas 22 Oct 97
31: * - first checked in.
32: */
33:
34:
35: #ifndef __IOPEFLOADER__
36: #define __IOPEFLOADER__
37:
38: #include <driverkit/ppc/IOMacOSTypes.h>
39:
40: enum {
41: cfragFirstErrCode = -2800, /* The first value in the range of CFM errors.*/
42: cfragContextIDErr = -2800, /* The context ID was not valid.*/
43: cfragConnectionIDErr = -2801, /* The connection ID was not valid.*/
44: cfragNoSymbolErr = -2802, /* The specified symbol was not found.*/
45: cfragNoSectionErr = -2803, /* The specified section was not found.*/
46: cfragNoLibraryErr = -2804, /* The named library was not found.*/
47: cfragDupRegistrationErr = -2805, /* The registration name was already in use.*/
48: cfragFragmentFormatErr = -2806, /* A fragment's container format is unknown.*/
49: cfragUnresolvedErr = -2807, /* A fragment had "hard" unresolved imports.*/
50: cfragNoPositionErr = -2808, /* The registration insertion point was not found.*/
51: cfragNoPrivateMemErr = -2809, /* Out of memory for internal bookkeeping.*/
52: cfragNoClientMemErr = -2810, /* Out of memory for fragment mapping or section instances.*/
53: cfragNoIDsErr = -2811, /* No more CFM IDs for contexts, connections, etc.*/
54: cfragInitOrderErr = -2812, /* */
55: cfragImportTooOldErr = -2813, /* An import library was too old for a client.*/
56: cfragImportTooNewErr = -2814, /* An import library was too new for a client.*/
57: cfragInitLoopErr = -2815, /* Circularity in required initialization order.*/
58: cfragInitAtBootErr = -2816, /* A boot library has an initialization function. (System 7 only)*/
59: cfragLibConnErr = -2817, /* */
60: cfragCFMStartupErr = -2818, /* Internal error during CFM initialization.*/
61: cfragCFMInternalErr = -2819, /* An internal inconstistancy has been detected.*/
62: cfragFragmentCorruptErr = -2820, /* A fragment's container was corrupt (known format).*/
63: cfragInitFunctionErr = -2821, /* A fragment's initialization routine returned an error.*/
64: cfragNoApplicationErr = -2822, /* No application member found in the cfrg resource.*/
65: cfragArchitectureErr = -2823, /* A fragment has an unacceptable architecture.*/
66: cfragFragmentUsageErr = -2824, /* A semantic error in usage of the fragment.*/
67: cfragFileSizeErr = -2825, /* A file was too large to be mapped.*/
68: cfragNotClosureErr = -2826, /* The closure ID was actually a connection ID.*/
69: cfragNoRegistrationErr = -2827, /* The registration name was not found.*/
70: cfragContainerIDErr = -2828, /* The fragment container ID was not valid.*/
71: cfragClosureIDErr = -2829, /* The closure ID was not valid.*/
72: cfragAbortClosureErr = -2830 /* Used by notification handlers to abort a closure.*/
73: };
74:
75: enum {
76: paramErr = -50,
77: unimpErr = -4
78: };
79:
80:
81: typedef UInt32 CFragVersionNumber;
82: enum {
83: kNullCFragVersion = 0,
84: kWildcardCFragVersion = 0xFFFFFFFF
85: };
86:
87: typedef UInt8 CFragSymbolClass;
88: enum {
89: kCodeCFragSymbol = 0,
90: kDataCFragSymbol = 1,
91: kTVectorCFragSymbol = 2,
92: kTOCCFragSymbol = 3,
93: kGlueCFragSymbol = 4
94: };
95:
96: enum {
97: kUnresolvedCFragSymbolAddress = 0
98: };
99:
100: typedef UInt32 CFragShortVersionPair;
101: #define ComposeCFragShortVersionPair(current,older) (current << 16 | older)
102: #define GetCFragShortVersionCurrent(version) (version >> 16)
103: #define GetCFragShortVersionOlder(version) (version & 0xFFFF)
104:
105:
106: enum {
107: kMainCFragSymbolIndex = -1,
108: kInitCFragSymbolIndex = -2,
109: kTermCFragSymbolIndex = -3
110: };
111:
112: typedef void * PCodeInstance;
113:
114: OSStatus
115: PCodeOpen( LogicalAddress container, ByteCount containerSize, PCodeInstance * instance );
116: OSStatus
117: PCodeClose( PCodeInstance instance );
118: OSStatus
119: PCodeInstantiate( PCodeInstance instance );
120: OSStatus
121: PCodeFindExport( PCodeInstance instance, const char * symbolName, LogicalAddress * address, CFragSymbolClass * symbolClass );
122: OSStatus
123: PCodeFindMain( PCodeInstance instance, LogicalAddress * mainAddress );
124:
125:
126: struct TVector {
127: LogicalAddress pc;
128: UInt32 toc;
129: };
130: typedef struct TVector TVector;
131:
132: static __inline__ unsigned int get_R2(void)
133: {
134: unsigned int result;
135: __asm__ volatile("mr %0, r2" : "=r" (result));
136: return result;
137: }
138:
139: static __inline__ void set_R2(unsigned int val)
140: {
141: __asm__ volatile("mr r2,%0" : : "r" (val));
142: return;
143: }
144:
145: #endif /* __IOPEFLOADER__ */
146:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.