]>
git.saurik.com Git - apple/bootx.git/blob - bootx.tproj/include.subproj/ci.h
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
8 * This file contains Original Code and/or Modifications of Original Code
9 * as defined in and that are subject to the Apple Public Source License
10 * Version 2.0 (the 'License'). You may not use this file except in
11 * compliance with the License. Please obtain a copy of the License at
12 * http://www.opensource.apple.com/apsl/ and read it before using this
15 * The Original Code and all software distributed under the License are
16 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
17 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
18 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
20 * Please see the License for the specific language governing rights and
21 * limitations under the License.
23 * @APPLE_LICENSE_HEADER_END@
26 * ci.h - Headers for the OF Client Interface Library
28 * Copyright (c) 1998-2002 Apple Computer, Inc.
36 #define kCINoError (0)
48 struct { // nArgs=1 + args, nReturns=1 + rets
50 CICell cells
[6 + 1 + 6];
53 struct { // nArgs=2 + args, nReturns=1 + rets
56 CICell cells
[6 + 1 + 6];
59 struct { // nArgs=1, nReturns=1 ( device-specifier -- ihandle )
60 char *devSpec
; // IN parameter
61 CICell ihandle
; // RETURN value
64 struct { // nArgs=1, nReturns=0 ( ihandle -- )
65 CICell ihandle
; // IN parameter
68 struct { // nArgs=3, nReturns=1 ( ihandle addr length -- actual )
75 struct { // nArgs=3, nReturns=1 ( ihandle addr length -- actual )
82 struct { // nArgs=3, nReturns=1 ( ihandle pos.high pos.low -- result )
89 struct { // nArgs=3, nReturns=1
96 struct { // nArgs=2, nReturns=0
101 struct { // nArgs=1, nReturns=1 ( phandle -- peer-phandle )
102 CICell phandle
; // IN parameter
103 CICell peerPhandle
; // RETURN value
106 struct { // nArgs=1, nReturns=1 ( phandle -- child-phandle )
107 CICell phandle
; // IN parameter
108 CICell childPhandle
; // RETURN value
111 struct { // nArgs=1, nReturns=1 ( phandle -- parent-phandle )
112 CICell childPhandle
; // IN parameter
113 CICell parentPhandle
; // RETURN value
116 struct { // nArgs=1, nReturns=1 ( devSpec -- phandle )
117 char *devSpec
; // IN parameter
118 CICell phandle
; // RETURN value
121 struct { // nArgs=3, nReturns=1 ( ihandle buf buflen -- length )
122 CICell ihandle
; // IN ihandle
124 CICell buflen
; // IN buflen
125 CICell length
; // RETURN length
128 struct { // nArgs=1, nReturns=1 ( ihandle -- phandle )
129 CICell ihandle
; // IN ihandle
130 CICell phandle
; // RETURN phandle
133 struct { // nArgs=3, nReturns=1 ( phandle buf buflen -- length )
134 CICell phandle
; // IN phandle
136 CICell buflen
; // IN buflen
137 CICell length
; // RETURN length
140 struct { // nArgs=2, nReturns=1 ( phandle name -- size )
141 CICell phandle
; // IN parameter
142 char *name
; // IN parameter
143 CICell size
; // RETURN value
146 struct { // nArgs=4, nReturns=1 ( phandle name buf buflen -- size )
147 CICell phandle
; // IN parameter
148 char *name
; // IN parameter
149 char *buf
; // IN parameter
150 CICell buflen
; // IN parameter
151 CICell size
; // RETURN value
154 struct { // nArgs=3, nReturns=1 ( phandle previous buf -- flag )
155 CICell phandle
; // IN parameter
156 char *previous
; // IN parameter
157 char *buf
; // IN parameter
158 CICell flag
; // RETURN value
161 struct { // nArgs=4, nReturns=1 ( phandle name buf buflen -- size )
162 CICell phandle
; // IN parameter
163 char *name
; // IN parameter
164 char *buf
; // IN parameter
165 CICell buflen
; // IN parameter
166 CICell size
; // RETURN value
169 struct { // nArgs=1, nReturns=0
174 typedef struct CIArgs CIArgs
;
176 typedef long (*ClientInterfacePtr
)(CIArgs
*args
);
179 long InitCI(ClientInterfacePtr ciPtr
);
180 long CallCI(CIArgs
*ciArgsPtr
);
183 CICell
Peer(CICell phandle
);
184 CICell
Child(CICell phandle
);
185 CICell
Parent(CICell phandle
);
186 CICell
FindDevice(char *devSpec
);
187 CICell
InstanceToPath(CICell ihandle
, char *buf
, long buflen
);
188 CICell
InstanceToPackage(CICell ihandle
);
189 CICell
PackageToPath(CICell phandle
, char *buf
, long buflen
);
190 CICell
GetPropLen(CICell phandle
, char *name
);
191 CICell
GetProp(CICell phandle
, char *name
, char *buf
, long buflen
);
192 CICell
NextProp(CICell phandle
, char *previous
, char *buf
);
193 CICell
SetProp(CICell phandle
, char *name
, char *buf
, long buflen
);
196 CICell
Open(char *devSpec
);
197 void Close(CICell ihandle
);
198 CICell
Read(CICell ihandle
, long addr
, long length
);
199 CICell
Write(CICell ihandle
, long addr
, long length
);
200 CICell
Seek(CICell ihandle
, long long position
);
203 long CallMethod(long args
, long rets
, CICell iHandle
, const char *method
, ...);
206 CICell
Claim(CICell virt
, CICell size
, CICell align
);
207 void Release(CICell virt
, CICell size
);
210 void Boot(char *bootspec
);
216 long Interpret(long args
, long rets
, const char *forthString
, ...);
218 #endif /* ! _BOOTX_CI_H_ */