blob: a57b184c564f150d7e56e9304128062ffb668d84 [file] [log] [blame]
Olaf Heringdecd3002005-08-08 13:24:38 +10001#ifndef _PPC_BOOT_PROM_H_
2#define _PPC_BOOT_PROM_H_
3
Paul Mackerras66a45dd2006-01-14 15:04:06 +11004typedef void *phandle;
5typedef void *ihandle;
Olaf Heringdecd3002005-08-08 13:24:38 +10006
Paul Mackerras66a45dd2006-01-14 15:04:06 +11007extern int (*prom) (void *);
8extern phandle chosen_handle;
9extern ihandle stdout;
10
11int call_prom(const char *service, int nargs, int nret, ...);
12int call_prom_ret(const char *service, int nargs, int nret,
13 unsigned int *rets, ...);
Olaf Heringdecd3002005-08-08 13:24:38 +100014
15extern int write(void *handle, void *ptr, int nb);
Paul Mackerras66a45dd2006-01-14 15:04:06 +110016extern void *claim(unsigned long virt, unsigned long size, unsigned long aln);
17
18static inline void exit(void)
19{
20 call_prom("exit", 0, 0);
21}
22
23static inline phandle finddevice(const char *name)
24{
25 return (phandle) call_prom("finddevice", 1, 1, name);
26}
27
28static inline int getprop(void *phandle, const char *name,
29 void *buf, int buflen)
30{
31 return call_prom("getprop", 4, 1, phandle, name, buf, buflen);
32}
33
mostrows@watson.ibm.com30d8caf2006-06-09 09:06:12 -040034
35static inline int setprop(void *phandle, const char *name,
36 void *buf, int buflen)
37{
38 return call_prom("setprop", 4, 1, phandle, name, buf, buflen);
39}
40
Olaf Heringdecd3002005-08-08 13:24:38 +100041#endif /* _PPC_BOOT_PROM_H_ */