From a175b29095e2f5d33af9072fb2225c7ace289259 Mon Sep 17 00:00:00 2001 From: short <> Date: Tue, 25 Mar 2003 00:34:56 +0000 Subject: [PATCH] +libcaptive/halcaptive/queuedspinlock.c - +KeAcquireQueuedSpinLock() - +KeReleaseQueuedSpinLock() --- src/libcaptive/halcaptive/queuedspinlock.c | 79 ++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 src/libcaptive/halcaptive/queuedspinlock.c diff --git a/src/libcaptive/halcaptive/queuedspinlock.c b/src/libcaptive/halcaptive/queuedspinlock.c new file mode 100644 index 0000000..7168d5c --- /dev/null +++ b/src/libcaptive/halcaptive/queuedspinlock.c @@ -0,0 +1,79 @@ +/* $Id$ + * reactos queued spinlock emulation of libcaptive + * Copyright (C) 2003 Jan Kratochvil + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; exactly version 2 of June 1991 is required + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + + +#include "config.h" + +/* no reactos prototype for KeAcquireQueuedSpinLock() and KeReleaseQueuedSpinLock() */ +#include "reactos/ddk/types.h" /* for KIRQL */ +#include "reactos/ddk/kefuncs.h" /* for KeGetCurrentIrql() */ + + +typedef enum _KSPIN_LOCK_QUEUE_NUMBER { + LockQueueDispatcherLock, + LockQueueContextSwapLock, + LockQueuePfnLock, + LockQueueSystemSpaceLock, + LockQueueVacbLock, + LockQueueMasterLock, + LockQueueNonPagedPoolLock, + LockQueueIoCancelLock, + LockQueueWorkQueueLock, + LockQueueIoVpbLock, + LockQueueIoDatabaseLock, + LockQueueIoCompletionLock, + LockQueueNtfsStructLock, + LockQueueAfdWorkQueueLock, + LockQueueBcbLock, + LockQueueMaximumLock + } KSPIN_LOCK_QUEUE_NUMBER, *PKSPIN_LOCK_QUEUE_NUMBER; + + +/** + * KeAcquireQueuedSpinLock: + * @Number: Identification number of queued spinlock to acquire. + * + * Acquires a queued spinlock identified by @Number. + * Currently libcaptive doesn't use multithreading + * and thus this function is a NOP now. #GMutex would be needed otherwise. + * + * See http://www.compuware.co.jp/drivercentral/resources/spinlocks.asp + * + * Returns: IRQ level before this call. FIXME: What is expected in real? No W32 doc... + */ +KIRQL KeAcquireQueuedSpinLock(IN KSPIN_LOCK_QUEUE_NUMBER Number) +{ + /* TODO:thread */ + + return KeGetCurrentIrql(); +} + + +/** + * KeReleaseQueuedSpinLock: + * @Number: Identification number of queued spinlock to release. + * @OldIrql: Original IRQ level before KeAcquireQueuedSpinLock(). + * + * Releases a queued spinlock acquired by KeAcquireQueuedSpinLock(). + * Currently libcaptive doesn't use multithreading + * and thus this function is a NOP now. #GMutex would be needed otherwise. + */ +VOID KeReleaseQueuedSpinLock(IN KSPIN_LOCK_QUEUE_NUMBER Number,IN KIRQL OldIrql) +{ + /* TODO:thread */ +} -- 1.8.3.1