OcCpuLib: Fix model detection for certain CPUs
@@ -80,9 +80,12 @@ DetectAppleMajorType (
if (AsciiStrnCmp (BrandInfix, "M", L_STR_LEN ("M")) == 0) {
return AppleProcessorMajorM;
}
- if (AsciiStrnCmp (BrandInfix, "2 Duo", L_STR_LEN("2 Duo")) == 0) {
+ if (AsciiStrnCmp (BrandInfix, "Duo", L_STR_LEN ("Duo")) == 0) {
return AppleProcessorMajorCore2;
}
+ if (AsciiStrnCmp (BrandInfix, "Quad", L_STR_LEN ("Quad")) == 0) {
+ return AppleProcessorMajorXeonPenryn;
+ }
return AppleProcessorMajorCore;
}
@@ -96,6 +99,16 @@ DetectAppleMajorType (
++BrandInfix;
}
+ //
+ // Support both variants: Xeon(R) E5-1234 and Xeon(R) CPU E5-1234
+ //
+ if (AsciiStrnCmp (BrandInfix, "CPU", L_STR_LEN ("CPU")) == 0) {
+ BrandInfix += L_STR_LEN ("CPU");
+ while (*BrandInfix == ' ') {
+ ++BrandInfix;
+ }
+ }
+
if (AsciiStrnCmp (BrandInfix, "E5", L_STR_LEN ("E5")) == 0) {
return AppleProcessorMajorXeonE5;
}
