H. Peter Anvin | 1965aae | 2008-10-22 22:26:29 -0700 | [diff] [blame] | 1 | #ifndef _ASM_X86_TRAMPOLINE_H |
| 2 | #define _ASM_X86_TRAMPOLINE_H |
Pavel Machek | e44b7b7 | 2008-04-10 23:28:10 +0200 | [diff] [blame] | 3 | |
| 4 | #ifndef __ASSEMBLY__ |
| 5 | |
H. Peter Anvin | d1ee433 | 2011-02-14 15:42:46 -0800 | [diff] [blame] | 6 | #include <linux/types.h> |
| 7 | #include <asm/io.h> |
| 8 | |
Pavel Machek | e44b7b7 | 2008-04-10 23:28:10 +0200 | [diff] [blame] | 9 | /* |
H. Peter Anvin | d1ee433 | 2011-02-14 15:42:46 -0800 | [diff] [blame] | 10 | * Trampoline 80x86 program as an array. These are in the init rodata |
| 11 | * segment, but that's okay, because we only care about the relative |
| 12 | * addresses of the symbols. |
Pavel Machek | e44b7b7 | 2008-04-10 23:28:10 +0200 | [diff] [blame] | 13 | */ |
H. Peter Anvin | d1ee433 | 2011-02-14 15:42:46 -0800 | [diff] [blame] | 14 | extern const unsigned char x86_trampoline_start []; |
| 15 | extern const unsigned char x86_trampoline_end []; |
| 16 | extern unsigned char *x86_trampoline_base; |
Pavel Machek | e44b7b7 | 2008-04-10 23:28:10 +0200 | [diff] [blame] | 17 | |
| 18 | extern unsigned long init_rsp; |
| 19 | extern unsigned long initial_code; |
Tejun Heo | f32ff53 | 2009-01-13 20:41:35 +0900 | [diff] [blame] | 20 | extern unsigned long initial_gs; |
Pavel Machek | e44b7b7 | 2008-04-10 23:28:10 +0200 | [diff] [blame] | 21 | |
H. Peter Anvin | d1ee433 | 2011-02-14 15:42:46 -0800 | [diff] [blame] | 22 | extern void __init setup_trampolines(void); |
Rafael J. Wysocki | 3e1e900 | 2008-12-08 00:50:22 +0100 | [diff] [blame] | 23 | |
H. Peter Anvin | d1ee433 | 2011-02-14 15:42:46 -0800 | [diff] [blame] | 24 | extern const unsigned char trampoline_data[]; |
| 25 | extern const unsigned char trampoline_status[]; |
| 26 | |
| 27 | #define TRAMPOLINE_SYM(x) \ |
| 28 | ((void *)(x86_trampoline_base + \ |
| 29 | ((const unsigned char *)(x) - x86_trampoline_start))) |
| 30 | |
| 31 | /* Address of the SMP trampoline */ |
| 32 | static inline unsigned long trampoline_address(void) |
| 33 | { |
| 34 | return virt_to_phys(TRAMPOLINE_SYM(trampoline_data)); |
| 35 | } |
Pavel Machek | e44b7b7 | 2008-04-10 23:28:10 +0200 | [diff] [blame] | 36 | |
| 37 | #endif /* __ASSEMBLY__ */ |
| 38 | |
H. Peter Anvin | 1965aae | 2008-10-22 22:26:29 -0700 | [diff] [blame] | 39 | #endif /* _ASM_X86_TRAMPOLINE_H */ |