]>
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  * 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. 
  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 
  20  * @APPLE_LICENSE_HEADER_END@ 
  23  *  ci.h - Headers for the OF Client Interface Library 
  25  *  Copyright (c) 1998-2002 Apple Computer, Inc. 
  33 #define kCINoError (0) 
  45     struct {                    // nArgs=1 + args, nReturns=1 + rets 
  47       CICell     cells
[6 + 1 + 6]; 
  50     struct {                    // nArgs=2 + args, nReturns=1 + rets 
  53       CICell     cells
[6 + 1 + 6]; 
  56     struct {                    // nArgs=1, nReturns=1  ( device-specifier -- ihandle ) 
  57       char *devSpec
;            // IN parameter 
  58       CICell ihandle
;           // RETURN value 
  61     struct {                    // nArgs=1, nReturns=0  ( ihandle -- ) 
  62       CICell ihandle
;           // IN parameter 
  65     struct {                    // nArgs=3, nReturns=1 ( ihandle addr length -- actual ) 
  72     struct {                    // nArgs=3, nReturns=1 ( ihandle addr length -- actual ) 
  79     struct {                    // nArgs=3, nReturns=1 ( ihandle pos.high pos.low -- result ) 
  86     struct {                    // nArgs=3, nReturns=1 
  93     struct {                    // nArgs=2, nReturns=0 
  98     struct {                    // nArgs=1, nReturns=1  ( phandle -- peer-phandle ) 
  99       CICell phandle
;           // IN parameter 
 100       CICell peerPhandle
;       // RETURN value 
 103     struct {                    // nArgs=1, nReturns=1  ( phandle -- child-phandle ) 
 104       CICell phandle
;           // IN parameter 
 105       CICell childPhandle
;      // RETURN value 
 108     struct {                    // nArgs=1, nReturns=1  ( phandle -- parent-phandle ) 
 109       CICell childPhandle
;      // IN parameter 
 110       CICell parentPhandle
;     // RETURN value 
 113     struct {                    // nArgs=1, nReturns=1  ( devSpec -- phandle ) 
 114       char *devSpec
;            // IN parameter 
 115       CICell phandle
;           // RETURN value 
 118     struct {                    // nArgs=3, nReturns=1 ( ihandle buf buflen -- length ) 
 119       CICell ihandle
;           // IN ihandle 
 121       CICell buflen
;            // IN buflen 
 122       CICell length
;            // RETURN length 
 125     struct {                    // nArgs=1, nReturns=1 ( ihandle -- phandle ) 
 126       CICell ihandle
;           // IN ihandle 
 127       CICell phandle
;           // RETURN phandle 
 130     struct {                    // nArgs=3, nReturns=1 ( phandle buf buflen -- length ) 
 131       CICell phandle
;           // IN phandle 
 133       CICell buflen
;            // IN buflen 
 134       CICell length
;            // RETURN length 
 137     struct {                    // nArgs=2, nReturns=1  ( phandle name -- size ) 
 138       CICell phandle
;           // IN parameter 
 139       char   *name
;             // IN parameter 
 140       CICell size
;              // RETURN value 
 143     struct {                    // nArgs=4, nReturns=1  ( phandle name buf buflen -- size ) 
 144       CICell phandle
;           // IN parameter 
 145       char   *name
;             // IN parameter 
 146       char   *buf
;              // IN parameter 
 147       CICell buflen
;            // IN parameter 
 148       CICell size
;              // RETURN value 
 151     struct {                    // nArgs=3, nReturns=1  ( phandle previous buf -- flag ) 
 152       CICell phandle
;           // IN parameter 
 153       char *previous
;           // IN parameter 
 154       char *buf
;                // IN parameter 
 155       CICell flag
;              // RETURN value 
 158     struct {                    // nArgs=4, nReturns=1  ( phandle name buf buflen -- size ) 
 159       CICell phandle
;           // IN parameter 
 160       char *name
;               // IN parameter 
 161       char *buf
;                // IN parameter 
 162       CICell buflen
;            // IN parameter 
 163       CICell size
;              // RETURN value 
 166     struct {                    // nArgs=1, nReturns=0 
 171 typedef struct CIArgs CIArgs
; 
 173 typedef long (*ClientInterfacePtr
)(CIArgs 
*args
); 
 176 long InitCI(ClientInterfacePtr ciPtr
); 
 177 long CallCI(CIArgs 
*ciArgsPtr
); 
 180 CICell 
Peer(CICell phandle
); 
 181 CICell 
Child(CICell phandle
); 
 182 CICell 
Parent(CICell phandle
); 
 183 CICell 
FindDevice(char *devSpec
); 
 184 CICell 
InstanceToPath(CICell ihandle
, char *buf
, long buflen
); 
 185 CICell 
InstanceToPackage(CICell ihandle
); 
 186 CICell 
PackageToPath(CICell phandle
, char *buf
, long buflen
); 
 187 CICell 
GetPropLen(CICell phandle
, char *name
); 
 188 CICell 
GetProp(CICell phandle
, char *name
, char *buf
, long buflen
); 
 189 CICell 
NextProp(CICell phandle
, char *previous
, char *buf
); 
 190 CICell 
SetProp(CICell phandle
, char *name
, char *buf
, long buflen
); 
 193 CICell 
Open(char *devSpec
); 
 194 void   Close(CICell ihandle
); 
 195 CICell 
Read(CICell ihandle
, long addr
, long length
); 
 196 CICell 
Write(CICell ihandle
, long addr
, long length
); 
 197 CICell 
Seek(CICell ihandle
, long long position
); 
 200 long CallMethod(long args
, long rets
, CICell iHandle
, const char *method
, ...); 
 203 CICell 
Claim(CICell virt
, CICell size
, CICell align
); 
 204 void   Release(CICell virt
, CICell size
); 
 207 void Boot(char *bootspec
); 
 213 long Interpret(long args
, long rets
, const char *forthString
, ...); 
 215 #endif /* ! _BOOTX_CI_H_ */