diff --git a/xtoskrnl/includes/po.h b/xtoskrnl/includes/po.h index 1505a64..2f9118e 100644 --- a/xtoskrnl/includes/po.h +++ b/xtoskrnl/includes/po.h @@ -21,4 +21,15 @@ XTFASTCALL VOID PopIdle0Function(IN PPROCESSOR_POWER_STATE PowerState); +XTAPI +VOID +PopPerfIdle(PPROCESSOR_POWER_STATE PowerState); + +XTAPI +VOID +PopPerfIdleDpc(IN PKDPC Dpc, + IN PVOID DeferredContext, + IN PVOID SystemArgument1, + IN PVOID SystemArgument2); + #endif /* __XTOSKRNL_PO_H */ diff --git a/xtoskrnl/po/idle.c b/xtoskrnl/po/idle.c index 4acc665..cb4d1b8 100644 --- a/xtoskrnl/po/idle.c +++ b/xtoskrnl/po/idle.c @@ -23,12 +23,17 @@ XTAPI VOID PoInitializeProcessorControlBlock(IN OUT PKPROCESSOR_CONTROL_BLOCK Prcb) { + /* Zero memory */ RtlZeroMemory(&Prcb->PowerState, sizeof(Prcb->PowerState)); + /* Initialize default power state */ Prcb->PowerState.Idle0TimeLimit = 0xFFFFFFFF; Prcb->PowerState.CurrentThrottle = 100; Prcb->PowerState.IdleFunction = PopIdle0Function; + /* Initialize DPC and Timer */ + KeInitializeDpc(&Prcb->PowerState.PerfDpc, PopPerfIdleDpc, Prcb); + KeSetTargetProcessorDpc(&Prcb->PowerState.PerfDpc, Prcb->Number); KeInitializeTimerEx(&Prcb->PowerState.PerfTimer, SynchronizationTimer); } @@ -48,3 +53,49 @@ PopIdle0Function(IN PPROCESSOR_POWER_STATE PowerState) { UNIMPLEMENTED; } + +/** + * Switches CPU between different performance levels. + * + * @param PowerState + * Supplies a pointer to the structure containing IDLE processor power state. + * + * @return This routine does not return any value. + * + * @since NT 5.1 + */ +XTAPI +VOID +PopPerfIdle(PPROCESSOR_POWER_STATE PowerState) +{ + UNIMPLEMENTED; +} + +/** + * Checks if CPU is running at the maximum (performance) frequency. + * + * @param Dpc + * Supplies a pointer to the DPC object. + * + * @param DeferredContext + * Supplies a pointer to memory area containing current CPU's PRCB. + * + * @param SystemArgument1 + * Supplies a pointer to an unused system argument. + * + * @param SystemArgument2 + * Supplies a pointer to an unused system argument. + * + * @return This routine does not return any value. + * + * @since NT 5.1 + */ +XTAPI +VOID +PopPerfIdleDpc(IN PKDPC Dpc, + IN PVOID DeferredContext, + IN PVOID SystemArgument1, + IN PVOID SystemArgument2) +{ + UNIMPLEMENTED; +}