From 218b87ee2925f4f96495b43241b2b9941440173d Mon Sep 17 00:00:00 2001 From: Thomas Faber Date: Fri, 11 Nov 2011 23:04:26 +0000 Subject: [PATCH] [KMTESTS] - Fix AMD64 build svn path=/trunk/; revision=54353 --- rostests/kmtests/ntos_ex/ExFastMutex.c | 2 ++ rostests/kmtests/ntos_ke/KeIrql.c | 5 ++++- rostests/kmtests/ntos_ke/KeSpinLock.c | 5 +++++ rostests/kmtests/rtl/RtlMemory.c | 3 +++ 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/rostests/kmtests/ntos_ex/ExFastMutex.c b/rostests/kmtests/ntos_ex/ExFastMutex.c index 1811b27c4da..4ed5afe371f 100644 --- a/rostests/kmtests/ntos_ex/ExFastMutex.c +++ b/rostests/kmtests/ntos_ex/ExFastMutex.c @@ -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"); diff --git a/rostests/kmtests/ntos_ke/KeIrql.c b/rostests/kmtests/ntos_ke/KeIrql.c index 82082cfc7d4..40f21634e3f 100644 --- a/rostests/kmtests/ntos_ke/KeIrql.c +++ b/rostests/kmtests/ntos_ke/KeIrql.c @@ -5,9 +5,10 @@ * PROGRAMMER: Thomas Faber */ +#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); diff --git a/rostests/kmtests/ntos_ke/KeSpinLock.c b/rostests/kmtests/ntos_ke/KeSpinLock.c index a2ed4a10ebc..2b5b67a671d 100644 --- a/rostests/kmtests/ntos_ke/KeSpinLock.c +++ b/rostests/kmtests/ntos_ke/KeSpinLock.c @@ -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); diff --git a/rostests/kmtests/rtl/RtlMemory.c b/rostests/kmtests/rtl/RtlMemory.c index 49dcf3e4c62..c33f0561a6d 100644 --- a/rostests/kmtests/rtl/RtlMemory.c +++ b/rostests/kmtests/rtl/RtlMemory.c @@ -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? */ -- 2.17.1