From 89f1272447b6e7e4509ce238a705e99b75491dbc Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Wed, 3 Sep 2008 00:44:50 +0000 Subject: [PATCH] compatability fixes, so some hal code can be shared svn path=/branches/ros-amd64-bringup/; revision=35902 --- reactos/hal/halx86/generic/timer.c | 4 ++-- reactos/hal/halx86/include/bus.h | 8 ++++---- reactos/hal/halx86/include/hal.h | 4 ++++ reactos/hal/halx86/include/halp.h | 11 +++++++++++ 4 files changed, 21 insertions(+), 6 deletions(-) diff --git a/reactos/hal/halx86/generic/timer.c b/reactos/hal/halx86/generic/timer.c index 0149b8a3394..74f237f984e 100644 --- a/reactos/hal/halx86/generic/timer.c +++ b/reactos/hal/halx86/generic/timer.c @@ -48,7 +48,7 @@ HalpInitializeClock(VOID) PKPRCB Prcb = KeGetCurrentPrcb(); ULONG Increment; USHORT RollOver; - ULONG Flags = 0; + ULONG_PTR Flags = 0; /* Check the CPU Type */ if (Prcb->CpuType <= 4) @@ -92,7 +92,7 @@ NTAPI HalCalibratePerformanceCounter(IN volatile PLONG Count, IN ULONGLONG NewCount) { - ULONG Flags = 0; + ULONG_PTR Flags = 0; /* Disable interrupts */ Ke386SaveFlags(Flags); diff --git a/reactos/hal/halx86/include/bus.h b/reactos/hal/halx86/include/bus.h index 262efeea1b9..9f58d4055e0 100644 --- a/reactos/hal/halx86/include/bus.h +++ b/reactos/hal/halx86/include/bus.h @@ -43,7 +43,7 @@ #define TYPE1_READ(x, y) \ TYPE1_START(x, y) \ *((POINTER_TO_(y))Buffer) = \ - READ_FROM(y)((POINTER_TO_(y))(BusData->Config.Type1.Data + i)); \ + READ_FROM(y)((POINTER_TO_(y))(ULONG_PTR)(BusData->Config.Type1.Data + i)); \ TYPE1_END(y) // @@ -51,7 +51,7 @@ // #define TYPE1_WRITE(x, y) \ TYPE1_START(x, y) \ - WRITE_TO(y)((POINTER_TO_(y))(BusData->Config.Type1.Data + i), \ + WRITE_TO(y)((POINTER_TO_(y))(ULONG_PTR)(BusData->Config.Type1.Data + i), \ *((POINTER_TO_(y))Buffer)); \ TYPE1_END(y) @@ -69,7 +69,7 @@ #define TYPE2_READ(x, y) \ TYPE2_START(x, y) \ *((POINTER_TO_(y))Buffer) = \ - READ_FROM(y)((POINTER_TO_(y))(ULONG)PciCfg->u.AsUSHORT); \ + READ_FROM(y)((POINTER_TO_(y))(ULONG_PTR)PciCfg->u.AsUSHORT); \ TYPE2_END(y) // @@ -77,7 +77,7 @@ // #define TYPE2_WRITE(x, y) \ TYPE2_START(x, y) \ - WRITE_TO(y)((POINTER_TO_(y))(ULONG)PciCfg->u.AsUSHORT, \ + WRITE_TO(y)((POINTER_TO_(y))(ULONG_PTR)PciCfg->u.AsUSHORT, \ *((POINTER_TO_(y))Buffer)); \ TYPE2_END(y) diff --git a/reactos/hal/halx86/include/hal.h b/reactos/hal/halx86/include/hal.h index caedc2efd78..15a8f3f8508 100644 --- a/reactos/hal/halx86/include/hal.h +++ b/reactos/hal/halx86/include/hal.h @@ -35,7 +35,11 @@ /* Internal kernel headers */ #include "internal/pci.h" +#ifdef _M_AMD64 +#include "internal/amd64/intrin_i.h" +#else #include "internal/i386/intrin_i.h" +#endif /* Internal HAL Headers */ #include "apic.h" diff --git a/reactos/hal/halx86/include/halp.h b/reactos/hal/halx86/include/halp.h index e1b91270914..32d8c6b1f5a 100644 --- a/reactos/hal/halx86/include/halp.h +++ b/reactos/hal/halx86/include/halp.h @@ -154,6 +154,17 @@ HalpTrap06( VOID ); +#ifdef _M_AMD64 +#define KfLowerIrql KeLowerIrql +#ifndef CONFIG_SMP +/* On UP builds, spinlocks don't exist at IRQL >= DISPATCH */ +#define KiAcquireSpinLock(SpinLock) +#define KiReleaseSpinLock(SpinLock) +#define KfAcquireSpinLock(SpinLock) KfRaiseIrql(DISPATCH_LEVEL); +#define KfReleaseSpinLock(SpinLock, OldIrql) KeLowerIrql(OldIrql); +#endif // !CONFIG_SMP +#endif // _M_AMD64 + extern PVOID HalpRealModeStart; extern PVOID HalpRealModeEnd;