1 /* OpenFirmware interface */
4 /* 6.3.2.1 Client interface */
7 typedef struct _of1275_test_service {
15 } of1275_test_service;
17 int of1275_test(const char *name, int *missing);
20 /* 6.3.2.2 Device tree */
23 typedef struct _of1275_peer_service {
31 } of1275_peer_service;
33 int of1275_peer(int phandle, int *sibling_phandle);
36 typedef struct _of1275_child_service {
44 } of1275_child_service;
46 int of1275_child(int phandle, int *child_phandle);
49 typedef struct _of1275_parent_service {
57 } of1275_parent_service;
59 int of1275_child(int phandle, int *parent_phandle);
62 typedef struct _of1275_instance_to_package_service {
70 } of1275_instance_to_package_service;
72 int of1275_instance_to_package(int ihandle, int *phandle);
75 typedef struct _of1275_getproplen_service {
84 } of1275_getproplen_service;
86 int of1275_getproplen(int phandle, const char *name, int *proplen);
89 typedef struct _of1275_getprop_service {
100 } of1275_getprop_service;
102 int of1275_getprop(int phandle, const char *name, void *buf, int buflen,
106 typedef struct _of1275_nextprop_service {
112 const char *previous;
116 } of1275_nextprop_service;
118 int of1275_nextprop(int phandle, const char *previous, void *buf,
122 typedef struct _of1275_setprop_service {
133 } of1275_setprop_service;
135 int of1275_setprop(int phandle, const char *name, void *buf, int len,
139 typedef struct _of1275_canon_service {
144 const char *device_specifier;
149 } of1275_canon_service;
151 int of1275_canon(const char *device_specifier, void *buf, int buflen,
155 typedef struct _of1275_finddevice_service {
160 const char *device_specifier;
163 } of1275_finddevice_service;
165 int of1275_finddevice(const char *device_specifier, int *phandle);
168 typedef struct _of1275_instance_to_path_service {
178 } of1275_instance_to_path_service;
180 int of1275_instance_to_path(int ihandle, void *buf, int buflen,
184 typedef struct _of1275_package_to_path_service {
194 } of1275_package_to_path_service;
196 int of1275_package_to_path(int phandle, void *buf, int buflen,
200 typedef struct _of1275_call_method_service {
209 } of1275_call_method_service;
211 int of1275_call_method(const char *method, int ihandle, ...);
214 /* 6.3.2.3 Device I/O */
217 typedef struct _of1275_open_service {
222 const char *device_specifier;
225 } of1275_open_service;
227 int of1275_open(const char *device_specifier, int *ihandle);
230 typedef struct _of1275_close_service {
237 } of1275_close_service;
239 int of1275_close(int ihandle);
242 typedef struct _of1275_read_service {
252 } of1275_read_service;
254 int of1275_read(int ihandle, void *addr, int len, int *actual);
257 typedef struct _of1275_write_service {
267 } of1275_write_service;
269 int of1275_write(int ihandle, void *addr, int len, int *actual);
272 typedef struct _of1275_seek_service {
282 } of1275_seek_service;
284 int of1275_seek(int ihandle, int pos_hi, int pos_lo, int *status);
290 typedef struct _of1275_claim_service {
300 } of1275_claim_service;
302 int of1275_claim(void *virt, int size, int align, void **baseaddr);
305 typedef struct _of1275_release_service {
314 } of1275_release_service;
316 int of1275_release(void *virt, int size);
319 /* 6.3.2.5 Control transfer */
322 typedef struct _of1275_boot_service {
327 const char *bootspec;
329 } of1275_boot_service;
331 int of1275_boot(const char *bootspec);
334 typedef struct _of1275_enter_service {
340 } of1275_enter_service;
342 int of1275_enter(void);
344 typedef struct _of1275_exit_service {
351 } of1275_exit_service;
353 int of1275_exit(int status);
356 typedef struct _of1275_chain_service {
367 } of1275_chain_service;
369 int of1275_chain(void *virt, int size, void *entry, void *args, int len);
372 /* 6.3.2.6 User interface */
375 typedef struct _of1275_interpret_service {
385 } of1275_interpret_service;
387 int of1275_interpret(const char *arg, ...);
390 typedef struct _of1275_set_callback_service {
398 } of1275_set_callback_service;
400 int of1275_set_callback(void *newfunc, void **oldfunc);
403 typedef struct _of1275_set_symbol_lookup_service {
411 } of1275_set_symbol_lookup_service;
413 int of1275_set_symbol_lookup(void *sym_to_value, void *value_to_sym);
419 typedef struct _of1275_milliseconds_service {
426 } of1275_milliseconds_service;
428 int of1275_milliseconds(int *ms);
431 /* Common and useful utilities */
434 int of_find_integer_property(const char *path, const char *property);
436 void of_find_string_property(const char *path, const char *property,
437 char *string, int sizeof_string);