diff options
author | Richard Braun <rbraun@sceen.net> | 2014-09-03 20:53:20 +0200 |
---|---|---|
committer | Richard Braun <rbraun@sceen.net> | 2014-09-03 20:53:20 +0200 |
commit | 47e2ed1c50c05f1a3a167f6efbbe65a306604fa0 (patch) | |
tree | c58023259e7d964e8f69b8420ea78d9b9d0a729e | |
parent | dbbd040f4eedf75671bb55d3fb3a4bf398c6750c (diff) |
x86/cpu: move cpu_load_gdt() to the init section
-rw-r--r-- | arch/x86/machine/cpu.c | 6 | ||||
-rw-r--r-- | arch/x86/machine/cpu.h | 6 | ||||
-rw-r--r-- | arch/x86/machine/cpu_asm.S | 5 |
3 files changed, 9 insertions, 8 deletions
diff --git a/arch/x86/machine/cpu.c b/arch/x86/machine/cpu.c index 488b2b75..2505698a 100644 --- a/arch/x86/machine/cpu.c +++ b/arch/x86/machine/cpu.c @@ -166,6 +166,12 @@ cpu_seg_set_tss(char *table, unsigned int selector, struct cpu_tss *tss) | (limit & CPU_DESC_SEG_LIMIT_LOW_MASK); } +/* + * Set the given GDT for the current processor, and reload its segment + * registers. + */ +void cpu_load_gdt(struct cpu *cpu, struct cpu_pseudo_desc *gdtr); + static void __init cpu_init_gdt(struct cpu *cpu) { diff --git a/arch/x86/machine/cpu.h b/arch/x86/machine/cpu.h index 07dd98db..08420ac6 100644 --- a/arch/x86/machine/cpu.h +++ b/arch/x86/machine/cpu.h @@ -589,12 +589,6 @@ cpu_delay(unsigned long usecs) unsigned long cpu_get_boot_stack(void); /* - * Set the given GDT for the current processor, and reload its segment - * registers. - */ -void cpu_load_gdt(struct cpu *cpu, struct cpu_pseudo_desc *gdtr); - -/* * Install an interrupt handler in the IDT. */ void cpu_idt_set_gate(unsigned int vector, void (*isr)(void)); diff --git a/arch/x86/machine/cpu_asm.S b/arch/x86/machine/cpu_asm.S index 0917b821..56e8e2fb 100644 --- a/arch/x86/machine/cpu_asm.S +++ b/arch/x86/machine/cpu_asm.S @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2012 Richard Braun. + * Copyright (c) 2011-2014 Richard Braun. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -15,10 +15,11 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ +#include <kern/init.h> #include <machine/asm.h> #include <machine/cpu.h> -.text +.section INIT_SECTION ASM_ENTRY(cpu_load_gdt) #ifdef __LP64__ |