2005-08-08 11:24:38 +08:00
|
|
|
#ifndef _PPC_BOOT_PROM_H_
|
|
|
|
#define _PPC_BOOT_PROM_H_
|
|
|
|
|
2006-01-14 12:04:06 +08:00
|
|
|
typedef void *phandle;
|
|
|
|
typedef void *ihandle;
|
|
|
|
|
2005-08-08 11:24:38 +08:00
|
|
|
extern int (*prom) (void *);
|
2006-01-14 12:04:06 +08:00
|
|
|
extern phandle chosen_handle;
|
|
|
|
extern ihandle stdout;
|
2005-08-08 11:24:38 +08:00
|
|
|
|
2006-01-14 12:04:06 +08:00
|
|
|
int call_prom(const char *service, int nargs, int nret, ...);
|
|
|
|
int call_prom_ret(const char *service, int nargs, int nret,
|
|
|
|
unsigned int *rets, ...);
|
2005-08-08 11:24:38 +08:00
|
|
|
|
|
|
|
extern int write(void *handle, void *ptr, int nb);
|
2006-01-14 12:04:06 +08:00
|
|
|
extern void *claim(unsigned long virt, unsigned long size, unsigned long aln);
|
|
|
|
|
|
|
|
static inline void exit(void)
|
|
|
|
{
|
|
|
|
call_prom("exit", 0, 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline phandle finddevice(const char *name)
|
|
|
|
{
|
|
|
|
return (phandle) call_prom("finddevice", 1, 1, name);
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline int getprop(void *phandle, const char *name,
|
|
|
|
void *buf, int buflen)
|
|
|
|
{
|
|
|
|
return call_prom("getprop", 4, 1, phandle, name, buf, buflen);
|
|
|
|
}
|
|
|
|
|
2005-08-08 11:24:38 +08:00
|
|
|
#endif /* _PPC_BOOT_PROM_H_ */
|