Update PoInitializeProcessorControlBlock() routine and corresponding structures
Builds / ExectOS (i686) (push) Successful in 50s Details
Builds / ExectOS (amd64) (push) Successful in 53s Details

This commit is contained in:
Rafal Kupiec 2024-05-09 22:12:50 +02:00
parent c34b6ff6c1
commit eeeb9d6ed7
Signed by: belliash
GPG Key ID: 4E829243E0CFE6B4
2 changed files with 63 additions and 1 deletions

View File

@ -15,16 +15,77 @@
/* Power Manager routine callbacks */
typedef VOID (XTFASTCALL *PPROCESSOR_IDLE_FUNCTION)(PPROCESSOR_POWER_STATE PowerState);
typedef VOID (XTFASTCALL *PPROCESSOR_IDLE_FUNCTION)(IN PPROCESSOR_POWER_STATE PowerState);
typedef XTSTATUS (XTFASTCALL *PSET_PROCESSOR_THROTTLE)(IN UCHAR Throttle);
/* Processor IDLE times structure definition */
typedef struct _PROCESSOR_IDLE_TIMES
{
ULONGLONG StartTime;
ULONGLONG EndTime;
ULONG IdleHandlerReserved[4];
} PROCESSOR_IDLE_TIMES, *PPROCESSOR_IDLE_TIMES;
/* Processor performance state structure definition */
typedef struct _PROCESSOR_PERF_STATE
{
UCHAR PercentFrequency;
UCHAR MinCapacity;
USHORT Power;
UCHAR IncreaseLevel;
UCHAR DecreaseLevel;
USHORT Flags;
ULONG IncreaseTime;
ULONG DecreaseTime;
ULONG IncreaseCount;
ULONG DecreaseCount;
ULONGLONG PerformanceTime;
} PROCESSOR_PERF_STATE, *PPROCESSOR_PERF_STATE;
/* Processor power state structure definition */
typedef struct _PROCESSOR_POWER_STATE
{
PPROCESSOR_IDLE_FUNCTION IdleFunction;
ULONG Idle0TimeLimit;
ULONG Idle0LastTime;
PVOID IdleHandlers;
PVOID IdleState;
ULONG IdleHandlersCount;
ULONGLONG LastCheck;
PROCESSOR_IDLE_TIMES IdleTimes;
ULONG IdleTime1;
ULONG PromotionCheck;
ULONG IdleTime2;
UCHAR CurrentThrottle;
UCHAR ThermalThrottleLimit;
UCHAR CurrentThrottleIndex;
UCHAR ThermalThrottleIndex;
ULONG PerfSystemTime;
ULONG PerfIdleTime;
ULONG LastSysTime;
ULONGLONG TotalIdleStateTime[3];
ULONG TotalIdleTransitions[3];
ULONGLONG PreviousC3StateTime;
UCHAR KneeThrottleIndex;
UCHAR ThrottleLimitIndex;
UCHAR PerfStatesCount;
UCHAR ProcessorMinThrottle;
UCHAR ProcessorMaxThrottle;
UCHAR LastBusyPercentage;
UCHAR LastC3Percentage;
UCHAR LastAdjustedBusyPercentage;
ULONG PromotionCount;
ULONG DemotionCount;
ULONG ErrorCount;
ULONG RetryCount;
ULONG Flags;
LARGE_INTEGER PerfCounterFrequency;
ULONG PerfTickCount;
KTIMER PerfTimer;
KDPC PerfDpc;
PPROCESSOR_PERF_STATE PerfStates;
PSET_PROCESSOR_THROTTLE PerfSetThrottle;
ULONG LastC3UserTime;
} PROCESSOR_POWER_STATE, *PPROCESSOR_POWER_STATE;
#endif /* __XTDK_POTYPES_H */

View File

@ -29,6 +29,7 @@ PoInitializeProcessorControlBlock(IN OUT PKPROCESSOR_CONTROL_BLOCK Prcb)
/* Initialize default power state */
Prcb->PowerState.Idle0TimeLimit = 0xFFFFFFFF;
Prcb->PowerState.CurrentThrottle = 100;
Prcb->PowerState.CurrentThrottleIndex = 0;
Prcb->PowerState.IdleFunction = PopIdle0Function;
/* Initialize DPC and Timer */