Chameleon

Chameleon Commit Details

Date:2012-12-18 03:11:32 (7 years 5 months ago)
Author:ErmaC
Commit:2148
Parents: 2147
Message:Apply patch by Geoff Seeley for Power On Self-Test from issue 59.
Changes:
M/branches/ErmaC/MainTrunkPatch/i386/libsaio/smbios_getters.c
M/branches/ErmaC/MainTrunkPatch/i386/libsaio/smbios.c
M/branches/ErmaC/MainTrunkPatch/i386/libsaio/smbios_getters.h
M/branches/ErmaC/MainTrunkPatch/i386/libsaio/smbios_decode.c

File differences

branches/ErmaC/MainTrunkPatch/i386/libsaio/smbios_getters.h
3333
3434
3535
36
3637
3738
3839
extern bool getSMBOemProcessorBusSpeed(returnType *value);
extern bool getSMBOemProcessorType(returnType *value);
extern bool getSMBMemoryDeviceMemoryType(returnType *value);
extern bool getSMBMemoryDeviceMemoryErrorHandle(returnType *value);
extern bool getSMBMemoryDeviceMemorySpeed(returnType *value);
extern bool getSMBMemoryDeviceManufacturer(returnType *value);
extern bool getSMBMemoryDeviceSerialNumber(returnType *value);
branches/ErmaC/MainTrunkPatch/i386/libsaio/smbios.c
246246
247247
248248
249
250
249251
250252
251253
{kSMBTypeMemoryDevice,kSMBString,getFieldOffset(SMBMemoryDevice, assetTag),NULL,NULL,NULL},
{kSMBTypeMemoryDevice,kSMBWord,getFieldOffset(SMBMemoryDevice, errorHandle), NULL, getSMBMemoryDeviceMemoryErrorHandle, NULL},
{kSMBTypeMemoryDevice,kSMBString,getFieldOffset(SMBMemoryDevice, partNumber),kSMBMemoryDevicePartNumberKey,
getSMBMemoryDevicePartNumber,NULL},
branches/ErmaC/MainTrunkPatch/i386/libsaio/smbios_decode.c
165165
166166
167167
168
168169
169170
170171
......
257258
258259
259260
261
260262
263
261264
262265
263266
if (minorVersion < 3 || structHeader->header.length < 27)
return;
DBG("\tmemorySpeed: %dMHz\n", structHeader->memorySpeed);
DBG("\terrorHandle: %x\n", structHeader->errorHandle);
DBG("\tmanufacturer: %s\n", getSMBStringForField((SMBStructHeader *)structHeader, structHeader->manufacturer));
DBG("\tserialNumber: %s\n", getSMBStringForField((SMBStructHeader *)structHeader, structHeader->serialNumber));
DBG("\tassetTag: %s\n", getSMBStringForField((SMBStructHeader *)structHeader, structHeader->assetTag));
for (; ((uint16_t *)ptr)[0] != 0; ptr++);
if (((uint16_t *)ptr)[0] == 0)
{
ptr += 2;
}
structHeader = (SMBStructHeader *)ptr;
}
branches/ErmaC/MainTrunkPatch/i386/libsaio/smbios_getters.c
2222
2323
2424
25
25
2626
2727
2828
......
3030
3131
3232
33
34
33
34
3535
3636
3737
......
4040
4141
4242
43
43
4444
4545
4646
......
109109
110110
111111
112
112
113
114
115
113116
114117
115118
......
148151
149152
150153
151
154
152155
153156
154157
......
167170
168171
169172
170
173
174
175
171176
177
172178
179
173180
174181
175182
176183
177
184
185
186
178187
188
179189
180
190
191
192
181193
182
194
195
196
197
183198
184199
185200
186201
202
187203
204
188205
206
189207
208
190209
191210
192211
......
230249
231250
232251
252
253
254
255
256
257
233258
234259
235260
......
270295
271296
272297
298
273299
300
274301
275302
276303
......
296323
297324
298325
326
299327
328
300329
301330
302331
......
319348
320349
321350
351
322352
353
323354
324355
325356
bool getProcessorInformationExternalClock(returnType *value)
{
if (Platform.CPU.Vendor == CPUID_VENDOR_INTEL) // Intel
{
{
switch (Platform.CPU.Family)
{
case 0x06:
switch (Platform.CPU.Model)
{
// set external clock to 0 for SANDY
// removes FSB info from system profiler as on real mac's.
case CPU_MODEL_SANDYBRIDGE:
// removes FSB info from system profiler as on real mac's.
case CPU_MODEL_SANDYBRIDGE:
case CPU_MODEL_IVYBRIDGE:
value->word = 0;
break;
}
}
break;
default:
value->word = Platform.CPU.FSBFrequency/1000000;
}
DBG("qpimult %d\n", qpimult);
qpibusspeed = (qpimult * 2 * (Platform.CPU.FSBFrequency/1000000));
// Rek: rounding decimals to match original mac profile info
if (qpibusspeed%100 != 0)qpibusspeed = ((qpibusspeed+50)/100)*100;
if (qpibusspeed%100 != 0)
{
qpibusspeed = ((qpibusspeed+50)/100)*100;
}
DBG("qpibusspeed %d\n", qpibusspeed);
value->word = qpibusspeed;
return true;
verbose("CPU is %s, family 0x%x, model 0x%x\n", Platform.CPU.BrandString, Platform.CPU.Family, Platform.CPU.Model);
done = true;
}
switch (Platform.CPU.Family)
{
case 0x06:
case CPU_MODEL_WESTMERE_EX:// Intel Xeon E7
case CPU_MODEL_JAKETOWN:// Intel Core i7, Xeon E5 LGA2011 (32nm)
if (strstr(Platform.CPU.BrandString, "Xeon(R)"))
value->word = 0x0501;// Xeon
{
value->word = 0x0501;// Xeon
}
else
{
value->word = 0x0701;// Core i7
}
return true;
case CPU_MODEL_FIELDS:// Intel Core i5, i7, Xeon X34xx LGA1156 (45nm)
if (strstr(Platform.CPU.BrandString, "Xeon(R)"))
value->word = 0x0501;// Xeon
{
value->word = 0x0501;// Xeon
}
else
{
if (strstr(Platform.CPU.BrandString, "Core(TM) i5"))
value->word = 0x0601;// Core i5
{
value->word = 0x0601;// Core i5
}
else
value->word = 0x0701;// Core i7
{
value->word = 0x0701;// Core i7
}
}
return true;
case CPU_MODEL_DALES:
if (strstr(Platform.CPU.BrandString, "Core(TM) i5"))
{
value->word = 0x0601;// Core i5
}
else
{
value->word = 0x0701;// Core i7
}
return true;
case CPU_MODEL_SANDYBRIDGE:// Intel Core i3, i5, i7 LGA1155 (32nm)
//return true;
}
bool getSMBMemoryDeviceMemoryErrorHandle(returnType *value)
{
value->word = 0xFFFF;
return true;
}
bool getSMBMemoryDeviceMemorySpeed(returnType *value)
{
static int idx = -1;
}
if (!bootInfo->memDetect)
{
return false;
}
value->string = NOT_AVAILABLE;
return true;
}
}
if (!bootInfo->memDetect)
{
return false;
}
value->string = NOT_AVAILABLE;
return true;
}
}
if (!bootInfo->memDetect)
{
return false;
}
value->string = NOT_AVAILABLE;
return true;
}

Archive Download the corresponding diff file

Revision: 2148