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

[PATCH] passing proper cpu_device to cpu_setup() on cpu.c::cpu_init()



[ I'm not on the list, so please Cc: me on replies ]

I booted bsd.mp of a somewhat recent snapshot on my old Pentium
233MMX, and noticed a broken message at the end of cpu0 stuff:

OpenBSD 3.6 (GENERIC.MP) #156: Fri Aug 27 11:41:07 MDT 2004
    deraadt_(_at_)_i386_(_dot_)_openbsd_(_dot_)_org:/usr/src/sys/arch/i386/compile/GENERIC.MP
...
cpu0 at mainbus0: (uniprocessor)
cpu0: Intel Pentium/MMX ("GenuineIntel" 586-class) 234 MHz
cpu0: FPU,V86,DE,PSE,TSC,MSR,MCE,CX8,MMX
(null): F00F bug workaround installed

The following one-liner fixes that:

Index: sys/arch/i386/i386/cpu.c
===================================================================
RCS file: /cvs/src/sys/arch/i386/i386/cpu.c,v
retrieving revision 1.11
diff -u -r1.11 cpu.c
--- sys/arch/i386/i386/cpu.c	14 Jul 2004 19:24:29 -0000	1.11
+++ sys/arch/i386/i386/cpu.c	9 Sep 2004 00:38:47 -0000
@@ -336,7 +336,7 @@
 {
 	/* configure the CPU if needed */
 	if (ci->cpu_setup != NULL)
-		(*ci->cpu_setup)(NULL, 0, 0);
+		(*ci->cpu_setup)(ci->ci_dev.dv_xname, 0, 0);
 
 #if defined(I486_CPU) || defined(I586_CPU) || defined(I686_CPU)
 	/*

Now the message looks like this:

OpenBSD 3.6 (GENERIC.MP) #0: Wed Sep  8 14:19:47 BRT 2004
    olive_(_at_)_olive_(_dot_)_homeunix_(_dot_)_org:/usr/src/sys/arch/i386/compile/GENERIC.MP
...
cpu0 at mainbus0: (uniprocessor)
cpu0: Intel Pentium/MMX ("GenuineIntel" 586-class) 234 MHz
cpu0: FPU,V86,DE,PSE,TSC,MSR,MCE,CX8,MMX
cpu0: F00F bug workaround installed

I hope this fix is the correct one. I read machdep.c in the same
directory and it looked at the same field in some non-SMP code that
seemed to have the same function.

Regards,
Fábio Olivé Leite

-- 
I drowned in the universal pool of entropy
Eris has saved me, and she has set me free