Migrate PO subsystem to C++
This commit is contained in:
@@ -60,7 +60,7 @@ list(APPEND XTOSKRNL_SOURCE
|
||||
${XTOSKRNL_SOURCE_DIR}/mm/${ARCH}/init.c
|
||||
${XTOSKRNL_SOURCE_DIR}/mm/${ARCH}/pages.c
|
||||
${XTOSKRNL_SOURCE_DIR}/mm/${ARCH}/pmap.c
|
||||
${XTOSKRNL_SOURCE_DIR}/po/idle.c
|
||||
${XTOSKRNL_SOURCE_DIR}/po/idle.cc
|
||||
${XTOSKRNL_SOURCE_DIR}/rtl/${ARCH}/dispatch.cc
|
||||
${XTOSKRNL_SOURCE_DIR}/rtl/${ARCH}/exsup.cc
|
||||
${XTOSKRNL_SOURCE_DIR}/rtl/atomic.cc
|
||||
|
17
xtoskrnl/includes/po.hh
Normal file
17
xtoskrnl/includes/po.hh
Normal file
@@ -0,0 +1,17 @@
|
||||
/**
|
||||
* PROJECT: ExectOS
|
||||
* COPYRIGHT: See COPYING.md in the top level directory
|
||||
* FILE: xtoskrnl/includes/po.hh
|
||||
* DESCRIPTION: Power Management
|
||||
* DEVELOPERS: Aiken Harris <harraiken91@gmail.com>
|
||||
*/
|
||||
|
||||
#ifndef __XTOSKRNL_PO_HH
|
||||
#define __XTOSKRNL_PO_HH
|
||||
|
||||
#include <xtos.hh>
|
||||
|
||||
#include <po/idle.hh>
|
||||
|
||||
|
||||
#endif /* __XTOSKRNL_PO_HH */
|
33
xtoskrnl/includes/po/idle.hh
Normal file
33
xtoskrnl/includes/po/idle.hh
Normal file
@@ -0,0 +1,33 @@
|
||||
/**
|
||||
* PROJECT: ExectOS
|
||||
* COPYRIGHT: See COPYING.md in the top level directory
|
||||
* FILE: xtoskrnl/includes/po/idle.hh
|
||||
* DESCRIPTION: Processor idle functionality support
|
||||
* DEVELOPERS: Aiken Harris <harraiken91@gmail.com>
|
||||
*/
|
||||
|
||||
#ifndef __XTOSKRNL_PO_IDLE_HH
|
||||
#define __XTOSKRNL_PO_IDLE_HH
|
||||
|
||||
#include <xtos.hh>
|
||||
|
||||
|
||||
/* Runtime Library */
|
||||
namespace PO
|
||||
{
|
||||
class Idle
|
||||
{
|
||||
public:
|
||||
STATIC XTAPI VOID InitializeProcessorIdleState(IN OUT PKPROCESSOR_CONTROL_BLOCK Prcb);
|
||||
|
||||
private:
|
||||
STATIC XTFASTCALL VOID Idle0Function(IN PPROCESSOR_POWER_STATE PowerState);
|
||||
STATIC XTAPI VOID PerfIdle(IN PPROCESSOR_POWER_STATE PowerState);
|
||||
STATIC XTAPI VOID PerfIdleDpc(IN PKDPC Dpc,
|
||||
IN PVOID DeferredContext,
|
||||
IN PVOID SystemArgument1,
|
||||
IN PVOID SystemArgument2);
|
||||
};
|
||||
}
|
||||
|
||||
#endif /* __XTOSKRNL_PO_IDLE_HH */
|
@@ -30,4 +30,5 @@ extern "C" {
|
||||
#include <ex.hh>
|
||||
#include <hl.hh>
|
||||
#include <ke.hh>
|
||||
#include <po.hh>
|
||||
#include <rtl.hh>
|
||||
|
@@ -85,7 +85,7 @@ KernelInit::StartKernel(VOID)
|
||||
CurrentProcess = CurrentThread->ApcState.Process;
|
||||
|
||||
/* Initialize CPU power state structures */
|
||||
PoInitializeProcessorControlBlock(Prcb);
|
||||
PO::Idle::InitializeProcessorIdleState(Prcb);
|
||||
|
||||
/* Save processor state */
|
||||
Processor::SaveProcessorState(&Prcb->ProcessorState);
|
||||
|
@@ -85,7 +85,7 @@ KernelInit::StartKernel(VOID)
|
||||
CurrentProcess = CurrentThread->ApcState.Process;
|
||||
|
||||
/* Initialize CPU power state structures */
|
||||
PoInitializeProcessorControlBlock(Prcb);
|
||||
PO::Idle::InitializeProcessorIdleState(Prcb);
|
||||
|
||||
/* Save processor state */
|
||||
Processor::SaveProcessorState(&Prcb->ProcessorState);
|
||||
|
@@ -1,12 +1,12 @@
|
||||
/**
|
||||
* PROJECT: ExectOS
|
||||
* COPYRIGHT: See COPYING.md in the top level directory
|
||||
* FILE: xtoskrnl/po/idle.c
|
||||
* FILE: xtoskrnl/po/idle.cc
|
||||
* DESCRIPTION: Processor idle functionality support
|
||||
* DEVELOPERS: Rafal Kupiec <belliash@codingworkshop.eu.org>
|
||||
*/
|
||||
|
||||
#include <xtos.h>
|
||||
#include <xtos.hh>
|
||||
|
||||
|
||||
/**
|
||||
@@ -21,7 +21,7 @@
|
||||
*/
|
||||
XTAPI
|
||||
VOID
|
||||
PoInitializeProcessorControlBlock(IN OUT PKPROCESSOR_CONTROL_BLOCK Prcb)
|
||||
PO::Idle::InitializeProcessorIdleState(IN OUT PKPROCESSOR_CONTROL_BLOCK Prcb)
|
||||
{
|
||||
/* Zero memory */
|
||||
RtlZeroMemory(&Prcb->PowerState, sizeof(Prcb->PowerState));
|
||||
@@ -30,10 +30,10 @@ PoInitializeProcessorControlBlock(IN OUT PKPROCESSOR_CONTROL_BLOCK Prcb)
|
||||
Prcb->PowerState.Idle0TimeLimit = 0xFFFFFFFF;
|
||||
Prcb->PowerState.CurrentThrottle = 100;
|
||||
Prcb->PowerState.CurrentThrottleIndex = 0;
|
||||
Prcb->PowerState.IdleFunction = PopIdle0Function;
|
||||
Prcb->PowerState.IdleFunction = Idle0Function;
|
||||
|
||||
/* Initialize DPC and Timer */
|
||||
KeInitializeDpc(&Prcb->PowerState.PerfDpc, PopPerfIdleDpc, Prcb);
|
||||
KeInitializeDpc(&Prcb->PowerState.PerfDpc, PerfIdleDpc, Prcb);
|
||||
KeSetTargetProcessorDpc(&Prcb->PowerState.PerfDpc, Prcb->CpuNumber);
|
||||
KeInitializeTimer(&Prcb->PowerState.PerfTimer, SynchronizationTimer);
|
||||
}
|
||||
@@ -50,7 +50,7 @@ PoInitializeProcessorControlBlock(IN OUT PKPROCESSOR_CONTROL_BLOCK Prcb)
|
||||
*/
|
||||
XTFASTCALL
|
||||
VOID
|
||||
PopIdle0Function(IN PPROCESSOR_POWER_STATE PowerState)
|
||||
PO::Idle::Idle0Function(IN PPROCESSOR_POWER_STATE PowerState)
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
}
|
||||
@@ -67,7 +67,7 @@ PopIdle0Function(IN PPROCESSOR_POWER_STATE PowerState)
|
||||
*/
|
||||
XTAPI
|
||||
VOID
|
||||
PopPerfIdle(PPROCESSOR_POWER_STATE PowerState)
|
||||
PO::Idle::PerfIdle(PPROCESSOR_POWER_STATE PowerState)
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
}
|
||||
@@ -93,10 +93,10 @@ PopPerfIdle(PPROCESSOR_POWER_STATE PowerState)
|
||||
*/
|
||||
XTAPI
|
||||
VOID
|
||||
PopPerfIdleDpc(IN PKDPC Dpc,
|
||||
IN PVOID DeferredContext,
|
||||
IN PVOID SystemArgument1,
|
||||
IN PVOID SystemArgument2)
|
||||
PO::Idle::PerfIdleDpc(IN PKDPC Dpc,
|
||||
IN PVOID DeferredContext,
|
||||
IN PVOID SystemArgument1,
|
||||
IN PVOID SystemArgument2)
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
}
|
Reference in New Issue
Block a user