diff options
Diffstat (limited to 'arch/powerpc/boot/prom.h')
-rw-r--r-- | arch/powerpc/boot/prom.h | 36 |
1 files changed, 26 insertions, 10 deletions
diff --git a/arch/powerpc/boot/prom.h b/arch/powerpc/boot/prom.h index 96ab5aec740c..3e2ddd4a5a81 100644 --- a/arch/powerpc/boot/prom.h +++ b/arch/powerpc/boot/prom.h | |||
@@ -1,18 +1,34 @@ | |||
1 | #ifndef _PPC_BOOT_PROM_H_ | 1 | #ifndef _PPC_BOOT_PROM_H_ |
2 | #define _PPC_BOOT_PROM_H_ | 2 | #define _PPC_BOOT_PROM_H_ |
3 | 3 | ||
4 | typedef void *phandle; | ||
5 | typedef void *ihandle; | ||
6 | |||
4 | extern int (*prom) (void *); | 7 | extern int (*prom) (void *); |
5 | extern void *chosen_handle; | 8 | extern phandle chosen_handle; |
9 | extern ihandle stdout; | ||
6 | 10 | ||
7 | extern void *stdin; | 11 | int call_prom(const char *service, int nargs, int nret, ...); |
8 | extern void *stdout; | 12 | int call_prom_ret(const char *service, int nargs, int nret, |
9 | extern void *stderr; | 13 | unsigned int *rets, ...); |
10 | 14 | ||
11 | extern int write(void *handle, void *ptr, int nb); | 15 | extern int write(void *handle, void *ptr, int nb); |
12 | extern int read(void *handle, void *ptr, int nb); | 16 | extern void *claim(unsigned long virt, unsigned long size, unsigned long aln); |
13 | extern void exit(void); | 17 | |
14 | extern void pause(void); | 18 | static inline void exit(void) |
15 | extern void *finddevice(const char *); | 19 | { |
16 | extern void *claim(unsigned long virt, unsigned long size, unsigned long align); | 20 | call_prom("exit", 0, 0); |
17 | extern int getprop(void *phandle, const char *name, void *buf, int buflen); | 21 | } |
22 | |||
23 | static inline phandle finddevice(const char *name) | ||
24 | { | ||
25 | return (phandle) call_prom("finddevice", 1, 1, name); | ||
26 | } | ||
27 | |||
28 | static 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 | |||
18 | #endif /* _PPC_BOOT_PROM_H_ */ | 34 | #endif /* _PPC_BOOT_PROM_H_ */ |