Chameleon

Chameleon Commit Details

Date:2010-07-23 21:23:51 (8 years 11 months ago)
Author:mozo
Commit:208
Parents: 207
Message:Destroying node and use node->length after is not a good idea. SPD serial number extraction changed - values are ASCII chars, need to test on mem module with serial number.
Changes:
M/branches/mozodojo/i386/libsaio/acpi_patcher.c
M/branches/mozodojo/i386/libsaio/spd.c

File differences

branches/mozodojo/i386/libsaio/acpi_patcher.c
323323
324324
325325
326
327326
328327
329328
330329
331330
331
332
332333
333334
334335
......
535536
536537
537538
538
539539
540540
541541
542542
543543
544
545
544546
545547
546548
struct acpi_2_ssdt *ssdt = (struct acpi_2_ssdt *)AllocateKernelMemory(root->Size);
aml_write_node(root, (void*)ssdt, 0);
aml_destroy_node(root);
ssdt->Length = root->Size;
ssdt->Checksum = 0;
ssdt->Checksum = 256 - checksum8(ssdt, ssdt->Length);
aml_destroy_node(root);
//dumpPhysAddr("C-States SSDT content: ", ssdt, ssdt->Length);
verbose ("SSDT with CPU C-States generated successfully\n");
struct acpi_2_ssdt *ssdt = (struct acpi_2_ssdt *)AllocateKernelMemory(root->Size);
aml_write_node(root, (void*)ssdt, 0);
aml_destroy_node(root);
ssdt->Length = root->Size;
ssdt->Checksum = 0;
ssdt->Checksum = 256 - checksum8(ssdt, ssdt->Length);
aml_destroy_node(root);
//dumpPhysAddr("P-States SSDT content: ", ssdt, ssdt->Length);
verbose ("SSDT with CPU P-States generated successfully\n");
branches/mozodojo/i386/libsaio/spd.c
164164
165165
166166
167
168
169167
170
171
168
169
170
172171
173
174
172
173
174
175175
176176
177
178
179
180177
181178
182179
const char *getDDRSerial(const char* spd)
{
static char asciiSerial[16];
static uint8_t serialnum=0;
uint32_t ret=0;
if (spd[SPD_MEMORY_TYPE]==SPD_MEMORY_TYPE_SDRAM_DDR3) {// DDR3
ret = UIS(122) | (UIS(123)<<8) | (UIS(124)<<16) | ((UIS(125)&0x7f)<<24);
if (spd[SPD_MEMORY_TYPE]==SPD_MEMORY_TYPE_SDRAM_DDR3) // DDR3
{
sprintf(asciiSerial, "%c%c%c%c", spd[125] & 0x7f, spd[124], spd[123], spd[122]);
}
else if (spd[SPD_MEMORY_TYPE]==SPD_MEMORY_TYPE_SDRAM_DDR2) { // DDR2 or DDR
ret = UIS(95) | (UIS(96)<<8) | (UIS(97)<<16) | ((UIS(98)&0x7f)<<24);
else if (spd[SPD_MEMORY_TYPE]==SPD_MEMORY_TYPE_SDRAM_DDR2) // DDR2 or DDR
{
sprintf(asciiSerial, "%c%c%c%c", spd[98] & 0x7f, spd[97], spd[96], spd[95]);
}
if (!ret) sprintf(asciiSerial, "10000000%d", serialnum++);
else sprintf(asciiSerial, "%X", ret);
return strdup(asciiSerial);
}

Archive Download the corresponding diff file

Revision: 208