prom.h 833 B

12345678910111213141516171819202122232425262728293031323334
  1. #ifndef _PPC_BOOT_PROM_H_
  2. #define _PPC_BOOT_PROM_H_
  3. typedef void *phandle;
  4. typedef void *ihandle;
  5. extern int (*prom) (void *);
  6. extern phandle chosen_handle;
  7. extern ihandle stdout;
  8. int call_prom(const char *service, int nargs, int nret, ...);
  9. int call_prom_ret(const char *service, int nargs, int nret,
  10. unsigned int *rets, ...);
  11. extern int write(void *handle, void *ptr, int nb);
  12. extern void *claim(unsigned long virt, unsigned long size, unsigned long aln);
  13. static inline void exit(void)
  14. {
  15. call_prom("exit", 0, 0);
  16. }
  17. static inline phandle finddevice(const char *name)
  18. {
  19. return (phandle) call_prom("finddevice", 1, 1, name);
  20. }
  21. static inline int getprop(void *phandle, const char *name,
  22. void *buf, int buflen)
  23. {
  24. return call_prom("getprop", 4, 1, phandle, name, buf, buflen);
  25. }
  26. #endif /* _PPC_BOOT_PROM_H_ */