PERFORCE change 28616 for review
Peter Wemm
peter at FreeBSD.org
Tue Apr 8 22:37:16 PDT 2003
http://perforce.freebsd.org/chv.cgi?CH=28616
Change 28616 by peter at peter_daintree on 2003/04/08 22:36:45
move identify_cpu from locore to here.
Affected files ...
.. //depot/projects/hammer/sys/x86_64/x86_64/identcpu.c#4 edit
Differences ...
==== //depot/projects/hammer/sys/x86_64/x86_64/identcpu.c#4 (text+ko) ====
@@ -62,7 +62,7 @@
/* XXX - should be in header file: */
void printcpuinfo(void);
-void finishidentcpu(void);
+void identify_cpu(void);
void earlysetcpuclass(void);
void panicifcpuunsupported(void);
@@ -280,8 +280,21 @@
* Final stage of CPU identification. -- Should I check TI?
*/
void
-finishidentcpu(void)
+identify_cpu(void)
{
+ u_int regs[4];
+
+ do_cpuid(0, regs);
+ cpu_high = regs[0];
+ ((u_int *)&cpu_vendor)[0] = regs[1];
+ ((u_int *)&cpu_vendor)[1] = regs[2];
+ ((u_int *)&cpu_vendor)[2] = regs[3];
+ cpu_vendor[12] = '\0';
+
+ do_cpuid(1, regs);
+ cpu_id = regs[0];
+ cpu_procinfo = regs[1];
+ cpu_feature = regs[3];
}
static void
More information about the p4-projects
mailing list