Initial support processor idle functionality
All checks were successful
ci/woodpecker/push/build Pipeline was successful

This commit is contained in:
Rafal Kupiec 2023-03-02 16:25:41 +01:00
parent 870a6680b0
commit e81fb68357
Signed by: belliash
GPG Key ID: 4E829243E0CFE6B4
5 changed files with 76 additions and 1 deletions

View File

@ -29,6 +29,7 @@ list(APPEND XTOSKRNL_SOURCE
${XTOSKRNL_SOURCE_DIR}/ke/${ARCH}/proc.c
${XTOSKRNL_SOURCE_DIR}/mm/kpools.c
${XTOSKRNL_SOURCE_DIR}/mm/${ARCH}/pages.c
${XTOSKRNL_SOURCE_DIR}/po/idle.c
${XTOSKRNL_SOURCE_DIR}/rtl/atomic.c
${XTOSKRNL_SOURCE_DIR}/rtl/byteswap.c
${XTOSKRNL_SOURCE_DIR}/rtl/memory.c

View File

@ -10,7 +10,6 @@
#define __XTOSKRNL_GLOBALS_H
#include <xtos.h>
#include ARCH_HEADER(globals.h)
/* FrameBuffer information */

View File

@ -0,0 +1,23 @@
/**
* PROJECT: ExectOS
* COPYRIGHT: See COPYING.md in the top level directory
* FILE: xtoskrnl/includes/popfuncs.h
* DESCRIPTION: Private routine definitions for kernel power manager
* DEVELOPERS: Rafal Kupiec <belliash@codingworkshop.eu.org>
*/
#ifndef __XTOSKRNL_POPFUNCS_H
#define __XTOSKRNL_POPFUNCS_H
#include <xtos.h>
XTAPI
VOID
PoInitializeProcessorControlBlock(IN OUT PKPROCESSOR_CONTROL_BLOCK Prcb);
XTFASTCALL
VOID
PopIdle0Function(IN PPROCESSOR_POWER_STATE PowerState);
#endif /* __XTOSKRNL_POPFUNCS_H */

View File

@ -13,6 +13,8 @@
#include "globals.h"
#include "arpfuncs.h"
#include "kepfuncs.h"
#include "popfuncs.h"
#include ARCH_HEADER(globals.h)
#include ARCH_HEADER(arpfuncs.h)
#include ARCH_HEADER(kepfuncs.h)

50
xtoskrnl/po/idle.c Normal file
View File

@ -0,0 +1,50 @@
/**
* PROJECT: ExectOS
* COPYRIGHT: See COPYING.md in the top level directory
* FILE: xtoskrnl/po/idle.c
* DESCRIPTION: Processor idle functionality support
* DEVELOPERS: Rafal Kupiec <belliash@codingworkshop.eu.org>
*/
#include <xtos.h>
/**
* Initializes Processor Control Block's (PRCB) power state structures.
*
* @param Prcb
* Supplies a pointer to the PRCB being initialized.
*
* @return This routine does not return any value.
*
* @since XT 1.0
*/
XTAPI
VOID
PoInitializeProcessorControlBlock(IN OUT PKPROCESSOR_CONTROL_BLOCK Prcb)
{
RtlZeroMemory(&Prcb->PowerState, sizeof(Prcb->PowerState));
Prcb->PowerState.Idle0TimeLimit = 0xFFFFFFFF;
Prcb->PowerState.CurrentThrottle = 100;
Prcb->PowerState.IdleFunction = PopIdle0Function;
KeInitializeTimerEx(&Prcb->PowerState.PerfTimer, SynchronizationTimer);
}
/**
* Processor idle loop routine.
*
* @param PowerState
* Supplies a pointer to the structere containing current processor power state.
*
* @return This routine does not return any value.
*
* @since XT 1.0
*/
XTFASTCALL
VOID
PopIdle0Function(IN PPROCESSOR_POWER_STATE PowerState)
{
UNIMPLEMENTED;
}