Finish PoInitializeProcessorControlBlock() routine implementation
Some checks failed
Builds / ExectOS (amd64) (push) Successful in 27s
Builds / ExectOS (i686) (push) Failing after 17s

This commit is contained in:
Rafal Kupiec 2023-10-29 20:14:10 +01:00
parent aa17be6eb3
commit 783a4a2aa0
Signed by: belliash
GPG Key ID: 4E829243E0CFE6B4
2 changed files with 62 additions and 0 deletions

View File

@ -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 */

View File

@ -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;
}