Author: tkreuzer
Date: Fri Aug 29 20:01:53 2008
New Revision: 35780
URL:
http://svn.reactos.org/svn/reactos?rev=35780&view=rev
Log:
- Move KeAcquireSpinlockRaiseToSynch from ndk to ntifs.h
- Add KeTryToAcquireQueuedSpinLock to ntifs.h
- Fix Spinlock function prototypes in winddk.h
Modified:
branches/ros-amd64-bringup/reactos/include/ddk/ntifs.h
branches/ros-amd64-bringup/reactos/include/ddk/winddk.h
branches/ros-amd64-bringup/reactos/include/ndk/kefuncs.h
Modified: branches/ros-amd64-bringup/reactos/include/ddk/ntifs.h
URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/inclu…
==============================================================================
--- branches/ros-amd64-bringup/reactos/include/ddk/ntifs.h [iso-8859-1] (original)
+++ branches/ros-amd64-bringup/reactos/include/ddk/ntifs.h [iso-8859-1] Fri Aug 29
20:01:53 2008
@@ -3631,28 +3631,67 @@
IN BOOLEAN AllowRawMount
);
-#ifdef _M_AMD64
-NTKERNELAPI
-#else
+#if !defined (_M_AMD64)
+
NTHALAPI
-#endif
KIRQL
FASTCALL
KeAcquireQueuedSpinLock (
IN KSPIN_LOCK_QUEUE_NUMBER Number
);
-#ifdef _M_AMD64
-NTKERNELAPI
-#else
NTHALAPI
-#endif
VOID
FASTCALL
KeReleaseQueuedSpinLock (
IN KSPIN_LOCK_QUEUE_NUMBER Number,
IN KIRQL OldIrql
);
+
+NTHALAPI
+KIRQL
+FASTCALL
+KeAcquireSpinLockRaiseToSynch(
+ IN OUT PKSPIN_LOCK SpinLock
+);
+
+NTHALAPI
+LOGICAL
+FASTCALL
+KeTryToAcquireQueuedSpinLock(
+ KSPIN_LOCK_QUEUE_NUMBER Number,
+ PKIRQL OldIrql);
+
+#else
+
+NTKERNELAPI
+KIRQL
+FASTCALL
+KeAcquireQueuedSpinLock (
+ IN KSPIN_LOCK_QUEUE_NUMBER Number
+);
+
+NTKERNELAPI
+VOID
+FASTCALL
+KeReleaseQueuedSpinLock (
+ IN KSPIN_LOCK_QUEUE_NUMBER Number,
+ IN KIRQL OldIrql
+);
+
+NTKERNELAPI
+KIRQL
+KeAcquireSpinLockRaiseToSynch(
+ IN OUT PKSPIN_LOCK SpinLock
+);
+
+NTKERNELAPI
+LOGICAL
+KeTryToAcquireQueuedSpinLock(
+ KSPIN_LOCK_QUEUE_NUMBER Number,
+ PKIRQL OldIrql);
+
+#endif
NTKERNELAPI
VOID
Modified: branches/ros-amd64-bringup/reactos/include/ddk/winddk.h
URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/inclu…
==============================================================================
--- branches/ros-amd64-bringup/reactos/include/ddk/winddk.h [iso-8859-1] (original)
+++ branches/ros-amd64-bringup/reactos/include/ddk/winddk.h [iso-8859-1] Fri Aug 29
20:01:53 2008
@@ -5786,6 +5786,7 @@
} PCIBUSDATA, *PPCIBUSDATA;
+/** INTERLOCKED FUNCTIONS *****************************************************/
#if !defined(__INTERLOCKED_DECLARED)
#define __INTERLOCKED_DECLARED
@@ -5902,38 +5903,30 @@
#define InterlockedPushEntrySList(Head, Entry) ExpInterlockedPushEntrySList(Head, Entry)
#define InterlockedFlushSList(Head) ExpInterlockedFlushSList(Head)
#define QueryDepthSList(Head) ExQueryDepthSList(Head)
-#endif // !defined(_WINBASE_
+#endif // !defined(_WINBASE_)
#endif // _M_AMD64
#endif /* !__INTERLOCKED_DECLARED */
-NTKERNELAPI
-VOID
+
+/** SPINLOCK FUNCTIONS ********************************************************/
+
+NTKERNELAPI
+BOOLEAN
FASTCALL
-KefAcquireSpinLockAtDpcLevel(
+KeTryToAcquireSpinLockAtDpcLevel(
+ IN OUT PKSPIN_LOCK SpinLock
+);
+
+#if defined (_X86_)
+
+NTKERNELAPI
+VOID
+NTAPI
+KeInitializeSpinLock(
IN PKSPIN_LOCK SpinLock);
-NTKERNELAPI
-VOID
-FASTCALL
-KefReleaseSpinLockFromDpcLevel(
- IN PKSPIN_LOCK SpinLock);
-
-#if defined(_M_AMD64)
-NTKERNELAPI
-KIRQL
-FASTCALL
-KfAcquireSpinLock(
- IN PKSPIN_LOCK SpinLock);
-
-NTKERNELAPI
-VOID
-FASTCALL
-KfReleaseSpinLock(
- IN PKSPIN_LOCK SpinLock,
- IN KIRQL NewIrql);
-#else
NTHALAPI
KIRQL
FASTCALL
@@ -5946,19 +5939,60 @@
KfReleaseSpinLock(
IN PKSPIN_LOCK SpinLock,
IN KIRQL NewIrql);
-#endif
-
-NTKERNELAPI
-BOOLEAN
+
+NTKERNELAPI
+VOID
FASTCALL
-KeTryToAcquireSpinLockAtDpcLevel(
- IN OUT PKSPIN_LOCK SpinLock
-);
+KefAcquireSpinLockAtDpcLevel(
+ IN PKSPIN_LOCK SpinLock);
+
+NTKERNELAPI
+VOID
+FASTCALL
+KefReleaseSpinLockFromDpcLevel(
+ IN PKSPIN_LOCK SpinLock);
#define KeAcquireSpinLockAtDpcLevel(SpinLock) KefAcquireSpinLockAtDpcLevel(SpinLock)
#define KeReleaseSpinLockFromDpcLevel(SpinLock) KefReleaseSpinLockFromDpcLevel(SpinLock)
#define KeAcquireSpinLock(a,b) *(b) = KfAcquireSpinLock(a)
#define KeReleaseSpinLock(a,b) KfReleaseSpinLock(a,b)
+
+#else // !defined (_X86_)
+
+FORCEINLINE
+VOID
+NTAPI
+KeInitializeSpinLock(
+ PKSPIN_LOCK SpinLock)
+{
+ *SpinLock = 0;
+}
+
+NTKERNELAPI
+VOID
+KeReleaseSpinLock(
+ IN PKSPIN_LOCK SpinLock,
+ IN KIRQL NewIrql);
+
+NTKERNELAPI
+VOID
+KeAcquireSpinLockAtDpcLevel(
+ IN PKSPIN_LOCK SpinLock);
+
+NTKERNELAPI
+VOID
+KeReleaseSpinLockFromDpcLevel(
+ IN PKSPIN_LOCK SpinLock);
+
+NTKERNELAPI
+KIRQL
+KeAcquireSpinLockRaiseToDpc(
+ IN PKSPIN_LOCK SpinLock);
+
+#define KeAcquireSpinLock(SpinLock, OldIrql) \
+ *(OldIrql) = KeAcquireSpinLockRaiseToDpc(SpinLock)
+
+#endif // !defined (_X86_)
#define RtlCopyMemoryNonTemporal RtlCopyMemory
@@ -6358,23 +6392,60 @@
return Result;
}
+static __inline
+LARGE_INTEGER
+NTAPI_INLINE
+RtlConvertUlongToLargeInteger(
+ ULONG UnsignedInteger)
+{
+ LARGE_INTEGER ret;
+ ret.QuadPart = UnsignedInteger;
+ return ret;
+}
+
NTSYSAPI
LUID
NTAPI
RtlConvertLongToLuid(
IN LONG Long);
-NTSYSAPI
-LARGE_INTEGER
-NTAPI
-RtlConvertUlongToLargeInteger(
- IN ULONG UnsignedInteger);
NTSYSAPI
LUID
NTAPI
RtlConvertUlongToLuid(
ULONG Ulong);
+
+#ifdef _M_AMD64
+
+static __inline
+LARGE_INTEGER
+NTAPI_INLINE
+RtlExtendedIntegerMultiply(
+ LARGE_INTEGER Multiplicand,
+ LONG Multiplier)
+{
+ LARGE_INTEGER ret;
+ ret.QuadPart = Multiplicand.QuadPart * Multiplier;
+ return ret;
+}
+
+static __inline
+LARGE_INTEGER
+NTAPI_INLINE
+RtlExtendedLargeIntegerDivide(
+ LARGE_INTEGER Dividend,
+ ULONG Divisor,
+ PULONG Remainder)
+{
+ LARGE_INTEGER ret;
+ ret.QuadPart = (ULONG64)Dividend.QuadPart / Divisor;
+ if (Remainder)
+ *Remainder = (ULONG)(Dividend.QuadPart % Divisor);
+ return ret;
+}
+
+#endif
/*
* VOID
@@ -9584,12 +9655,6 @@
NTKERNELAPI
VOID
NTAPI
-KeInitializeSpinLock(
- IN PKSPIN_LOCK SpinLock);
-
-NTKERNELAPI
-VOID
-NTAPI
KeInitializeTimer(
IN PKTIMER Timer);
Modified: branches/ros-amd64-bringup/reactos/include/ndk/kefuncs.h
URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/inclu…
==============================================================================
--- branches/ros-amd64-bringup/reactos/include/ndk/kefuncs.h [iso-8859-1] (original)
+++ branches/ros-amd64-bringup/reactos/include/ndk/kefuncs.h [iso-8859-1] Fri Aug 29
20:01:53 2008
@@ -133,11 +133,6 @@
IN PKLOCK_QUEUE_HANDLE LockHandle
);
-KIRQL
-FASTCALL
-KeAcquireSpinLockRaiseToSynch(
- IN OUT PKSPIN_LOCK SpinLock
-);
//
// Interrupt Functions