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}/init.c
|
||||||
${XTOSKRNL_SOURCE_DIR}/mm/${ARCH}/pages.c
|
${XTOSKRNL_SOURCE_DIR}/mm/${ARCH}/pages.c
|
||||||
${XTOSKRNL_SOURCE_DIR}/mm/${ARCH}/pmap.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}/dispatch.cc
|
||||||
${XTOSKRNL_SOURCE_DIR}/rtl/${ARCH}/exsup.cc
|
${XTOSKRNL_SOURCE_DIR}/rtl/${ARCH}/exsup.cc
|
||||||
${XTOSKRNL_SOURCE_DIR}/rtl/atomic.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 <ex.hh>
|
||||||
#include <hl.hh>
|
#include <hl.hh>
|
||||||
#include <ke.hh>
|
#include <ke.hh>
|
||||||
|
#include <po.hh>
|
||||||
#include <rtl.hh>
|
#include <rtl.hh>
|
||||||
|
@@ -85,7 +85,7 @@ KernelInit::StartKernel(VOID)
|
|||||||
CurrentProcess = CurrentThread->ApcState.Process;
|
CurrentProcess = CurrentThread->ApcState.Process;
|
||||||
|
|
||||||
/* Initialize CPU power state structures */
|
/* Initialize CPU power state structures */
|
||||||
PoInitializeProcessorControlBlock(Prcb);
|
PO::Idle::InitializeProcessorIdleState(Prcb);
|
||||||
|
|
||||||
/* Save processor state */
|
/* Save processor state */
|
||||||
Processor::SaveProcessorState(&Prcb->ProcessorState);
|
Processor::SaveProcessorState(&Prcb->ProcessorState);
|
||||||
|
@@ -85,7 +85,7 @@ KernelInit::StartKernel(VOID)
|
|||||||
CurrentProcess = CurrentThread->ApcState.Process;
|
CurrentProcess = CurrentThread->ApcState.Process;
|
||||||
|
|
||||||
/* Initialize CPU power state structures */
|
/* Initialize CPU power state structures */
|
||||||
PoInitializeProcessorControlBlock(Prcb);
|
PO::Idle::InitializeProcessorIdleState(Prcb);
|
||||||
|
|
||||||
/* Save processor state */
|
/* Save processor state */
|
||||||
Processor::SaveProcessorState(&Prcb->ProcessorState);
|
Processor::SaveProcessorState(&Prcb->ProcessorState);
|
||||||
|
@@ -1,12 +1,12 @@
|
|||||||
/**
|
/**
|
||||||
* PROJECT: ExectOS
|
* PROJECT: ExectOS
|
||||||
* COPYRIGHT: See COPYING.md in the top level directory
|
* COPYRIGHT: See COPYING.md in the top level directory
|
||||||
* FILE: xtoskrnl/po/idle.c
|
* FILE: xtoskrnl/po/idle.cc
|
||||||
* DESCRIPTION: Processor idle functionality support
|
* DESCRIPTION: Processor idle functionality support
|
||||||
* DEVELOPERS: Rafal Kupiec <belliash@codingworkshop.eu.org>
|
* DEVELOPERS: Rafal Kupiec <belliash@codingworkshop.eu.org>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <xtos.h>
|
#include <xtos.hh>
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -21,7 +21,7 @@
|
|||||||
*/
|
*/
|
||||||
XTAPI
|
XTAPI
|
||||||
VOID
|
VOID
|
||||||
PoInitializeProcessorControlBlock(IN OUT PKPROCESSOR_CONTROL_BLOCK Prcb)
|
PO::Idle::InitializeProcessorIdleState(IN OUT PKPROCESSOR_CONTROL_BLOCK Prcb)
|
||||||
{
|
{
|
||||||
/* Zero memory */
|
/* Zero memory */
|
||||||
RtlZeroMemory(&Prcb->PowerState, sizeof(Prcb->PowerState));
|
RtlZeroMemory(&Prcb->PowerState, sizeof(Prcb->PowerState));
|
||||||
@@ -30,10 +30,10 @@ PoInitializeProcessorControlBlock(IN OUT PKPROCESSOR_CONTROL_BLOCK Prcb)
|
|||||||
Prcb->PowerState.Idle0TimeLimit = 0xFFFFFFFF;
|
Prcb->PowerState.Idle0TimeLimit = 0xFFFFFFFF;
|
||||||
Prcb->PowerState.CurrentThrottle = 100;
|
Prcb->PowerState.CurrentThrottle = 100;
|
||||||
Prcb->PowerState.CurrentThrottleIndex = 0;
|
Prcb->PowerState.CurrentThrottleIndex = 0;
|
||||||
Prcb->PowerState.IdleFunction = PopIdle0Function;
|
Prcb->PowerState.IdleFunction = Idle0Function;
|
||||||
|
|
||||||
/* Initialize DPC and Timer */
|
/* Initialize DPC and Timer */
|
||||||
KeInitializeDpc(&Prcb->PowerState.PerfDpc, PopPerfIdleDpc, Prcb);
|
KeInitializeDpc(&Prcb->PowerState.PerfDpc, PerfIdleDpc, Prcb);
|
||||||
KeSetTargetProcessorDpc(&Prcb->PowerState.PerfDpc, Prcb->CpuNumber);
|
KeSetTargetProcessorDpc(&Prcb->PowerState.PerfDpc, Prcb->CpuNumber);
|
||||||
KeInitializeTimer(&Prcb->PowerState.PerfTimer, SynchronizationTimer);
|
KeInitializeTimer(&Prcb->PowerState.PerfTimer, SynchronizationTimer);
|
||||||
}
|
}
|
||||||
@@ -50,7 +50,7 @@ PoInitializeProcessorControlBlock(IN OUT PKPROCESSOR_CONTROL_BLOCK Prcb)
|
|||||||
*/
|
*/
|
||||||
XTFASTCALL
|
XTFASTCALL
|
||||||
VOID
|
VOID
|
||||||
PopIdle0Function(IN PPROCESSOR_POWER_STATE PowerState)
|
PO::Idle::Idle0Function(IN PPROCESSOR_POWER_STATE PowerState)
|
||||||
{
|
{
|
||||||
UNIMPLEMENTED;
|
UNIMPLEMENTED;
|
||||||
}
|
}
|
||||||
@@ -67,7 +67,7 @@ PopIdle0Function(IN PPROCESSOR_POWER_STATE PowerState)
|
|||||||
*/
|
*/
|
||||||
XTAPI
|
XTAPI
|
||||||
VOID
|
VOID
|
||||||
PopPerfIdle(PPROCESSOR_POWER_STATE PowerState)
|
PO::Idle::PerfIdle(PPROCESSOR_POWER_STATE PowerState)
|
||||||
{
|
{
|
||||||
UNIMPLEMENTED;
|
UNIMPLEMENTED;
|
||||||
}
|
}
|
||||||
@@ -93,10 +93,10 @@ PopPerfIdle(PPROCESSOR_POWER_STATE PowerState)
|
|||||||
*/
|
*/
|
||||||
XTAPI
|
XTAPI
|
||||||
VOID
|
VOID
|
||||||
PopPerfIdleDpc(IN PKDPC Dpc,
|
PO::Idle::PerfIdleDpc(IN PKDPC Dpc,
|
||||||
IN PVOID DeferredContext,
|
IN PVOID DeferredContext,
|
||||||
IN PVOID SystemArgument1,
|
IN PVOID SystemArgument1,
|
||||||
IN PVOID SystemArgument2)
|
IN PVOID SystemArgument2)
|
||||||
{
|
{
|
||||||
UNIMPLEMENTED;
|
UNIMPLEMENTED;
|
||||||
}
|
}
|
Reference in New Issue
Block a user