Author: tkreuzer
Date: Fri Oct 31 16:28:09 2008
New Revision: 37115
URL:
http://svn.reactos.org/svn/reactos?rev=37115&view=rev
Log:
merge 35742,35773,35780,35824,35969,36725,36952 from amd64 branch
Modified:
trunk/reactos/include/ddk/ntifs.h
trunk/reactos/include/ddk/winddk.h
trunk/reactos/include/ddk/winnt4.h
trunk/reactos/include/ndk/cmtypes.h
trunk/reactos/include/ndk/kefuncs.h
trunk/reactos/include/ndk/ketypes.h
Modified: trunk/reactos/include/ddk/ntifs.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ddk/ntifs.h?rev=37…
==============================================================================
--- trunk/reactos/include/ddk/ntifs.h [iso-8859-1] (original)
+++ trunk/reactos/include/ddk/ntifs.h [iso-8859-1] Fri Oct 31 16:28:09 2008
@@ -3631,6 +3631,8 @@
IN BOOLEAN AllowRawMount
);
+#if !defined (_M_AMD64)
+
NTHALAPI
KIRQL
FASTCALL
@@ -3645,6 +3647,51 @@
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: trunk/reactos/include/ddk/winddk.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ddk/winddk.h?rev=3…
==============================================================================
--- trunk/reactos/include/ddk/winddk.h [iso-8859-1] (original)
+++ trunk/reactos/include/ddk/winddk.h [iso-8859-1] Fri Oct 31 16:28:09 2008
@@ -1759,8 +1759,25 @@
struct {
ULONG Level;
ULONG Vector;
- ULONG Affinity;
+ KAFFINITY Affinity;
} Interrupt;
+#if (NTDDI_VERSION >= NTDDI_LONGHORN)
+ struct {
+ union {
+ struct {
+ USHORT Reserved;
+ USHORT MessageCount;
+ ULONG Vector;
+ KAFFINITY Affinity;
+ } Raw;
+ struct {
+ ULONG Level;
+ ULONG Vector;
+ KAFFINITY Affinity;
+ } Translated;
+ };
+ } MessageInterrupt;
+#endif
struct {
PHYSICAL_ADDRESS Start;
ULONG Length;
@@ -1783,6 +1800,20 @@
ULONG Reserved1;
ULONG Reserved2;
} DeviceSpecificData;
+#if (NTDDI_VERSION >= NTDDI_LONGHORN)
+ struct {
+ PHYSICAL_ADDRESS Start;
+ ULONG Length40;
+ } Memory40;
+ struct {
+ PHYSICAL_ADDRESS Start;
+ ULONG Length48;
+ } Memory48;
+ struct {
+ PHYSICAL_ADDRESS Start;
+ ULONG Length64;
+ } Memory64;
+#endif
} u;
} CM_PARTIAL_RESOURCE_DESCRIPTOR, *PCM_PARTIAL_RESOURCE_DESCRIPTOR;
@@ -5444,6 +5475,8 @@
ULONG HalReserved[16]; // For use by Hal
} KPCR, *PKPCR; /* 54 */
+#define KeGetPcr() PCR
+
typedef struct _KFLOATING_SAVE {
ULONG ControlWord;
ULONG StatusWord;
@@ -5661,6 +5694,8 @@
UCHAR Number; /* 51 */
} KPCR, *PKPCR; /* 54 */
+#define KeGetPcr() PCR
+
static __inline
ULONG
DDKAPI
@@ -5695,6 +5730,8 @@
ULONG IDR; /* 30 */
} KPCR, *PKPCR;
+#define KeGetPcr() PCR
+
typedef struct _KFLOATING_SAVE {
} KFLOATING_SAVE, *PKFLOATING_SAVE;
@@ -5792,6 +5829,7 @@
} PCIBUSDATA, *PPCIBUSDATA;
+/** INTERLOCKED FUNCTIONS *****************************************************/
#if !defined(__INTERLOCKED_DECLARED)
#define __INTERLOCKED_DECLARED
@@ -5908,38 +5946,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
@@ -5952,19 +5982,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
@@ -6364,23 +6435,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
@@ -9590,12 +9698,6 @@
NTKERNELAPI
VOID
NTAPI
-KeInitializeSpinLock(
- IN PKSPIN_LOCK SpinLock);
-
-NTKERNELAPI
-VOID
-NTAPI
KeInitializeTimer(
IN PKTIMER Timer);
@@ -10331,11 +10433,11 @@
* IN MM_PAGE_PRIORITY Priority)
*/
#define MmGetSystemAddressForMdlSafe(_Mdl, _Priority) \
- ((_Mdl)->MdlFlags & (MDL_MAPPED_TO_SYSTEM_VA \
+ (((_Mdl)->MdlFlags & (MDL_MAPPED_TO_SYSTEM_VA \
| MDL_SOURCE_IS_NONPAGED_POOL)) ? \
(_Mdl)->MappedSystemVa : \
(PVOID) MmMapLockedPagesSpecifyCache((_Mdl), \
- KernelMode, MmCached, NULL, FALSE, _Priority)
+ KernelMode, MmCached, NULL, FALSE, (_Priority)))
NTKERNELAPI
PVOID
Modified: trunk/reactos/include/ddk/winnt4.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ddk/winnt4.h?rev=3…
==============================================================================
--- trunk/reactos/include/ddk/winnt4.h [iso-8859-1] (original)
+++ trunk/reactos/include/ddk/winnt4.h [iso-8859-1] Fri Oct 31 16:28:09 2008
@@ -411,6 +411,7 @@
IN ULONG Multiplicand,
IN ULONG Multiplier);
+#ifndef _M_AMD64
NTSYSAPI
LARGE_INTEGER
NTAPI
@@ -425,6 +426,7 @@
IN LARGE_INTEGER Dividend,
IN ULONG Divisor,
IN OUT PULONG Remainder);
+#endif
NTSYSAPI
LARGE_INTEGER
Modified: trunk/reactos/include/ndk/cmtypes.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ndk/cmtypes.h?rev=…
==============================================================================
--- trunk/reactos/include/ndk/cmtypes.h [iso-8859-1] (original)
+++ trunk/reactos/include/ndk/cmtypes.h [iso-8859-1] Fri Oct 31 16:28:09 2008
@@ -433,8 +433,29 @@
{
ULONG Level;
ULONG Vector;
- ULONG Affinity;
+ KAFFINITY Affinity;
} Interrupt;
+#if (NTDDI_VERSION >= NTDDI_LONGHORN)
+ struct
+ {
+ union
+ {
+ struct
+ {
+ USHORT Reserved;
+ USHORT MessageCount;
+ ULONG Vector;
+ KAFFINITY Affinity;
+ } Raw;
+ struct
+ {
+ ULONG Level;
+ ULONG Vector;
+ KAFFINITY Affinity;
+ } Translated;
+ };
+ } MessageInterrupt;
+#endif
struct
{
PHYSICAL_ADDRESS Start;
@@ -448,7 +469,7 @@
} Dma;
struct
{
- ULONG Data[3];
+ ULONG Data[3];
} DevicePrivate;
struct
{
@@ -462,6 +483,23 @@
ULONG Reserved1;
ULONG Reserved2;
} DeviceSpecificData;
+#if (NTDDI_VERSION >= NTDDI_LONGHORN)
+ struct
+ {
+ PHYSICAL_ADDRESS Start;
+ ULONG Length40;
+ } Memory40;
+ struct
+ {
+ PHYSICAL_ADDRESS Start;
+ ULONG Length48;
+ } Memory48;
+ struct
+ {
+ PHYSICAL_ADDRESS Start;
+ ULONG Length64;
+ } Memory64;
+#endif
} u;
} CM_PARTIAL_RESOURCE_DESCRIPTOR, *PCM_PARTIAL_RESOURCE_DESCRIPTOR;
Modified: trunk/reactos/include/ndk/kefuncs.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ndk/kefuncs.h?rev=…
==============================================================================
--- trunk/reactos/include/ndk/kefuncs.h [iso-8859-1] (original)
+++ trunk/reactos/include/ndk/kefuncs.h [iso-8859-1] Fri Oct 31 16:28:09 2008
@@ -133,11 +133,6 @@
IN PKLOCK_QUEUE_HANDLE LockHandle
);
-KIRQL
-FASTCALL
-KeAcquireSpinLockRaiseToSynch(
- IN OUT PKSPIN_LOCK SpinLock
-);
//
// Interrupt Functions
Modified: trunk/reactos/include/ndk/ketypes.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ndk/ketypes.h?rev=…
==============================================================================
--- trunk/reactos/include/ndk/ketypes.h [iso-8859-1] (original)
+++ trunk/reactos/include/ndk/ketypes.h [iso-8859-1] Fri Oct 31 16:28:09 2008
@@ -106,11 +106,6 @@
#else
#define KINTERRUPT_DISPATCH_CODES 106
#endif
-
-//
-// Get KPCR
-//
-#define KeGetPcr() PCR
#ifdef NTOS_MODE_USER