PERFORCE change 28616 for review
John Baldwin
jhb at FreeBSD.org
Wed Apr 9 09:00:35 PDT 2003
On 09-Apr-2003 Peter Wemm wrote:
> 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.
Can we do this for i386 as well?
> 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
--
John Baldwin <jhb at FreeBSD.org> <>< http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve!" - http://www.FreeBSD.org/
More information about the p4-projects
mailing list