2 * BK Id: SCCS/s.of1275.h 1.6 05/18/01 15:16:42 cort
4 /* 6.3.2.1 Client interface */
6 void of_init(void *handler
);
9 typedef struct _of_test_service
{
19 int of_test(const char *name
, int *missing
);
22 /* 6.3.2.2 Device tree */
25 typedef struct _of_peer_service
{
35 int of_peer(int phandle
, int *sibling_phandle
);
38 typedef struct _of_child_service
{
48 int of_child(int phandle
, int *child_phandle
);
51 typedef struct _of_parent_service
{
61 int of_child(int phandle
, int *parent_phandle
);
64 typedef struct _of_instance_to_package_service
{
72 } of_instance_to_package_service
;
74 int of_instance_to_package(int ihandle
, int *phandle
);
77 typedef struct _of_getproplen_service
{
86 } of_getproplen_service
;
88 int of_getproplen(int phandle
, const char *name
, int *proplen
);
91 typedef struct _of_getprop_service
{
102 } of_getprop_service
;
104 int of_getprop(int phandle
, const char *name
, void *buf
, int buflen
,
108 typedef struct _of_nextprop_service
{
114 const char *previous
;
118 } of_nextprop_service
;
120 int of_nextprop(int phandle
, const char *previous
, void *buf
, int *flag
);
123 typedef struct _of_setprop_service
{
134 } of_setprop_service
;
136 int of_setprop(int phandle
, const char *name
, void *buf
, int len
, int *size
);
139 typedef struct _of_canon_service
{
144 const char *device_specifier
;
151 int of_canon(const char *device_specifier
, void *buf
, int buflen
, int *length
);
154 typedef struct _of_finddevice_service
{
159 const char *device_specifier
;
162 } of_finddevice_service
;
164 int of_finddevice(const char *device_specifier
, int *phandle
);
167 typedef struct _of_instance_to_path_service
{
177 } of_instance_to_path_service
;
179 int of_instance_to_path(int ihandle
, void *buf
, int buflen
, int *length
);
182 typedef struct _of_package_to_path_service
{
192 } of_package_to_path_service
;
194 int of_package_to_path(int phandle
, void *buf
, int buflen
, int *length
);
197 typedef struct _of_call_method_service
{
206 } of_call_method_service
;
208 int of_call_method(const char *method
, int ihandle
, ...);
211 /* 6.3.2.3 Device I/O */
214 typedef struct _of_open_service
{
219 const char *device_specifier
;
224 int of_open(const char *device_specifier
,
228 typedef struct _of_close_service
{
237 int of_close(int ihandle
);
240 typedef struct _of_read_service
{
252 int of_read(int ihandle
, void *addr
, int len
, int *actual
);
255 typedef struct _of_write_service
{
267 int of_write(int ihandle
, void *addr
, int len
, int *actual
);
270 typedef struct _of_seek_service
{
282 int of_seek(int ihandle
, int pos_hi
, int pos_lo
, int *status
);
288 typedef struct _of_claim_service
{
300 int of_claim(void *virt
, int size
, int align
, void **baseaddr
);
303 typedef struct _of_release_service
{
312 } of_release_service
;
314 int of_release(void *virt
, int size
);
317 /* 6.3.2.5 Control transfer */
320 typedef struct _of_boot_service
{
325 const char *bootspec
;
329 int of_boot(const char *bootspec
);
332 typedef struct _of_enter_service
{
343 typedef struct _of_exit_service
{
354 typedef struct _of_chain_service
{
367 int of_chain(void *virt
, int size
, void *entry
, void *args
, int len
);
370 /* 6.3.2.6 User interface */
373 typedef struct _of_interpret_service
{
383 } of_interpret_service
;
385 int of_interpret(const char *arg
, ...);
388 typedef struct _of_set_callback_service
{
396 } of_set_callback_service
;
398 int of_set_callback(void *newfunc
, void **oldfunc
);
401 typedef struct _of_set_symbol_lookup_service
{
409 } of_set_symbol_lookup_service
;
411 int of_set_symbol_lookup(void *sym_to_value
, void *value_to_sym
);
417 typedef struct _of_milliseconds_service
{
424 } of_milliseconds_service
;
426 int of_milliseconds(int *ms
);