Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Math fpu and i386 kernels



On Tue, Jan 20, 2009 at 09:07:27PM +0100, Wojciech Galazka wrote:
> Hello
> sys/arch/i386/conf/GENERIC_PS2TINY
> has math fpu commented out as shown below
> 
> #npx0 at isa? port 0xf0 irq 13        # x86 math coprocessor
> 
> This causes the kernel build to fail with following error
> 
> `libcompat.a' is up to date.
> `libkern.a' is up to date.
> cpu.o: In function `cpu_offline_md':
> cpu.c:(.text+0xcd): undefined reference to `npxsave_cpu'
> cpu.o: In function `cpu_hatch':
> cpu.c:(.text+0x5f5): undefined reference to `npxinit'
> 
> Is this situation correct?

probably not. Could you check if the attached patch makes a working
kernel for you ?

-- 
Manuel Bouyer <bouyer%antioche.eu.org@localhost>
     NetBSD: 26 ans d'experience feront toujours la difference
--
Index: src/sys/arch/x86/x86/cpu.c
===================================================================
RCS file: /cvsroot/src/sys/arch/x86/x86/cpu.c,v
retrieving revision 1.61
diff -u -p -u -r1.61 cpu.c
--- src/sys/arch/x86/x86/cpu.c  23 Dec 2008 15:41:21 -0000      1.61
+++ src/sys/arch/x86/x86/cpu.c  21 Jan 2009 20:43:38 -0000
@@ -71,6 +71,10 @@ __KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.61
 #include "lapic.h"
 #include "ioapic.h"
 
+#ifdef __i386__
+#include "npx.h"
+#endif
+
 #include <sys/param.h>
 #include <sys/proc.h>
 #include <sys/user.h>
@@ -720,7 +724,7 @@ cpu_hatch(void *v)
        lapic_set_lvt();
        lapic_initclocks();
 
-#ifdef i386
+#if defined(__i386__) && NNPX > 0
        npxinit(ci);
 #else
        fpuinit(ci);
@@ -979,7 +983,7 @@ cpu_offline_md(void)
        int s;
 
        s = splhigh();
-#ifdef __i386__
+#if defined(__i386__) && NNPX > 0
        npxsave_cpu(true);
 #else
        fpusave_cpu(true);


Home | Main Index | Thread Index | Old Index