diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-15 11:41:43 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-15 11:41:43 -0400 |
commit | 1dc60c53d36b08f361e1a2767c41196acce96d08 (patch) | |
tree | 35966ad2c2465e6f722d199e4b1799fb4c6f2b46 /arch/x86/kernel | |
parent | 8d2567a620ae8c24968a2bdc1c906c724fac1f6a (diff) | |
parent | 3f1c38723eb467d34d704d0ee6e7b796ba4981ee (diff) |
Merge branch 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
x86: Fix compile error with CONFIG_AS_CFI=n
Documentation: document debugpat commandline option
x86: sanitize Kconfig
x86, suspend, acpi: correct and add comments about Big Real Mode
x86, suspend, acpi: enter Big Real Mode
Fixed trivial conflict in include/asm-x86/dwarf2.h due to just using
different names for "cfi_ignore" (vs "__cfi_ignore") macro.
Diffstat (limited to 'arch/x86/kernel')
-rw-r--r-- | arch/x86/kernel/acpi/sleep.c | 30 |
1 files changed, 24 insertions, 6 deletions
diff --git a/arch/x86/kernel/acpi/sleep.c b/arch/x86/kernel/acpi/sleep.c index e6a4b564ccaa..793ad2045f58 100644 --- a/arch/x86/kernel/acpi/sleep.c +++ b/arch/x86/kernel/acpi/sleep.c | |||
@@ -23,6 +23,15 @@ static unsigned long acpi_realmode; | |||
23 | static char temp_stack[10240]; | 23 | static char temp_stack[10240]; |
24 | #endif | 24 | #endif |
25 | 25 | ||
26 | /* XXX: this macro should move to asm-x86/segment.h and be shared with the | ||
27 | boot code... */ | ||
28 | #define GDT_ENTRY(flags, base, limit) \ | ||
29 | (((u64)(base & 0xff000000) << 32) | \ | ||
30 | ((u64)flags << 40) | \ | ||
31 | ((u64)(limit & 0x00ff0000) << 32) | \ | ||
32 | ((u64)(base & 0x00ffffff) << 16) | \ | ||
33 | ((u64)(limit & 0x0000ffff))) | ||
34 | |||
26 | /** | 35 | /** |
27 | * acpi_save_state_mem - save kernel state | 36 | * acpi_save_state_mem - save kernel state |
28 | * | 37 | * |
@@ -51,18 +60,27 @@ int acpi_save_state_mem(void) | |||
51 | header->video_mode = saved_video_mode; | 60 | header->video_mode = saved_video_mode; |
52 | 61 | ||
53 | header->wakeup_jmp_seg = acpi_wakeup_address >> 4; | 62 | header->wakeup_jmp_seg = acpi_wakeup_address >> 4; |
63 | |||
64 | /* | ||
65 | * Set up the wakeup GDT. We set these up as Big Real Mode, | ||
66 | * that is, with limits set to 4 GB. At least the Lenovo | ||
67 | * Thinkpad X61 is known to need this for the video BIOS | ||
68 | * initialization quirk to work; this is likely to also | ||
69 | * be the case for other laptops or integrated video devices. | ||
70 | */ | ||
71 | |||
54 | /* GDT[0]: GDT self-pointer */ | 72 | /* GDT[0]: GDT self-pointer */ |
55 | header->wakeup_gdt[0] = | 73 | header->wakeup_gdt[0] = |
56 | (u64)(sizeof(header->wakeup_gdt) - 1) + | 74 | (u64)(sizeof(header->wakeup_gdt) - 1) + |
57 | ((u64)(acpi_wakeup_address + | 75 | ((u64)(acpi_wakeup_address + |
58 | ((char *)&header->wakeup_gdt - (char *)acpi_realmode)) | 76 | ((char *)&header->wakeup_gdt - (char *)acpi_realmode)) |
59 | << 16); | 77 | << 16); |
60 | /* GDT[1]: real-mode-like code segment */ | 78 | /* GDT[1]: big real mode-like code segment */ |
61 | header->wakeup_gdt[1] = (0x009bULL << 40) + | 79 | header->wakeup_gdt[1] = |
62 | ((u64)acpi_wakeup_address << 16) + 0xffff; | 80 | GDT_ENTRY(0x809b, acpi_wakeup_address, 0xfffff); |
63 | /* GDT[2]: real-mode-like data segment */ | 81 | /* GDT[2]: big real mode-like data segment */ |
64 | header->wakeup_gdt[2] = (0x0093ULL << 40) + | 82 | header->wakeup_gdt[2] = |
65 | ((u64)acpi_wakeup_address << 16) + 0xffff; | 83 | GDT_ENTRY(0x8093, acpi_wakeup_address, 0xfffff); |
66 | 84 | ||
67 | #ifndef CONFIG_64BIT | 85 | #ifndef CONFIG_64BIT |
68 | store_gdt((struct desc_ptr *)&header->pmode_gdt); | 86 | store_gdt((struct desc_ptr *)&header->pmode_gdt); |