changeset 2284:0c5fea3a0b91

amd...?
author pontscho
date Fri, 19 Oct 2001 13:28:59 +0000
parents f6d14b1cd73e
children 4840e356d0d3
files cpudetect.c
diffstat 1 files changed, 20 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/cpudetect.c	Fri Oct 19 13:18:04 2001 +0000
+++ b/cpudetect.c	Fri Oct 19 13:28:59 2001 +0000
@@ -134,6 +134,26 @@
 	if (regs[1] == 0x68747541 &&    // AuthenticAMD
             regs[3] == 0x69746e65 &&
             regs[2] == 0x444d4163) {
+		do_cpuid(0x00000001, regs2);
+		printf("CPU family: %d\n",(regs2[0] >> 8)&0xf);
+		switch ((regs2[0] >> 8)&0xf) {
+			case 3:
+				caps->cpuType=CPUTYPE_I386;
+				break;
+			case 4:
+				caps->cpuType=CPUTYPE_I486;
+				break;
+			case 5:
+				caps->cpuType=CPUTYPE_I586;
+				break;
+			case 6:
+				caps->cpuType=CPUTYPE_I686;
+				break;
+			default:
+				caps->cpuType=CPUTYPE_I386;
+				printf("Unknown cpu type, default to i386\n");
+				break;
+		}
 		do_cpuid(0x80000000, regs);
 		printf("AMD cpuid-level: 0x%X\n",regs[0]);
 		if (regs[0]>=0x80000001) {