Index: branches/azimutz/Chazi/i386/libsaio/acpi_patcher.c =================================================================== --- branches/azimutz/Chazi/i386/libsaio/acpi_patcher.c (revision 616) +++ branches/azimutz/Chazi/i386/libsaio/acpi_patcher.c (revision 617) @@ -281,11 +281,16 @@ 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(kEnableC4StatesKey, &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); @@ -477,7 +482,7 @@ if (maximum.CID < minimum.CID) { DBG("Insane FID values!"); - p_states_count = 1; + p_states_count = 0; } else { @@ -527,7 +532,9 @@ p_states_count -= invalid; } - } break; + + break; + } case CPU_MODEL_FIELDS: case CPU_MODEL_DALES: case CPU_MODEL_DALES_32NM: @@ -535,6 +542,35 @@ case CPU_MODEL_NEHALEM_EX: case CPU_MODEL_WESTMERE: case CPU_MODEL_WESTMERE_EX: + { + // Is it allways the maximum multiplier? + maximum.Control = rdmsr64(MSR_IA32_PERF_STATUS) & 0xff; + + // fix me: dirty method to get lowest multiplier... Hardcoded value! + minimum.Control = 0x09; + + // 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; Index: branches/azimutz/Chazi/i386/boot2/boot.h =================================================================== --- branches/azimutz/Chazi/i386/boot2/boot.h (revision 616) +++ branches/azimutz/Chazi/i386/boot2/boot.h (revision 617) @@ -97,9 +97,9 @@ #define kBootUUIDKey "boot-uuid" // options.c processBootArg - kFlag #define kHelperRootUUIDKey "Root UUID" // options.c getValFK #define kArchKey "arch" // boot.c getValFK - kFlag -#define kKernelNameKey "Kernel" // options.c getValFK +#define kKernelNameKey "Kernel" // options.c getValFK - kFlag*** bFlag ? #define kKernelCacheKey "Kernel Cache" // boot.c getValFK - kFlag -#define kKernelFlagsKey "Kernel Flags" // options.c getValFK +#define kKernelFlagsKey "Kernel Flags" // options.c getValFK - kFlags*** #define kKPatcherKey "PatchKernel" // kernel_patcher.c getBoolFK #define kAltExtensionsKey "kext" // drivers.c getValFK #define kMKextCacheKey "MKext Cache" // options.c getValFK - kFlag @@ -116,9 +116,11 @@ #define kDSDTKey "DSDT" // acpi_patcher.c getValFK #define kDropSSDTKey "DropSSDT" // acpi_patcher.c getBoolFK #define kRestartFixKey "RestartFix" // acpi_patcher.c getBoolFK - revert to true? -#define kGeneratePStatesKey "GeneratePStates" // acpi_patcher.c getBoolFK -#define kGenerateCStatesKey "GenerateCStates" // acpi_patcher.c getBoolFK -#define kEnableC4StatesKey "EnableC4State" // acpi_patcher.c getBoolFK +#define kGeneratePStatesKey "GeneratePStates" // acpi_patcher.c getBoolFK - add to BootHelp*** +#define kGenerateCStatesKey "GenerateCStates" // acpi_patcher.c getBoolFK || +#define kEnableC2States "EnableC2State" // acpi_patcher.c getBoolFK || +#define kEnableC3States "EnableC3State" // acpi_patcher.c getBoolFK || +#define kEnableC4StatesKey "EnableC4State" // acpi_patcher.c getBoolFK || #define kUseMemDetectKey "UseMemDetect" // platform.c getBoolFK #define kSMBIOSdefaultsKey "SMBIOSdefaults" // smbios_patcher.c getBoolFK #define kSMBIOSKey "SMBIOS" // fake_efi.c getValFK