Chameleon

Chameleon Commit Details

Date:2010-07-23 22:54:49 (9 years 3 months ago)
Author:mozo
Commit:209
Parents: 208
Message:Experemental feature: C4 state & "EnableC4State" option in boot.plist
Changes:
M/branches/mozodojo/i386/libsaio/acpi_patcher.c
M/branches/mozodojo/i386/boot2/boot.h

File differences

branches/mozodojo/i386/libsaio/acpi_patcher.c
268268
269269
270270
271
272
273
271274
272275
273276
......
279282
280283
281284
282
285
286
283287
284288
285289
......
289293
290294
291295
292
296
297
293298
294299
295300
296301
297302
303
304
305
306
307
308
309
310
311
312
313
314
298315
299316
300317
301318
302
319
320
303321
304322
305323
306324
307325
326
308327
309328
310329
......
604623
605624
606625
607
626
608627
609628
610629
{
bool c2_enabled = fadt->C2_Latency < 100;
bool c3_enabled = fadt->C3_Latency < 1000;
bool c4_enabled = false;
getBoolForKey(kEnableC4States, &c4_enabled, &bootInfo->bootConfig);
unsigned char cstates_count = 1 + (c2_enabled ? 1 : 0) + (c3_enabled ? 1 : 0);
aml_add_byte(pack, cstates_count);
struct aml_chunk* tmpl = aml_add_package(pack);
cstate_resource_template[11] = 0x10; // C1
cstate_resource_template[11] = 0x00; // C1
cstate_resource_template[10] = 0x00; // C1
aml_add_buffer(tmpl, cstate_resource_template, sizeof(cstate_resource_template));
aml_add_byte(tmpl, 0x01); // C1
aml_add_byte(tmpl, 0x01); // Latency
if (c2_enabled)
{
tmpl = aml_add_package(pack);
cstate_resource_template[11] = 0x20; // C2
cstate_resource_template[11] = 0x10; // C2
cstate_resource_template[10] = 0x01; // C2
aml_add_buffer(tmpl, cstate_resource_template, sizeof(cstate_resource_template));
aml_add_byte(tmpl, 0x02); // C2
aml_add_byte(tmpl, fadt->C2_Latency);
aml_add_word(tmpl, 0x01f4); // Power
}
// C4
if (c4_enabled)
{
tmpl = aml_add_package(pack);
cstate_resource_template[11] = 0x30; // C4
cstate_resource_template[10] = 0x03; // C4
aml_add_buffer(tmpl, cstate_resource_template, sizeof(cstate_resource_template));
aml_add_byte(tmpl, 0x04); // C4
aml_add_word(tmpl, fadt->C3_Latency); // TODO: right latency for C4
aml_add_byte(tmpl, 0xfa); // Power
}
else
// C3
if (c3_enabled)
{
tmpl = aml_add_package(pack);
cstate_resource_template[11] = 0x30; // C3
cstate_resource_template[11] = 0x20; // C3
cstate_resource_template[10] = 0x02; // C3
aml_add_buffer(tmpl, cstate_resource_template, sizeof(cstate_resource_template));
aml_add_byte(tmpl, 0x03); // C3
aml_add_word(tmpl, fadt->C3_Latency);
aml_add_word(tmpl, 0x015e); // Power
}
// Aliaces
int i;
else
Platform.Type = (unsigned char) strtoul(value, NULL, 10);
}
// Set PM_Profile from System-type if only if user wanted this value to be forced
// Set PM_Profile from System-type if only user wanted this value to be forced
if (fadt_mod->PM_Profile != Platform.Type)
{
if (value)
branches/mozodojo/i386/boot2/boot.h
6868
6969
7070
71
7271
7372
73
7474
7575
7676
#define kDSDT"DSDT"/* acpi_patcher.c */
#define kDropSSDT"DropSSDT"/* acpi_patcher.c */
#define kRestartFix"RestartFix"/* acpi_patcher.c */
#define kRestartFix"RestartFix" /* acpi_patcher.c */
#define kGeneratePStates"GeneratePStates"/* acpi_patcher.c */
#define kGenerateCStates"GenerateCStates"/* acpi_patcher.c */
#define kEnableC4States"EnableC4State"/* acpi_patcher.c */
#define kDeviceProperties"device-properties"/* device_inject.c */
#define kHidePartition"Hide Partition"/* disk.c */
#define kRenamePartition"Rename Partition"/* disk.c */

Archive Download the corresponding diff file

Revision: 209