cpuid: Using generic model if cyrix id is unknown
authorErwan Velu <erwanaliasr1@gmail.com>
Sat, 16 Apr 2011 18:34:40 +0000 (20:34 +0200)
committerErwan Velu <erwanaliasr1@gmail.com>
Sat, 16 Apr 2011 18:34:40 +0000 (20:34 +0200)
When using the specific Cyrix call to determine the model, if the model
is unknown, let's consider the generic call was right.

This insure a better display of the model id.

com32/gpllib/cpuid.c

index ee82b6e..2abd0bd 100644 (file)
@@ -325,10 +325,13 @@ void detect_cyrix(struct cpuinfo_x86 *c) {
                           dir0_msn = 7;
                           break;
        }
-       
-       strcpy(buf, Cx86_model[dir0_msn & 7]);
 
-       if (p) strcat(buf, p);
+       /* If the processor is unknown, we keep the model name we got
+        * from the generic call */
+       if (dir0_msn < 7) {     
+               strcpy(buf, Cx86_model[dir0_msn & 7]);
+               if (p) strcat(buf, p);
+       }
 }
 
 void generic_identify(struct cpuinfo_x86 *c)