[KMTESTS]
authorThomas Faber <thomas.faber@reactos.org>
Fri, 11 Nov 2011 23:04:26 +0000 (23:04 +0000)
committerThomas Faber <thomas.faber@reactos.org>
Fri, 11 Nov 2011 23:04:26 +0000 (23:04 +0000)
- Fix AMD64 build

svn path=/trunk/; revision=54353

rostests/kmtests/ntos_ex/ExFastMutex.c
rostests/kmtests/ntos_ke/KeIrql.c
rostests/kmtests/ntos_ke/KeSpinLock.c
rostests/kmtests/rtl/RtlMemory.c

index 1811b27..4ed5afe 100644 (file)
@@ -44,6 +44,7 @@ TestFastMutex(
     ExReleaseFastMutex(Mutex);
     CheckMutex(Mutex, 1L, NULL, 0LU, OriginalIrql, OriginalIrql);
 
+#ifdef _M_X86
     /* ntoskrnl's fastcall version */
     ExiAcquireFastMutex(Mutex);
     CheckMutex(Mutex, 0L, Thread, 0LU, OriginalIrql, APC_LEVEL);
@@ -51,6 +52,7 @@ TestFastMutex(
     CheckMutex(Mutex, 0L, Thread, 0LU, OriginalIrql, APC_LEVEL);
     ExiReleaseFastMutex(Mutex);
     CheckMutex(Mutex, 1L, NULL, 0LU, OriginalIrql, OriginalIrql);
+#endif
 
     /* try to acquire */
     ok_bool_true(ExTryToAcquireFastMutex(Mutex), "ExTryToAcquireFastMutex returned");
index 82082cf..40f2163 100644 (file)
@@ -5,9 +5,10 @@
  * PROGRAMMER:      Thomas Faber <thfabba@gmx.de>
  */
 
+#ifndef _M_AMD64
 __declspec(dllimport) void __stdcall KeRaiseIrql(unsigned char, unsigned char *);
 __declspec(dllimport) void __stdcall KeLowerIrql(unsigned char);
-#ifdef _M_AMD64
+#else
 #define CLOCK1_LEVEL CLOCK_LEVEL
 #define CLOCK2_LEVEL CLOCK_LEVEL
 #endif
@@ -137,6 +138,7 @@ START_TEST(KeIrql)
         KeLowerIrql(PASSIVE_LEVEL);
     }
 
+#ifndef _M_AMD64
     /* try the actual exports, not only the fastcall versions */
     ok_irql(PASSIVE_LEVEL);
     (KeRaiseIrql)(HIGH_LEVEL, &Irql);
@@ -144,6 +146,7 @@ START_TEST(KeIrql)
     ok_eq_uint(Irql, PASSIVE_LEVEL);
     (KeLowerIrql)(Irql);
     ok_irql(PASSIVE_LEVEL);
+#endif
 
     /* make sure we exit gracefully */
     ok_irql(PASSIVE_LEVEL);
index a2ed4a1..2b5b67a 100644 (file)
@@ -122,8 +122,13 @@ DEFINE_RELEASE(ReleaseForDpc,         TRUE,  KeReleaseSpinLockForDpc(SpinLock, C
 DEFINE_ACQUIRE(AcquireInStackForDpc,  FALSE, KeAcquireInStackQueuedSpinLockForDpc(SpinLock, &CheckData->QueueHandle))
 DEFINE_RELEASE(ReleaseInStackForDpc,  FALSE, KeReleaseInStackQueuedSpinLockForDpc(&CheckData->QueueHandle))
 
+#ifdef _X86_
 DEFINE_ACQUIRE(AcquireInt,            FALSE, KiAcquireSpinLock(SpinLock))
 DEFINE_RELEASE(ReleaseInt,            FALSE, KiReleaseSpinLock(SpinLock))
+#else
+DEFINE_ACQUIRE(AcquireInt,            TRUE,  KeAcquireSpinLock(SpinLock, &CheckData->Irql))
+DEFINE_RELEASE(ReleaseInt,            TRUE,  KeReleaseSpinLock(SpinLock, CheckData->Irql))
+#endif
 
 BOOLEAN TryQueued(PKSPIN_LOCK SpinLock, PCHECK_DATA CheckData) {
     LOGICAL Ret = KeTryToAcquireQueuedSpinLock(CheckData->QueueNumber, &CheckData->Irql);
index 49dcf3e..c33f056 100644 (file)
@@ -440,6 +440,8 @@ START_TEST(RtlMemory)
     ok_eq_hex(Status, STATUS_SUCCESS);
     KeRaiseIrql(HIGH_LEVEL, &Irql);
 
+    /* TODO: fix NDK. This should work! */
+#if !defined _M_AMD64 || defined KMT_KERNEL_MODE
     /* RtlFillMemoryUlong */
     MakeBuffer(Buffer, Size, 0, 0);
     RtlFillMemoryUlong(Buffer, HalfSize, 0x01234567LU);
@@ -459,6 +461,7 @@ START_TEST(RtlMemory)
     } _SEH2_END;
     ok_eq_hex(Status, STATUS_SUCCESS);
     KeRaiseIrql(HIGH_LEVEL, &Irql);
+#endif
 
     /* RtlFillMemoryUlonglong */
     /* TODO: this function doesn't exist in 2k3/x86? wdm.h error? */