update for HEAD-2003091401
[reactos.git] / ntoskrnl / ke / spinlock.c
index 2e10122..767b3f6 100644 (file)
@@ -23,6 +23,9 @@
 
 /* FUNCTIONS ***************************************************************/
 
+/*
+ * @implemented
+ */
 BOOLEAN STDCALL
 KeSynchronizeExecution (PKINTERRUPT            Interrupt,
                        PKSYNCHRONIZE_ROUTINE   SynchronizeRoutine,
@@ -52,6 +55,9 @@ KeSynchronizeExecution (PKINTERRUPT           Interrupt,
    return(ret);
 }
 
+/*
+ * @implemented
+ */
 VOID STDCALL
 KeInitializeSpinLock (PKSPIN_LOCK      SpinLock)
 /*
@@ -60,9 +66,14 @@ KeInitializeSpinLock (PKSPIN_LOCK    SpinLock)
  *           SpinLock = Caller supplied storage for the spinlock
  */
 {
-   SpinLock->Lock = 0;
+   *SpinLock = 0;
 }
 
+#undef KeAcquireSpinLockAtDpcLevel
+
+/*
+ * @implemented
+ */
 VOID STDCALL
 KeAcquireSpinLockAtDpcLevel (PKSPIN_LOCK       SpinLock)
 /*
@@ -78,23 +89,28 @@ KeAcquireSpinLockAtDpcLevel (PKSPIN_LOCK    SpinLock)
     * FIXME: This depends on gcc assembling this test to a single load from
     * the spinlock's value.
     */
-   if ((ULONG)SpinLock->Lock >= 2)
+   if (*SpinLock >= 2)
      {
-       DbgPrint("Lock %x has bad value %x\n", SpinLock, SpinLock->Lock);
-       KeBugCheck(0);
+       DbgPrint("Lock %x has bad value %x\n", SpinLock, *SpinLock);
+       KEBUGCHECK(0);
      }
    
-   while ((i = InterlockedExchange(&SpinLock->Lock, 1)) == 1)
+   while ((i = InterlockedExchange((LONG *)SpinLock, 1)) == 1)
      {
 #ifndef MP
        DbgPrint("Spinning on spinlock %x current value %x\n", SpinLock, i);
-       KeBugCheck(0);
+       KEBUGCHECK(0);
 #else /* not MP */
        /* Avoid reading the value again too fast */
 #endif /* MP */
      }
 }
 
+#undef KeReleaseSpinLockFromDpcLevel
+
+/*
+ * @implemented
+ */
 VOID STDCALL
 KeReleaseSpinLockFromDpcLevel (PKSPIN_LOCK     SpinLock)
 /*
@@ -104,12 +120,12 @@ KeReleaseSpinLockFromDpcLevel (PKSPIN_LOCK        SpinLock)
  *         SpinLock = Spinlock to release
  */
 {
-   if (SpinLock->Lock != 1)
+   if (*SpinLock != 1)
      {
        DbgPrint("Releasing unacquired spinlock %x\n", SpinLock);
-       KeBugCheck(0);
+       KEBUGCHECK(0);
      }
-   (void)InterlockedExchange(&SpinLock->Lock, 0);
+   (void)InterlockedExchange((LONG *)SpinLock, 0);
 }
 
 /* EOF */