Linux 4.13.16
[linux/fpc-iii.git] / arch / powerpc / boot / of.h
blob53f8f27f94e4e57d37d0f8bb6ebc9a17e32b506e
1 #ifndef _PPC_BOOT_OF_H_
2 #define _PPC_BOOT_OF_H_
4 #include "swab.h"
6 typedef void *phandle;
7 typedef u32 ihandle;
9 void of_init(void *promptr);
10 int of_call_prom(const char *service, int nargs, int nret, ...);
11 unsigned int of_claim(unsigned long virt, unsigned long size,
12 unsigned long align);
13 void *of_vmlinux_alloc(unsigned long size);
14 void of_exit(void);
15 void *of_finddevice(const char *name);
16 int of_getprop(const void *phandle, const char *name, void *buf,
17 const int buflen);
18 int of_setprop(const void *phandle, const char *name, const void *buf,
19 const int buflen);
21 /* Console functions */
22 void of_console_init(void);
24 typedef u16 __be16;
25 typedef u32 __be32;
26 typedef u64 __be64;
28 #ifdef __LITTLE_ENDIAN__
29 #define cpu_to_be16(x) swab16(x)
30 #define be16_to_cpu(x) swab16(x)
31 #define cpu_to_be32(x) swab32(x)
32 #define be32_to_cpu(x) swab32(x)
33 #define cpu_to_be64(x) swab64(x)
34 #define be64_to_cpu(x) swab64(x)
35 #else
36 #define cpu_to_be16(x) (x)
37 #define be16_to_cpu(x) (x)
38 #define cpu_to_be32(x) (x)
39 #define be32_to_cpu(x) (x)
40 #define cpu_to_be64(x) (x)
41 #define be64_to_cpu(x) (x)
42 #endif
44 #define PROM_ERROR (-1u)
46 #endif /* _PPC_BOOT_OF_H_ */