Chameleon

Chameleon Commit Details

Date:2010-07-24 16:07:30 (13 years 8 months ago)
Author:mozo
Commit:218
Parents: 217
Message:ACPI CPU name searching algorithm fixed. Should work now with any DSDT.
Changes:
M/branches/mozodojo/i386/libsaio/acpi_patcher.c

File differences

branches/mozodojo/i386/libsaio/acpi_patcher.c
189189
190190
191191
192
192
193193
194
194
195195
196196
197197
198198
199199
200
200
201
201202
202203
204
205
203206
204207
205208
......
207210
208211
209212
210
213
211214
212215
213216
......
218221
219222
220223
221
224
222225
223226
224227
......
356359
357360
358361
359
362
360363
361364
362365
......
569572
570573
571574
572
575
573576
574577
575578
uint8_tacpi_cpu_count = 0;
char* acpi_cpu_name[32];
void get_acpi_cpu_names(unsigned char* dsdt, int length)
void get_acpi_cpu_names(unsigned char* dsdt, unsigned int length)
{
int i;
unsigned int i;
for (i=0; i<length-7; i++)
{
if (dsdt[i] == 0x5B && dsdt[i+1] == 0x83) // ProcessorOP
{
uint8_t offset = i+3+(dsdt[i+2] >> 6), j;
unsigned int offset = i + 3 + (dsdt[i+2] >> 6);
bool add_name = TRUE;
char j;
for (j=0; j<4; j++)
{
char c = dsdt[offset+j];
if (!aml_isvalidchar(c))
{
add_name = FALSE;
verbose("Invalid characters found in ProcessorOP 0x%x!\n", c);
verbose("Invalid character found in ProcessorOP 0x%x!\n", c);
break;
}
}
memcpy(acpi_cpu_name[acpi_cpu_count], dsdt+offset, 4);
i = offset + 5;
verbose("Found %c%c%c%c (from DSDT)\n", acpi_cpu_name[acpi_cpu_count][0], acpi_cpu_name[acpi_cpu_count][1], acpi_cpu_name[acpi_cpu_count][2], acpi_cpu_name[acpi_cpu_count][3]);
verbose("Found ACPI CPU: %c%c%c%c\n", acpi_cpu_name[acpi_cpu_count][0], acpi_cpu_name[acpi_cpu_count][1], acpi_cpu_name[acpi_cpu_count][2], acpi_cpu_name[acpi_cpu_count][3]);
if (++acpi_cpu_count == 32) return;
}
}
else
{
verbose ("DSDT CPUs not found: C-States not generated !!!\n");
verbose ("ACPI CPUs not found: C-States not generated !!!\n");
}
return NULL;
}
}
else {
verbose ("DSDT CPUs not found: P-States not generated !!!\n");
verbose ("ACPI CPUs not found: P-States not generated !!!\n");
}
return NULL;

Archive Download the corresponding diff file

Revision: 218