Chameleon

Chameleon Commit Details

Date:2012-05-07 20:12:13 (7 years 2 months ago)
Author:Cosmosis Jones
Commit:1942
Parents: 1941
Message:http://forge.voodooprojects.org/p/chameleon/issues/247/
Changes:
M/trunk/i386/libsaio/acpi_patcher.c

File differences

trunk/i386/libsaio/acpi_patcher.c
158158
159159
160160
161
162
161163
162164
163165
164166
167
168
165169
166170
167171
......
195199
196200
197201
202
203
198204
199205
200206
......
385391
386392
387393
388
394
389395
390396
391397
......
416422
417423
418424
419
425
420426
421427
422428
......
568574
569575
570576
571
572
577
578
579
580
581
582
583
584
573585
574586
575587
......
596608
597609
598610
599
611
600612
601613
602614
......
779791
780792
781793
794
782795
783796
784797
785798
799
800
801
786802
787803
788804
......
812828
813829
814830
831
832
833
815834
816835
817836
......
919938
920939
921940
941
922942
923943
924944
......
926946
927947
928948
949
929950
930951
931952
{
uint32_t i;
DBG("start finding cpu names. length %d\n", length);
for (i=0; i<length-7; i++)
{
if (dsdt[i] == 0x5B && dsdt[i+1] == 0x83) // ProcessorOP
{
DBG("dsdt: %x%x\n", dsdt[i], dsdt[i+1]);
uint32_t offset = i + 3 + (dsdt[i+2] >> 6);
bool add_name = true;
}
}
}
DBG("end finding cpu names: cpu names found: %d\n", acpi_cpu_count);
}
struct acpi_2_ssdt *generate_cst_ssdt(struct acpi_2_fadt* fadt)
aml_destroy_node(root);
//dumpPhysAddr("C-States SSDT content: ", ssdt, ssdt->Length);
// dumpPhysAddr("C-States SSDT content: ", ssdt, ssdt->Length);
verbose ("SSDT with CPU C-States generated successfully\n");
}
if (!(Platform.CPU.Features & CPU_FEATURE_MSR)) {
verbose ("Unsupported CPU: P-States will not be generated !!!\n");
verbose ("Unsupported CPU: P-States will not be generated !!! No MSR support\n");
return NULL;
}
case CPU_MODEL_JAKETOWN:// Intel Core i7, Xeon E5 LGA2011 (32nm)
{
maximum.Control = rdmsr64(MSR_IA32_PERF_STATUS) & 0xff; // Seems it always contains maximum multiplier value (with turbo, that's we need)...
minimum.Control = (rdmsr64(MSR_PLATFORM_INFO) >> 40) & 0xff;
if ((Platform.CPU.Model == CPU_MODEL_SANDYBRIDGE) ||
(Platform.CPU.Model == CPU_MODEL_JAKETOWN))
{
maximum.Control = (rdmsr64(MSR_IA32_PERF_STATUS) >> 8) & 0xff;
} else {
maximum.Control = rdmsr64(MSR_IA32_PERF_STATUS) & 0xff;
}
minimum.Control = (rdmsr64(MSR_PLATFORM_INFO) >> 40) & 0xff;
verbose("P-States: min 0x%x, max 0x%x\n", minimum.Control, maximum.Control);
break;
}
default:
verbose ("Unsupported CPU: P-States not generated !!!\n");
verbose ("Unsupported CPU: P-States not generated !!! Unknown CPU Type\n");
break;
}
}
int version;
void *new_dsdt;
const char *filename;
char dirSpec[128];
int len = 0;
// always reset cpu count to 0 when injecting new acpi
acpi_cpu_count = 0;
// Try using the file specified with the DSDT option
if (getValueForKey(kDSDT, &filename, &len, &bootInfo->chameleonConfig))
{
getBoolForKey(kGeneratePStates, &generate_pstates, &bootInfo->chameleonConfig);
getBoolForKey(kGenerateCStates, &generate_cstates, &bootInfo->chameleonConfig);
DBG("generating p-states config: %d\n", generate_pstates);
DBG("generating c-states config: %d\n", generate_cstates);
{
int i;
// Generate _CST SSDT
if (generate_cstates && (new_ssdt[ssdt_count] = generate_cst_ssdt(fadt_mod)))
{
DBG("c-states generated\n");
generate_cstates = false; // Generate SSDT only once!
ssdt_count++;
}
// Generating _PSS SSDT
if (generate_pstates && (new_ssdt[ssdt_count] = generate_pss_ssdt((void*)fadt_mod->DSDT)))
{
DBG("p-states generated\n");
generate_pstates = false; // Generate SSDT only once!
ssdt_count++;
}

Archive Download the corresponding diff file

Revision: 1942