diff options
Diffstat (limited to 'arch/x86/include')
-rw-r--r-- | arch/x86/include/asm/acpi.h | 2 | ||||
-rw-r--r-- | arch/x86/include/asm/processor.h | 7 | ||||
-rw-r--r-- | arch/x86/include/asm/realmode.h | 62 | ||||
-rw-r--r-- | arch/x86/include/asm/trampoline.h | 39 |
4 files changed, 68 insertions, 42 deletions
diff --git a/arch/x86/include/asm/acpi.h b/arch/x86/include/asm/acpi.h index 610001d385dd..724aa441de7d 100644 --- a/arch/x86/include/asm/acpi.h +++ b/arch/x86/include/asm/acpi.h | |||
@@ -29,7 +29,6 @@ | |||
29 | #include <asm/processor.h> | 29 | #include <asm/processor.h> |
30 | #include <asm/mmu.h> | 30 | #include <asm/mmu.h> |
31 | #include <asm/mpspec.h> | 31 | #include <asm/mpspec.h> |
32 | #include <asm/trampoline.h> | ||
33 | 32 | ||
34 | #define COMPILER_DEPENDENT_INT64 long long | 33 | #define COMPILER_DEPENDENT_INT64 long long |
35 | #define COMPILER_DEPENDENT_UINT64 unsigned long long | 34 | #define COMPILER_DEPENDENT_UINT64 unsigned long long |
@@ -118,7 +117,6 @@ static inline void acpi_disable_pci(void) | |||
118 | extern int acpi_suspend_lowlevel(void); | 117 | extern int acpi_suspend_lowlevel(void); |
119 | 118 | ||
120 | extern const unsigned char acpi_wakeup_code[]; | 119 | extern const unsigned char acpi_wakeup_code[]; |
121 | #define acpi_wakeup_address (__pa(TRAMPOLINE_SYM(acpi_wakeup_code))) | ||
122 | 120 | ||
123 | /* early initialization routine */ | 121 | /* early initialization routine */ |
124 | extern void acpi_reserve_wakeup_memory(void); | 122 | extern void acpi_reserve_wakeup_memory(void); |
diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h index 7745b257f035..39bc5777211a 100644 --- a/arch/x86/include/asm/processor.h +++ b/arch/x86/include/asm/processor.h | |||
@@ -544,13 +544,16 @@ static inline void load_sp0(struct tss_struct *tss, | |||
544 | * enable), so that any CPU's that boot up | 544 | * enable), so that any CPU's that boot up |
545 | * after us can get the correct flags. | 545 | * after us can get the correct flags. |
546 | */ | 546 | */ |
547 | extern unsigned long mmu_cr4_features; | 547 | extern unsigned long mmu_cr4_features; |
548 | extern u32 *trampoline_cr4_features; | ||
548 | 549 | ||
549 | static inline void set_in_cr4(unsigned long mask) | 550 | static inline void set_in_cr4(unsigned long mask) |
550 | { | 551 | { |
551 | unsigned long cr4; | 552 | unsigned long cr4; |
552 | 553 | ||
553 | mmu_cr4_features |= mask; | 554 | mmu_cr4_features |= mask; |
555 | if (trampoline_cr4_features) | ||
556 | *trampoline_cr4_features = mmu_cr4_features; | ||
554 | cr4 = read_cr4(); | 557 | cr4 = read_cr4(); |
555 | cr4 |= mask; | 558 | cr4 |= mask; |
556 | write_cr4(cr4); | 559 | write_cr4(cr4); |
@@ -561,6 +564,8 @@ static inline void clear_in_cr4(unsigned long mask) | |||
561 | unsigned long cr4; | 564 | unsigned long cr4; |
562 | 565 | ||
563 | mmu_cr4_features &= ~mask; | 566 | mmu_cr4_features &= ~mask; |
567 | if (trampoline_cr4_features) | ||
568 | *trampoline_cr4_features = mmu_cr4_features; | ||
564 | cr4 = read_cr4(); | 569 | cr4 = read_cr4(); |
565 | cr4 &= ~mask; | 570 | cr4 &= ~mask; |
566 | write_cr4(cr4); | 571 | write_cr4(cr4); |
diff --git a/arch/x86/include/asm/realmode.h b/arch/x86/include/asm/realmode.h new file mode 100644 index 000000000000..fce3f4ae5bd6 --- /dev/null +++ b/arch/x86/include/asm/realmode.h | |||
@@ -0,0 +1,62 @@ | |||
1 | #ifndef _ARCH_X86_REALMODE_H | ||
2 | #define _ARCH_X86_REALMODE_H | ||
3 | |||
4 | #include <linux/types.h> | ||
5 | #include <asm/io.h> | ||
6 | |||
7 | /* This must match data at realmode.S */ | ||
8 | struct real_mode_header { | ||
9 | u32 text_start; | ||
10 | u32 ro_end; | ||
11 | /* SMP trampoline */ | ||
12 | u32 trampoline_start; | ||
13 | u32 trampoline_status; | ||
14 | u32 trampoline_header; | ||
15 | #ifdef CONFIG_X86_64 | ||
16 | u32 trampoline_pgd; | ||
17 | #endif | ||
18 | /* ACPI S3 wakeup */ | ||
19 | #ifdef CONFIG_ACPI_SLEEP | ||
20 | u32 wakeup_start; | ||
21 | u32 wakeup_header; | ||
22 | #endif | ||
23 | /* APM/BIOS reboot */ | ||
24 | #ifdef CONFIG_X86_32 | ||
25 | u32 machine_real_restart_asm; | ||
26 | #endif | ||
27 | }; | ||
28 | |||
29 | /* This must match data at trampoline_32/64.S */ | ||
30 | struct trampoline_header { | ||
31 | #ifdef CONFIG_X86_32 | ||
32 | u32 start; | ||
33 | u16 gdt_pad; | ||
34 | u16 gdt_limit; | ||
35 | u32 gdt_base; | ||
36 | #else | ||
37 | u64 start; | ||
38 | u64 efer; | ||
39 | u32 cr4; | ||
40 | #endif | ||
41 | }; | ||
42 | |||
43 | extern struct real_mode_header *real_mode_header; | ||
44 | extern unsigned char real_mode_blob_end[]; | ||
45 | |||
46 | extern unsigned long init_rsp; | ||
47 | extern unsigned long initial_code; | ||
48 | extern unsigned long initial_gs; | ||
49 | |||
50 | extern unsigned char real_mode_blob[]; | ||
51 | extern unsigned char real_mode_relocs[]; | ||
52 | |||
53 | #ifdef CONFIG_X86_32 | ||
54 | extern unsigned char startup_32_smp[]; | ||
55 | extern unsigned char boot_gdt[]; | ||
56 | #else | ||
57 | extern unsigned char secondary_startup_64[]; | ||
58 | #endif | ||
59 | |||
60 | extern void __init setup_real_mode(void); | ||
61 | |||
62 | #endif /* _ARCH_X86_REALMODE_H */ | ||
diff --git a/arch/x86/include/asm/trampoline.h b/arch/x86/include/asm/trampoline.h deleted file mode 100644 index feca3118a73b..000000000000 --- a/arch/x86/include/asm/trampoline.h +++ /dev/null | |||
@@ -1,39 +0,0 @@ | |||
1 | #ifndef _ASM_X86_TRAMPOLINE_H | ||
2 | #define _ASM_X86_TRAMPOLINE_H | ||
3 | |||
4 | #ifndef __ASSEMBLY__ | ||
5 | |||
6 | #include <linux/types.h> | ||
7 | #include <asm/io.h> | ||
8 | |||
9 | /* | ||
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. | ||
13 | */ | ||
14 | extern const unsigned char x86_trampoline_start []; | ||
15 | extern const unsigned char x86_trampoline_end []; | ||
16 | extern unsigned char *x86_trampoline_base; | ||
17 | |||
18 | extern unsigned long init_rsp; | ||
19 | extern unsigned long initial_code; | ||
20 | extern unsigned long initial_gs; | ||
21 | |||
22 | extern void __init setup_trampolines(void); | ||
23 | |||
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 | } | ||
36 | |||
37 | #endif /* __ASSEMBLY__ */ | ||
38 | |||
39 | #endif /* _ASM_X86_TRAMPOLINE_H */ | ||