aboutsummaryrefslogtreecommitdiffstats
path: root/com32/gpllib
diff options
context:
space:
mode:
authorErwan Velu <erwanaliasr1@gmail.com>2011-04-14 20:58:05 +0200
committerErwan Velu <erwanaliasr1@gmail.com>2011-04-14 20:58:05 +0200
commit629199e1eaa19e21a6da0769c163dd131aa80163 (patch)
tree64fc1eb540cf26417fe1d753197adf40365dbd70 /com32/gpllib
parent64bade68d3ebde2c88135e5270e54e192d164692 (diff)
downloadsyslinux-629199e1eaa19e21a6da0769c163dd131aa80163.tar.gz
syslinux-629199e1eaa19e21a6da0769c163dd131aa80163.tar.xz
syslinux-629199e1eaa19e21a6da0769c163dd131aa80163.zip
cpuid: Managing UNKNOWN CPU better
It's safe to manage the unknown cpu as a regular one. This will avoid weird behavior when CPU isn't well detected.
Diffstat (limited to 'com32/gpllib')
-rw-r--r--com32/gpllib/cpuid.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/com32/gpllib/cpuid.c b/com32/gpllib/cpuid.c
index 37e00fec..471b7166 100644
--- a/com32/gpllib/cpuid.c
+++ b/com32/gpllib/cpuid.c
@@ -101,6 +101,11 @@ static struct cpu_dev nsc_cpu_dev = {
.c_ident = {"Geode by NSC"}
};
+static struct cpu_dev unknown_cpu_dev = {
+ .c_vendor = "Unknown Vendor",
+ .c_ident = {"Unknown CPU"}
+};
+
void init_cpu_devs(void)
{
cpu_devs[X86_VENDOR_INTEL] = &intel_cpu_dev;
@@ -112,6 +117,7 @@ void init_cpu_devs(void)
cpu_devs[X86_VENDOR_RISE] = &rise_cpu_dev;
cpu_devs[X86_VENDOR_TRANSMETA] = &transmeta_cpu_dev;
cpu_devs[X86_VENDOR_NSC] = &nsc_cpu_dev;
+ cpu_devs[X86_VENDOR_UNKNOWN] = &unknown_cpu_dev;
}
void get_cpu_vendor(struct cpuinfo_x86 *c)
@@ -119,7 +125,7 @@ void get_cpu_vendor(struct cpuinfo_x86 *c)
char *v = c->x86_vendor_id;
int i;
init_cpu_devs();
- for (i = 0; i < X86_VENDOR_NUM; i++) {
+ for (i = 0; i < X86_VENDOR_NUM-1; i++) {
if (cpu_devs[i]) {
if (!strcmp(v, cpu_devs[i]->c_ident[0]) ||
(cpu_devs[i]->c_ident[1] &&