diff options
author | Glauber de Oliveira Costa <gcosta@redhat.com> | 2008-01-30 07:31:12 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-01-30 07:31:12 -0500 |
commit | f6dc247cac1a8ee64e59019c3b948d23f3b1a36f (patch) | |
tree | 9aeb7ce4ef3fb8aceaa8aa52da483f14d70cf3cf | |
parent | 6b68f01baa810e9f63fbf39e9d5c3ef1d94a966f (diff) |
x86: change gdt acessor macro name
This patch changes the name of x86_64 macro used to access the per-cpu
gdt. It is now equal to the i386 version, which will allow code to be shared.
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>
-rw-r--r-- | arch/x86/kernel/setup64.c | 2 | ||||
-rw-r--r-- | arch/x86/kernel/suspend_64.c | 2 | ||||
-rw-r--r-- | arch/x86/kernel/vsyscall_64.c | 2 | ||||
-rw-r--r-- | include/asm-x86/desc_64.h | 10 |
4 files changed, 8 insertions, 8 deletions
diff --git a/arch/x86/kernel/setup64.c b/arch/x86/kernel/setup64.c index 51297cca6b42..05cafcb94109 100644 --- a/arch/x86/kernel/setup64.c +++ b/arch/x86/kernel/setup64.c | |||
@@ -228,7 +228,7 @@ void __cpuinit cpu_init (void) | |||
228 | * and set up the GDT descriptor: | 228 | * and set up the GDT descriptor: |
229 | */ | 229 | */ |
230 | if (cpu) | 230 | if (cpu) |
231 | memcpy(cpu_gdt(cpu), cpu_gdt_table, GDT_SIZE); | 231 | memcpy(get_cpu_gdt_table(cpu), cpu_gdt_table, GDT_SIZE); |
232 | 232 | ||
233 | cpu_gdt_descr[cpu].size = GDT_SIZE; | 233 | cpu_gdt_descr[cpu].size = GDT_SIZE; |
234 | load_gdt((const struct desc_ptr *)&cpu_gdt_descr[cpu]); | 234 | load_gdt((const struct desc_ptr *)&cpu_gdt_descr[cpu]); |
diff --git a/arch/x86/kernel/suspend_64.c b/arch/x86/kernel/suspend_64.c index 569f1b540e36..279c25775d19 100644 --- a/arch/x86/kernel/suspend_64.c +++ b/arch/x86/kernel/suspend_64.c | |||
@@ -140,7 +140,7 @@ void fix_processor_context(void) | |||
140 | 140 | ||
141 | set_tss_desc(cpu,t); /* This just modifies memory; should not be necessary. But... This is necessary, because 386 hardware has concept of busy TSS or some similar stupidity. */ | 141 | set_tss_desc(cpu,t); /* This just modifies memory; should not be necessary. But... This is necessary, because 386 hardware has concept of busy TSS or some similar stupidity. */ |
142 | 142 | ||
143 | cpu_gdt(cpu)[GDT_ENTRY_TSS].type = 9; | 143 | get_cpu_gdt_table(cpu)[GDT_ENTRY_TSS].type = 9; |
144 | 144 | ||
145 | syscall_init(); /* This sets MSR_*STAR and related */ | 145 | syscall_init(); /* This sets MSR_*STAR and related */ |
146 | load_TR_desc(); /* This does ltr */ | 146 | load_TR_desc(); /* This does ltr */ |
diff --git a/arch/x86/kernel/vsyscall_64.c b/arch/x86/kernel/vsyscall_64.c index c4c5e765cd2c..e5c1118a8098 100644 --- a/arch/x86/kernel/vsyscall_64.c +++ b/arch/x86/kernel/vsyscall_64.c | |||
@@ -297,7 +297,7 @@ static void __cpuinit vsyscall_set_cpu(int cpu) | |||
297 | /* Store cpu number in limit so that it can be loaded quickly | 297 | /* Store cpu number in limit so that it can be loaded quickly |
298 | in user space in vgetcpu. | 298 | in user space in vgetcpu. |
299 | 12 bits for the CPU and 8 bits for the node. */ | 299 | 12 bits for the CPU and 8 bits for the node. */ |
300 | d = (unsigned long *)(cpu_gdt(cpu) + GDT_ENTRY_PER_CPU); | 300 | d = (unsigned long *)(get_cpu_gdt_table(cpu) + GDT_ENTRY_PER_CPU); |
301 | *d = 0x0f40000000000ULL; | 301 | *d = 0x0f40000000000ULL; |
302 | *d |= cpu; | 302 | *d |= cpu; |
303 | *d |= (node & 0xf) << 12; | 303 | *d |= (node & 0xf) << 12; |
diff --git a/include/asm-x86/desc_64.h b/include/asm-x86/desc_64.h index 230ac6e50a0f..4d67f61b4c23 100644 --- a/include/asm-x86/desc_64.h +++ b/include/asm-x86/desc_64.h | |||
@@ -48,7 +48,7 @@ static inline void write_ldt_entry(struct desc_struct *ldt, | |||
48 | } | 48 | } |
49 | 49 | ||
50 | /* the cpu gdt accessor */ | 50 | /* the cpu gdt accessor */ |
51 | #define cpu_gdt(_cpu) ((struct desc_struct *)cpu_gdt_descr[_cpu].address) | 51 | #define get_cpu_gdt_table(x) ((struct desc_struct *)cpu_gdt_descr[x].address) |
52 | 52 | ||
53 | static inline void load_gdt(const struct desc_ptr *ptr) | 53 | static inline void load_gdt(const struct desc_ptr *ptr) |
54 | { | 54 | { |
@@ -141,15 +141,15 @@ static inline void set_tss_desc(unsigned cpu, void *addr) | |||
141 | * -1? seg base+limit should be pointing to the address of the | 141 | * -1? seg base+limit should be pointing to the address of the |
142 | * last valid byte | 142 | * last valid byte |
143 | */ | 143 | */ |
144 | set_tssldt_descriptor(&cpu_gdt(cpu)[GDT_ENTRY_TSS], | 144 | set_tssldt_descriptor(&get_cpu_gdt_table(cpu)[GDT_ENTRY_TSS], |
145 | (unsigned long)addr, DESC_TSS, | 145 | (unsigned long)addr, DESC_TSS, |
146 | IO_BITMAP_OFFSET + IO_BITMAP_BYTES + sizeof(unsigned long) - 1); | 146 | IO_BITMAP_OFFSET + IO_BITMAP_BYTES + sizeof(unsigned long) - 1); |
147 | } | 147 | } |
148 | 148 | ||
149 | static inline void set_ldt_desc(unsigned cpu, void *addr, int size) | 149 | static inline void set_ldt_desc(unsigned cpu, void *addr, int size) |
150 | { | 150 | { |
151 | set_tssldt_descriptor(&cpu_gdt(cpu)[GDT_ENTRY_LDT], (unsigned long)addr, | 151 | set_tssldt_descriptor(&get_cpu_gdt_table(cpu)[GDT_ENTRY_LDT], |
152 | DESC_LDT, size * 8 - 1); | 152 | (unsigned long)addr, DESC_LDT, size * 8 - 1); |
153 | } | 153 | } |
154 | 154 | ||
155 | #define LDT_entry_a(info) \ | 155 | #define LDT_entry_a(info) \ |
@@ -183,7 +183,7 @@ static inline void set_ldt_desc(unsigned cpu, void *addr, int size) | |||
183 | static inline void load_TLS(struct thread_struct *t, unsigned int cpu) | 183 | static inline void load_TLS(struct thread_struct *t, unsigned int cpu) |
184 | { | 184 | { |
185 | unsigned int i; | 185 | unsigned int i; |
186 | u64 *gdt = (u64 *)(cpu_gdt(cpu) + GDT_ENTRY_TLS_MIN); | 186 | u64 *gdt = (u64 *)(get_cpu_gdt_table(cpu) + GDT_ENTRY_TLS_MIN); |
187 | 187 | ||
188 | for (i = 0; i < GDT_ENTRY_TLS_ENTRIES; i++) | 188 | for (i = 0; i < GDT_ENTRY_TLS_ENTRIES; i++) |
189 | gdt[i] = t->tls_array[i]; | 189 | gdt[i] = t->tls_array[i]; |