blob: 2a8478140bb38b205e32624b7bda5118c43e8133 [file] [log] [blame]
Andres Salomonfd699c72010-06-18 17:46:53 -04001#ifndef _ASM_X86_OLPC_OFW_H
2#define _ASM_X86_OLPC_OFW_H
3
4/* index into the page table containing the entry OFW occupies */
5#define OLPC_OFW_PDE_NR 1022
6
7#define OLPC_OFW_SIG 0x2057464F /* aka "OFW " */
8
9#ifdef CONFIG_OLPC_OPENFIRMWARE
10
11/* run an OFW command by calling into the firmware */
12#define olpc_ofw(name, args, res) \
13 __olpc_ofw((name), ARRAY_SIZE(args), args, ARRAY_SIZE(res), res)
14
Andres Salomon54e5bc022010-06-28 22:00:29 -040015extern int __olpc_ofw(const char *name, int nr_args, const void **args, int nr_res,
Andres Salomonfd699c72010-06-18 17:46:53 -040016 void **res);
17
18/* determine whether OFW is available and lives in the proper memory */
19extern void olpc_ofw_detect(void);
20
21/* install OFW's pde permanently into the kernel's pgtable */
22extern void setup_olpc_ofw_pgd(void);
23
Daniel Drake3e3c4862010-09-23 17:28:46 +010024/* check if OFW was detected during boot */
25extern bool olpc_ofw_present(void);
26
Andres Salomonfd699c72010-06-18 17:46:53 -040027#else /* !CONFIG_OLPC_OPENFIRMWARE */
28
29static inline void olpc_ofw_detect(void) { }
30static inline void setup_olpc_ofw_pgd(void) { }
Daniel Drake3e3c4862010-09-23 17:28:46 +010031static inline bool olpc_ofw_present(void) { return false; }
Andres Salomonfd699c72010-06-18 17:46:53 -040032
33#endif /* !CONFIG_OLPC_OPENFIRMWARE */
34
35#endif /* _ASM_X86_OLPC_OFW_H */