blob: 4dde797c057800b0e377ac02eb16101430f865ef [file] [log] [blame]
H. Peter Anvin1965aae2008-10-22 22:26:29 -07001#ifndef _ASM_X86_TRAMPOLINE_H
2#define _ASM_X86_TRAMPOLINE_H
Pavel Macheke44b7b72008-04-10 23:28:10 +02003
4#ifndef __ASSEMBLY__
5
Rafael J. Wysocki3e1e9002008-12-08 00:50:22 +01006#ifdef CONFIG_X86_TRAMPOLINE
Pavel Macheke44b7b72008-04-10 23:28:10 +02007/*
8 * Trampoline 80x86 program as an array.
9 */
10extern const unsigned char trampoline_data [];
11extern const unsigned char trampoline_end [];
12extern unsigned char *trampoline_base;
13
14extern unsigned long init_rsp;
15extern unsigned long initial_code;
Joerg Roedelfd89a132010-08-16 14:38:33 +020016extern unsigned long initial_page_table;
Tejun Heof32ff532009-01-13 20:41:35 +090017extern unsigned long initial_gs;
Pavel Macheke44b7b72008-04-10 23:28:10 +020018
Rafael J. Wysocki3e1e9002008-12-08 00:50:22 +010019#define TRAMPOLINE_SIZE roundup(trampoline_end - trampoline_data, PAGE_SIZE)
Rafael J. Wysocki3e1e9002008-12-08 00:50:22 +010020
Pavel Macheke44b7b72008-04-10 23:28:10 +020021extern unsigned long setup_trampoline(void);
Joerg Roedelfd89a132010-08-16 14:38:33 +020022extern void __init setup_trampoline_page_table(void);
Rafael J. Wysocki3e1e9002008-12-08 00:50:22 +010023extern void __init reserve_trampoline_memory(void);
24#else
H. Peter Anvin8848a912010-08-18 11:42:23 -070025static inline void setup_trampoline_page_table(void) {}
26static inline void reserve_trampoline_memory(void) {}
Rafael J. Wysocki3e1e9002008-12-08 00:50:22 +010027#endif /* CONFIG_X86_TRAMPOLINE */
Pavel Macheke44b7b72008-04-10 23:28:10 +020028
29#endif /* __ASSEMBLY__ */
30
H. Peter Anvin1965aae2008-10-22 22:26:29 -070031#endif /* _ASM_X86_TRAMPOLINE_H */