From: Ben Gras Date: Wed, 28 Apr 2010 13:25:29 +0000 (+0000) Subject: kernel: fpu init to separate function; also move fpu init down X-Git-Tag: v3.1.7~105 X-Git-Url: http://zhaoyanbai.com/repos/host.html?a=commitdiff_plain;h=c37401f23ff9b2200b4ed8a5905f03ae5ffdd6de;p=minix.git kernel: fpu init to separate function; also move fpu init down moving the fpu code causes exceptions raised by it to be trapped neatly instead of causing a triple fault, before the IDT is initialized. --- diff --git a/kernel/arch/i386/arch_system.c b/kernel/arch/i386/arch_system.c index 486785d4f..67e19f058 100644 --- a/kernel/arch/i386/arch_system.c +++ b/kernel/arch/i386/arch_system.c @@ -136,7 +136,7 @@ PRIVATE void tss_init(struct tss_s * tss, void * kernel_stack, *((reg_t *)(tss->sp0 + 1 * sizeof(reg_t))) = cpu; } -PUBLIC void arch_init(void) +PRIVATE void fpu_init(void) { unsigned short cw, sw; @@ -184,7 +184,10 @@ PUBLIC void arch_init(void) osfxsr_feature = 0; return; } +} +PUBLIC void arch_init(void) +{ #ifdef CONFIG_APIC /* * this is setting kernel segments to cover most of the phys memory. The @@ -208,6 +211,7 @@ PUBLIC void arch_init(void) } #endif + fpu_init(); } #define COM1_BASE 0x3F8