2 * reactos queued spinlock emulation of libcaptive
3 * Copyright (C) 2003 Jan Kratochvil <project-captive@jankratochvil.net>
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; exactly version 2 of June 1991 is required
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 /* no reactos prototype for KeAcquireQueuedSpinLock() and KeReleaseQueuedSpinLock() */
23 #include "reactos/ddk/types.h" /* for KIRQL */
24 #include "reactos/ddk/kefuncs.h" /* for KeGetCurrentIrql() */
27 typedef enum _KSPIN_LOCK_QUEUE_NUMBER {
28 LockQueueDispatcherLock,
29 LockQueueContextSwapLock,
31 LockQueueSystemSpaceLock,
34 LockQueueNonPagedPoolLock,
35 LockQueueIoCancelLock,
36 LockQueueWorkQueueLock,
38 LockQueueIoDatabaseLock,
39 LockQueueIoCompletionLock,
40 LockQueueNtfsStructLock,
41 LockQueueAfdWorkQueueLock,
44 } KSPIN_LOCK_QUEUE_NUMBER, *PKSPIN_LOCK_QUEUE_NUMBER;
48 * KeAcquireQueuedSpinLock:
49 * @Number: Identification number of queued spinlock to acquire.
51 * Acquires a queued spinlock identified by @Number.
52 * Currently libcaptive doesn't use multithreading
53 * and thus this function is a NOP now. #GMutex would be needed otherwise.
55 * See http://www.compuware.co.jp/drivercentral/resources/spinlocks.asp
57 * Returns: IRQ level before this call. FIXME: What is expected in real? No W32 doc...
59 KIRQL KeAcquireQueuedSpinLock(IN KSPIN_LOCK_QUEUE_NUMBER Number)
63 return KeGetCurrentIrql();
68 * KeReleaseQueuedSpinLock:
69 * @Number: Identification number of queued spinlock to release.
70 * @OldIrql: Original IRQ level before KeAcquireQueuedSpinLock().
72 * Releases a queued spinlock acquired by KeAcquireQueuedSpinLock().
73 * Currently libcaptive doesn't use multithreading
74 * and thus this function is a NOP now. #GMutex would be needed otherwise.
76 VOID KeReleaseQueuedSpinLock(IN KSPIN_LOCK_QUEUE_NUMBER Number,IN KIRQL OldIrql)