diff options
author | Glauber de Oliveira Costa <gcosta@redhat.com> | 2008-01-30 07:31:11 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-01-30 07:31:11 -0500 |
commit | 6842ef0e85a9cc1295f3ef933a230f863b01eb0f (patch) | |
tree | dfee4feb74f15ea3819b57848e59fb29ebb10750 /arch/x86/kernel/cpu/common.c | |
parent | 746ef0cd0c7190d570c65b8e39a4ac67550ae43a (diff) |
x86: unify desc_struct
This patch aims to make the access of struct desc_struct variables
equal across architectures. In this patch, I unify the i386 and x86_64
versions under an anonymous union, keeping the way they are accessed
untouched (a and b for 32-bit code, individual bit-fields for 64-bit).
This solution is not beautiful, but will allow us to integrate common
code that differed by the way descriptors were used. This is to be viewed
incrementally. There's simply too much code to be fixed at once.
In the future, goal is to set up in a single way of acessing
the desc_struct fields.
Signed-off-by: Glauber de Oliveira Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/x86/kernel/cpu/common.c')
-rw-r--r-- | arch/x86/kernel/cpu/common.c | 35 |
1 files changed, 21 insertions, 14 deletions
diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c index 235cd615b89d..4f9e31912a25 100644 --- a/arch/x86/kernel/cpu/common.c +++ b/arch/x86/kernel/cpu/common.c | |||
@@ -22,31 +22,38 @@ | |||
22 | #include "cpu.h" | 22 | #include "cpu.h" |
23 | 23 | ||
24 | DEFINE_PER_CPU(struct gdt_page, gdt_page) = { .gdt = { | 24 | DEFINE_PER_CPU(struct gdt_page, gdt_page) = { .gdt = { |
25 | [GDT_ENTRY_KERNEL_CS] = { 0x0000ffff, 0x00cf9a00 }, | 25 | [GDT_ENTRY_KERNEL_CS] = { { { 0x0000ffff, 0x00cf9a00 } } }, |
26 | [GDT_ENTRY_KERNEL_DS] = { 0x0000ffff, 0x00cf9200 }, | 26 | [GDT_ENTRY_KERNEL_DS] = { { { 0x0000ffff, 0x00cf9200 } } }, |
27 | [GDT_ENTRY_DEFAULT_USER_CS] = { 0x0000ffff, 0x00cffa00 }, | 27 | [GDT_ENTRY_DEFAULT_USER_CS] = { { { 0x0000ffff, 0x00cffa00 } } }, |
28 | [GDT_ENTRY_DEFAULT_USER_DS] = { 0x0000ffff, 0x00cff200 }, | 28 | [GDT_ENTRY_DEFAULT_USER_DS] = { { { 0x0000ffff, 0x00cff200 } } }, |
29 | /* | 29 | /* |
30 | * Segments used for calling PnP BIOS have byte granularity. | 30 | * Segments used for calling PnP BIOS have byte granularity. |
31 | * They code segments and data segments have fixed 64k limits, | 31 | * They code segments and data segments have fixed 64k limits, |
32 | * the transfer segment sizes are set at run time. | 32 | * the transfer segment sizes are set at run time. |
33 | */ | 33 | */ |
34 | [GDT_ENTRY_PNPBIOS_CS32] = { 0x0000ffff, 0x00409a00 },/* 32-bit code */ | 34 | /* 32-bit code */ |
35 | [GDT_ENTRY_PNPBIOS_CS16] = { 0x0000ffff, 0x00009a00 },/* 16-bit code */ | 35 | [GDT_ENTRY_PNPBIOS_CS32] = { { { 0x0000ffff, 0x00409a00 } } }, |
36 | [GDT_ENTRY_PNPBIOS_DS] = { 0x0000ffff, 0x00009200 }, /* 16-bit data */ | 36 | /* 16-bit code */ |
37 | [GDT_ENTRY_PNPBIOS_TS1] = { 0x00000000, 0x00009200 },/* 16-bit data */ | 37 | [GDT_ENTRY_PNPBIOS_CS16] = { { { 0x0000ffff, 0x00009a00 } } }, |
38 | [GDT_ENTRY_PNPBIOS_TS2] = { 0x00000000, 0x00009200 },/* 16-bit data */ | 38 | /* 16-bit data */ |
39 | [GDT_ENTRY_PNPBIOS_DS] = { { { 0x0000ffff, 0x00009200 } } }, | ||
40 | /* 16-bit data */ | ||
41 | [GDT_ENTRY_PNPBIOS_TS1] = { { { 0x00000000, 0x00009200 } } }, | ||
42 | /* 16-bit data */ | ||
43 | [GDT_ENTRY_PNPBIOS_TS2] = { { { 0x00000000, 0x00009200 } } }, | ||
39 | /* | 44 | /* |
40 | * The APM segments have byte granularity and their bases | 45 | * The APM segments have byte granularity and their bases |
41 | * are set at run time. All have 64k limits. | 46 | * are set at run time. All have 64k limits. |
42 | */ | 47 | */ |
43 | [GDT_ENTRY_APMBIOS_BASE] = { 0x0000ffff, 0x00409a00 },/* 32-bit code */ | 48 | /* 32-bit code */ |
49 | [GDT_ENTRY_APMBIOS_BASE] = { { { 0x0000ffff, 0x00409a00 } } }, | ||
44 | /* 16-bit code */ | 50 | /* 16-bit code */ |
45 | [GDT_ENTRY_APMBIOS_BASE+1] = { 0x0000ffff, 0x00009a00 }, | 51 | [GDT_ENTRY_APMBIOS_BASE+1] = { { { 0x0000ffff, 0x00009a00 } } }, |
46 | [GDT_ENTRY_APMBIOS_BASE+2] = { 0x0000ffff, 0x00409200 }, /* data */ | 52 | /* data */ |
53 | [GDT_ENTRY_APMBIOS_BASE+2] = { { { 0x0000ffff, 0x00409200 } } }, | ||
47 | 54 | ||
48 | [GDT_ENTRY_ESPFIX_SS] = { 0x00000000, 0x00c09200 }, | 55 | [GDT_ENTRY_ESPFIX_SS] = { { { 0x00000000, 0x00c09200 } } }, |
49 | [GDT_ENTRY_PERCPU] = { 0x00000000, 0x00000000 }, | 56 | [GDT_ENTRY_PERCPU] = { { { 0x00000000, 0x00000000 } } }, |
50 | } }; | 57 | } }; |
51 | EXPORT_PER_CPU_SYMBOL_GPL(gdt_page); | 58 | EXPORT_PER_CPU_SYMBOL_GPL(gdt_page); |
52 | 59 | ||