diff options
author | davej <davej> | 2001-02-26 14:49:02 +0000 |
---|---|---|
committer | davej <davej> | 2001-02-26 14:49:02 +0000 |
commit | aaf1fcacca2edb65b0efc23e58cca3895ce2d6d9 (patch) | |
tree | 88569e00c10c76ef020cab23752e3485db4e48a3 /identify.c | |
parent | d11eabde1ea3729a206a3f120ec0aaea23f15df5 (diff) |
Now uses the /dev/cpuid driver if available (read as: SMP support).
Diffstat (limited to 'identify.c')
-rw-r--r-- | identify.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/identify.c b/identify.c new file mode 100644 index 0000000..60d94f2 --- /dev/null +++ b/identify.c @@ -0,0 +1,36 @@ +#include <stdio.h> +#include "x86info.h" + +void identify (int cpunum) +{ + struct cpudata cpu; + unsigned long maxi, eax, ebx, ecx, edx; + + /* Dump all the CPUID results in raw hex */ + cpuid (cpunum, 0, &maxi, NULL, NULL, NULL); + maxi &= 0xffff; /* The high-order word is non-zero on some Cyrix CPUs */ + + cpuid (cpunum, 0, &eax, &ebx, &ecx, &edx); + + switch (ebx) { + case 0x756e6547: /* Intel */ + dointel (cpunum, maxi, &cpu); + break; + + case 0x68747541: /* AMD */ + doamd (cpunum, maxi, &cpu); + break; + + case 0x69727943: /* Cyrix */ + docyrix (cpunum, maxi, &cpu); + break; + + case 0x746e6543: /* IDT */ + doIDT (cpunum, maxi, &cpu); + break; + + default: + printf ("Unknown vendor\n"); + break; + } +} |