diff options
| -rw-r--r-- | arch/x86/boot/pm.c | 6 | ||||
| -rw-r--r-- | arch/x86/kernel/acpi/sleep.c | 10 | ||||
| -rw-r--r-- | include/asm-x86/segment.h | 9 |
3 files changed, 10 insertions, 15 deletions
diff --git a/arch/x86/boot/pm.c b/arch/x86/boot/pm.c index 328956fdb59e..85a1cd8a8ff8 100644 --- a/arch/x86/boot/pm.c +++ b/arch/x86/boot/pm.c | |||
| @@ -98,12 +98,6 @@ static void reset_coprocessor(void) | |||
| 98 | /* | 98 | /* |
| 99 | * Set up the GDT | 99 | * Set up the GDT |
| 100 | */ | 100 | */ |
| 101 | #define GDT_ENTRY(flags, base, limit) \ | ||
| 102 | (((u64)(base & 0xff000000) << 32) | \ | ||
| 103 | ((u64)flags << 40) | \ | ||
| 104 | ((u64)(limit & 0x00ff0000) << 32) | \ | ||
| 105 | ((u64)(base & 0x00ffffff) << 16) | \ | ||
| 106 | ((u64)(limit & 0x0000ffff))) | ||
| 107 | 101 | ||
| 108 | struct gdt_ptr { | 102 | struct gdt_ptr { |
| 109 | u16 len; | 103 | u16 len; |
diff --git a/arch/x86/kernel/acpi/sleep.c b/arch/x86/kernel/acpi/sleep.c index 868de3d5c39d..a3ddad18aaa3 100644 --- a/arch/x86/kernel/acpi/sleep.c +++ b/arch/x86/kernel/acpi/sleep.c | |||
| @@ -9,6 +9,7 @@ | |||
| 9 | #include <linux/bootmem.h> | 9 | #include <linux/bootmem.h> |
| 10 | #include <linux/dmi.h> | 10 | #include <linux/dmi.h> |
| 11 | #include <linux/cpumask.h> | 11 | #include <linux/cpumask.h> |
| 12 | #include <asm/segment.h> | ||
| 12 | 13 | ||
| 13 | #include "realmode/wakeup.h" | 14 | #include "realmode/wakeup.h" |
| 14 | #include "sleep.h" | 15 | #include "sleep.h" |
| @@ -23,15 +24,6 @@ static unsigned long acpi_realmode; | |||
| 23 | static char temp_stack[10240]; | 24 | static char temp_stack[10240]; |
| 24 | #endif | 25 | #endif |
| 25 | 26 | ||
| 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 | |||
| 35 | /** | 27 | /** |
| 36 | * acpi_save_state_mem - save kernel state | 28 | * acpi_save_state_mem - save kernel state |
| 37 | * | 29 | * |
diff --git a/include/asm-x86/segment.h b/include/asm-x86/segment.h index dfc8601c0892..646452ea9ea3 100644 --- a/include/asm-x86/segment.h +++ b/include/asm-x86/segment.h | |||
| @@ -1,6 +1,15 @@ | |||
| 1 | #ifndef _ASM_X86_SEGMENT_H_ | 1 | #ifndef _ASM_X86_SEGMENT_H_ |
| 2 | #define _ASM_X86_SEGMENT_H_ | 2 | #define _ASM_X86_SEGMENT_H_ |
| 3 | 3 | ||
| 4 | /* Constructor for a conventional segment GDT (or LDT) entry */ | ||
| 5 | /* This is a macro so it can be used in initializers */ | ||
| 6 | #define GDT_ENTRY(flags, base, limit) \ | ||
| 7 | ((((base) & 0xff000000ULL) << (56-24)) | \ | ||
| 8 | (((flags) & 0x0000f0ffULL) << 40) | \ | ||
| 9 | (((limit) & 0x000f0000ULL) << (48-16)) | \ | ||
| 10 | (((base) & 0x00ffffffULL) << 16) | \ | ||
| 11 | (((limit) & 0x0000ffffULL))) | ||
| 12 | |||
| 4 | /* Simple and small GDT entries for booting only */ | 13 | /* Simple and small GDT entries for booting only */ |
| 5 | 14 | ||
| 6 | #define GDT_ENTRY_BOOT_CS 2 | 15 | #define GDT_ENTRY_BOOT_CS 2 |
