Initial kernel events support

This commit is contained in:
2023-03-17 16:46:18 +01:00
parent e0778d0a12
commit 934dba37a1
5 changed files with 117 additions and 0 deletions

View File

@@ -18,6 +18,7 @@ list(APPEND XTOSKRNL_SOURCE
${XTOSKRNL_SOURCE_DIR}/hl/${ARCH}/ioport.c
${XTOSKRNL_SOURCE_DIR}/ke/apc.c
${XTOSKRNL_SOURCE_DIR}/ke/dpc.c
${XTOSKRNL_SOURCE_DIR}/ke/event.c
${XTOSKRNL_SOURCE_DIR}/ke/globals.c
${XTOSKRNL_SOURCE_DIR}/ke/kprocess.c
${XTOSKRNL_SOURCE_DIR}/ke/krnlinit.c

85
xtoskrnl/ke/event.c Normal file
View File

@@ -0,0 +1,85 @@
/**
* PROJECT: ExectOS
* COPYRIGHT: See COPYING.md in the top level directory
* FILE: xtoskrnl/ke/event.c
* DESCRIPTION: Kernel events support
* DEVELOPERS: Rafal Kupiec <belliash@codingworkshop.eu.org>
*/
#include <xtos.h>
/**
* Clears the signal state of the event.
*
* @param Event
* Supplies a pointer to the event object.
*
* @return This routine does not return any value.
*
* @since NT 3.5
*/
XTAPI
VOID
KeClearEvent(IN PKEVENT Event)
{
/* Clear event's signal state */
Event->Header.SignalState = FALSE;
}
/**
* Initializes a kernel event.
*
* @param Event
* Supplies a pointer to the event object.
*
* @param EventType
* Specifies an event type.
*
* @param InitialState
* Specifies the initial signal state of the event.
*
* @return This routine does not return any value.
*
* @since NT 3.5
*/
XTAPI
VOID
KeInitializeEvent(OUT PKEVENT Event,
IN KEVENT_TYPE EventType,
IN BOOLEAN InitialState)
{
/* Initialize event dispatcher header */
Event->Header.Type = EventType;
Event->Header.SignalState = InitialState;
/* Initialize event wait list */
RtlInitializeListHead(&Event->Header.WaitListHead);
}
/**
* Sets new signal state and satisfy waits if possible.
*
* @param Event
* Supplies a pointer to the event object.
*
* @param Increment
* Specifies an event priority boost value.
*
* @param Wait
* Specifies whether to call kernel wait routines or not.
*
* @return This routine returns the previous signal state of the event.
*
* @since NT 3.5
*/
XTAPI
LONG
KeSetEvent(IN PKEVENT Event,
IN KPRIORITY Increment,
IN BOOLEAN Wait)
{
UNIMPLEMENTED;
return 0;
}