Date: Tue, 8 Apr 2003 22:37:14 -0700 (PDT) From: Peter Wemm <peter@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 28616 for review Message-ID: <200304090537.h395bEZV045167@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=28616 Change 28616 by peter@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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200304090537.h395bEZV045167>