#define DBG(x...)␊ |
#endif␊ |
␊ |
uint64_t acpi10_p;␊ |
uint64_t acpi20_p;␊ |
␊ |
␊ |
extern char* gSMBIOSBoardModel;␊ |
␊ |
␊ |
// Slice: New signature compare function␊ |
boolean_t tableSign(char *table, const char *sgn)␊ |
{␊ |
|
␉␉sprintf(dirSpec,"%s.%s", gSMBIOSBoardModel, filename);␊ |
␉␉fd = open(dirSpec, 0);␊ |
␉}␊ |
␉␊ |
␉if (fd < 0)␊ |
␉{␊ |
␉␉sprintf(dirSpec, "%s", filename); ␊ |
␉␉fd = open(dirSpec, 0);␊ |
␉␉if (fd < 0)␊ |
␉␉{␉␊ |
␉␉{␊ |
␉␉␉if(gSMBIOSBoardModel)␊ |
␉␉␉{␊ |
␉␉␉␉sprintf(dirSpec, "/Extra/%s.%s", gSMBIOSBoardModel, filename);␊ |
|
␉␉␉␉␉␉fd = open(dirSpec, 0);␊ |
␉␉␉␉␉}␊ |
␉␉␉␉␉if (fd < 0)␊ |
␉␉␉␉␉{␉␉␉␉␉␉␊ |
␉␉␉␉␉{␊ |
␉␉␉␉␉␉sprintf(dirSpec, "bt(0,0)/Extra/%s", filename);␊ |
␉␉␉␉␉␉fd = open(dirSpec, 0);␊ |
␉␉␉␉␉}␊ |
␉␉␉␉}␊ |
␉␉␉␉␊ |
␉␉␉}␊ |
␉␉}␊ |
␉}␊ |
|
␉␉verbose("ACPI table not found: %s\n", filename);␊ |
␉␉*dirSpec = '\0';␊ |
␉}␊ |
␊ |
␉␊ |
␉if (outDirspec) *outDirspec = dirSpec; ␊ |
␉return fd;␊ |
}␊ |
|
␉␊ |
␉if (acpi_cpu_count > 0) ␊ |
␉{␊ |
␉␉bool c2_enabled = fadt->C2_Latency < 100;␊ |
␉␉bool c3_enabled = fadt->C3_Latency < 1000;␊ |
␉␉bool c2_enabled = false;␊ |
␉␉bool c3_enabled = false;␊ |
␉␉bool c4_enabled = false;␊ |
␉␉␊ |
␉␉getBoolForKey(kEnableC2States, &c2_enabled, &bootInfo->bootConfig);␊ |
␉␉getBoolForKey(kEnableC3States, &c3_enabled, &bootInfo->bootConfig);␊ |
␉␉getBoolForKey(kEnableC4States, &c4_enabled, &bootInfo->bootConfig);␊ |
␉␉␊ |
␉␉c2_enabled = c2_enabled | (fadt->C2_Latency < 100);␊ |
␉␉c3_enabled = c3_enabled | (fadt->C3_Latency < 1000);␊ |
␉␉␊ |
␉␉unsigned char cstates_count = 1 + (c2_enabled ? 1 : 0) + (c3_enabled ? 1 : 0);␊ |
␉␉␊ |
␉␉struct aml_chunk* root = aml_create_node(NULL);␊ |
|
␉␉␉␉␉␉if (maximum.CID < minimum.CID) ␊ |
␉␉␉␉␉␉{␊ |
␉␉␉␉␉␉␉DBG("Insane FID values!");␊ |
␉␉␉␉␉␉␉p_states_count = 1;␊ |
␉␉␉␉␉␉␉p_states_count = 0;␊ |
␉␉␉␉␉␉}␊ |
␉␉␉␉␉␉else␊ |
␉␉␉␉␉␉{␊ |
|
␉␉␉␉␉␉␉␊ |
␉␉␉␉␉␉␉p_states_count -= invalid;␊ |
␉␉␉␉␉␉}␊ |
␉␉␉␉␉} break;␊ |
␉␉␉␉␉␉␊ |
␉␉␉␉␉␉break;␊ |
␉␉␉␉␉} ␊ |
␉␉␉␉␉case CPU_MODEL_FIELDS:␊ |
␉␉␉␉␉case CPU_MODEL_DALES:␊ |
␉␉␉␉␉case CPU_MODEL_DALES_32NM:␊ |
|
␉␉␉␉␉case CPU_MODEL_NEHALEM_EX:␊ |
␉␉␉␉␉case CPU_MODEL_WESTMERE:␊ |
␉␉␉␉␉case CPU_MODEL_WESTMERE_EX:␊ |
␉␉␉␉␉{␊ |
␉␉␉␉␉␉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;␊ |
␉␉␉␉␉␉␊ |
␉␉␉␉␉␉verbose("P-States: min 0x%x, max 0x%x\n", minimum.Control, maximum.Control);␉␉␉␊ |
␉␉␉␉␉␉␊ |
␉␉␉␉␉␉// Sanity check␊ |
␉␉␉␉␉␉if (maximum.Control < minimum.Control) ␊ |
␉␉␉␉␉␉{␊ |
␉␉␉␉␉␉␉DBG("Insane control values!");␊ |
␉␉␉␉␉␉␉p_states_count = 0;␊ |
␉␉␉␉␉␉}␊ |
␉␉␉␉␉␉else␊ |
␉␉␉␉␉␉{␊ |
␉␉␉␉␉␉␉uint8_t i;␊ |
␉␉␉␉␉␉␉p_states_count = 0;␊ |
␉␉␉␉␉␉␉␊ |
␉␉␉␉␉␉␉for (i = maximum.Control; i >= minimum.Control; i--) ␊ |
␉␉␉␉␉␉␉{␊ |
␉␉␉␉␉␉␉␉p_states[p_states_count].Control = i;␊ |
␉␉␉␉␉␉␉␉p_states[p_states_count].CID = p_states[p_states_count].Control << 1;␊ |
␉␉␉␉␉␉␉␉p_states[p_states_count].Frequency = (Platform->CPU.FSBFrequency / 1000000) * i;␊ |
␉␉␉␉␉␉␉␉p_states_count++;␊ |
␉␉␉␉␉␉␉}␊ |
␉␉␉␉␉␉}␊ |
␉␉␉␉␉␉␊ |
␉␉␉␉␉␉break;␊ |
␉␉␉␉␉}␉␊ |
␉␉␉␉␉default:␊ |
␉␉␉␉␉␉verbose ("Unsupported CPU: P-States not generated !!!\n");␊ |
␉␉␉␉␉␉break;␊ |
|
␉{␊ |
␉␉DBG("DSDT: Old @%x,%x, ",fadt_mod->DSDT,fadt_mod->X_DSDT);␊ |
␉␉␊ |
␉␉␊ |
␉␉// Insert old dsdt into the IORegistery␊ |
␉␉Node* node = DT__FindNode("/dsdt", false);␊ |
␉␉if(node == NULL)␊ |
|
␉␉sprintf(dirSpec, "DSDT.%s.aml", gSMBIOSBoardModel);␊ |
␉␉new_dsdt = loadACPITable(dirSpec);␊ |
␉}␊ |
␉␊ |
␉// Mozodojo: going to patch FACP and load SSDT's even if DSDT.aml is not present␊ |
␉/*if (!new_dsdt)␊ |
␉ {␊ |