Implement kernel timer initialization routines
All checks were successful
ci/woodpecker/push/build Pipeline was successful

This commit is contained in:
Rafal Kupiec 2023-02-16 17:56:35 +01:00
parent 91e4176e45
commit b2456fd18a
Signed by: belliash
GPG Key ID: 4E829243E0CFE6B4
3 changed files with 71 additions and 0 deletions

View File

@ -12,9 +12,19 @@
#include <xtdefs.h>
#include <xtstruct.h>
#include <xttypes.h>
#include <ketypes.h>
/* Kernel services routines forward references */
XTAPI
VOID
KeInitializeTimer(OUT PKTIMER Timer);
XTAPI
VOID
KeInitializeTimerEx(OUT PKTIMER Timer,
IN KTIMER_TYPE Type);
XTAPI
VOID
KeStartXtSystem(IN PKERNEL_INITIALIZATION_BLOCK Parameters);

View File

@ -18,6 +18,7 @@ list(APPEND XTOSKRNL_SOURCE
${XTOSKRNL_SOURCE_DIR}/hl/${ARCH}/ioport.c
${XTOSKRNL_SOURCE_DIR}/ke/globals.c
${XTOSKRNL_SOURCE_DIR}/ke/krnlinit.c
${XTOSKRNL_SOURCE_DIR}/ke/timer.c
${XTOSKRNL_SOURCE_DIR}/ke/${ARCH}/krnlinit.c
${XTOSKRNL_SOURCE_DIR}/ke/${ARCH}/proc.c
${XTOSKRNL_SOURCE_DIR}/mm/kpools.c

60
xtoskrnl/ke/timer.c Normal file
View File

@ -0,0 +1,60 @@
/**
* PROJECT: ExectOS
* COPYRIGHT: See COPYING.md in the top level directory
* FILE: xtoskrnl/ke/timer.c
* DESCRIPTION: Kernel timer object support
* DEVELOPERS: Rafal Kupiec <belliash@codingworkshop.eu.org>
*/
#include <xtos.h>
/**
* Initializes a kernel timer.
*
* @param Timer
* Supplies a pointer to a time object.
*
* @return This routine does not return any value.
*
* @since NT 3.5
*/
XTAPI
VOID
KeInitializeTimer(OUT PKTIMER Timer)
{
/* Initialize the timer */
KeInitializeTimerEx(Timer, NotificationTimer);
}
/**
* Initializes an extended kernel timer.
*
* @param Timer
* Supplies a pointer to a timer object.
*
* @param Type
* Supplies the type of the timer.
*
* @return This routine does not return any value.
*
* @since NT 3.5
*/
XTAPI
VOID
KeInitializeTimerEx(OUT PKTIMER Timer,
IN KTIMER_TYPE Type)
{
/* Initialize the header */
Timer->Header.Type = TimerNotificationObject + Type;
Timer->Header.Inserted = 0;
Timer->Header.SignalState = 0;
/* Initialize the timer data */
Timer->DueTime.QuadPart = 0;
Timer->Period = 0;
/* Initialize linked lists */
RtlInitializeListHead(&Timer->Header.WaitListHead);
RtlInitializeListHead(&Timer->TimerListEntry);
}