Initial semaphores support
All checks were successful
ci/woodpecker/push/build Pipeline was successful
All checks were successful
ci/woodpecker/push/build Pipeline was successful
This commit is contained in:
parent
525cc116ee
commit
ccaa28399a
@ -16,6 +16,12 @@
|
||||
|
||||
|
||||
/* Kernel services routines forward references */
|
||||
XTAPI
|
||||
VOID
|
||||
KeInitializeSemaphore(IN PKSEMAPHORE Semaphore,
|
||||
IN LONG Count,
|
||||
IN LONG Limit);
|
||||
|
||||
XTAPI
|
||||
VOID
|
||||
KeInitializeSpinLock(IN PKSPIN_LOCK SpinLock);
|
||||
|
@ -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/semphore.c
|
||||
${XTOSKRNL_SOURCE_DIR}/ke/spinlock.c
|
||||
${XTOSKRNL_SOURCE_DIR}/ke/timer.c
|
||||
${XTOSKRNL_SOURCE_DIR}/ke/${ARCH}/krnlinit.c
|
||||
|
41
xtoskrnl/ke/semphore.c
Normal file
41
xtoskrnl/ke/semphore.c
Normal file
@ -0,0 +1,41 @@
|
||||
/**
|
||||
* PROJECT: ExectOS
|
||||
* COPYRIGHT: See COPYING.md in the top level directory
|
||||
* FILE: xtoskrnl/ke/semphore.c
|
||||
* DESCRIPTION: Semaphores support
|
||||
* DEVELOPERS: Rafal Kupiec <belliash@codingworkshop.eu.org>
|
||||
*/
|
||||
|
||||
#include <xtos.h>
|
||||
|
||||
|
||||
/**
|
||||
* initializes a kernel semaphore object.
|
||||
*
|
||||
* @param Semaphore
|
||||
* Supplies a pointer to a semaphore object.
|
||||
*
|
||||
* @param Count
|
||||
* Specifies the initial count value of the semaphore.
|
||||
*
|
||||
* @param Limit
|
||||
* Specifies a maximum count value of the semaphore.
|
||||
*
|
||||
* @return This routine does not return any value.
|
||||
*
|
||||
* @since NT 3.5
|
||||
*/
|
||||
XTAPI
|
||||
VOID
|
||||
KeInitializeSemaphore(IN PKSEMAPHORE Semaphore,
|
||||
IN LONG Count,
|
||||
IN LONG Limit)
|
||||
{
|
||||
/* Initialize semaphore header and limit */
|
||||
Semaphore->Header.Type = SemaphoreObject;
|
||||
Semaphore->Header.SignalState = Count;
|
||||
Semaphore->Limit = Limit;
|
||||
|
||||
/* Initialize semaphore wait list */
|
||||
RtlInitializeListHead(&Semaphore->Header.WaitListHead);
|
||||
}
|
Loading…
Reference in New Issue
Block a user