Author: tkreuzer
Date: Tue Jul 29 10:22:17 2008
New Revision: 34925
URL:
http://svn.reactos.org/svn/reactos?rev=34925&view=rev
Log:
- fix InterlockedExchangeAddSizeT
- fix __writecrx instrinsics
- fix some mmtypes
Modified:
branches/ros-amd64-bringup/reactos/include/ddk/winddk.h
branches/ros-amd64-bringup/reactos/include/ndk/amd64/mmtypes.h
branches/ros-amd64-bringup/reactos/include/ndk/arch/mmtypes.h
branches/ros-amd64-bringup/reactos/include/psdk/intrin_x86.h
Modified: branches/ros-amd64-bringup/reactos/include/ddk/winddk.h
URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/inclu…
==============================================================================
--- branches/ros-amd64-bringup/reactos/include/ddk/winddk.h [iso-8859-1] (original)
+++ branches/ros-amd64-bringup/reactos/include/ddk/winddk.h [iso-8859-1] Tue Jul 29
10:22:17 2008
@@ -5772,7 +5772,7 @@
#if defined (_M_AMD64)
-#define InterlockedExchangeAddSizeT(a, b) InterlockedExchangeAdd64((LONG *)a, b)
+#define InterlockedExchangeAddSizeT(a, b) InterlockedExchangeAdd64((LONGLONG *)a,
(LONGLONG)b)
#define InterlockedIncrementSizeT(a) InterlockedIncrement64((LONGLONG *)a)
#define InterlockedDecrementSizeT(a) InterlockedDecrement64((LONGLONG *)a)
#define InterlockedAnd _InterlockedAnd
Modified: branches/ros-amd64-bringup/reactos/include/ndk/amd64/mmtypes.h
URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/inclu…
==============================================================================
--- branches/ros-amd64-bringup/reactos/include/ndk/amd64/mmtypes.h [iso-8859-1]
(original)
+++ branches/ros-amd64-bringup/reactos/include/ndk/amd64/mmtypes.h [iso-8859-1] Tue Jul 29
10:22:17 2008
@@ -1,18 +1,20 @@
/*++ NDK Version: 0095
Copyright (c) Alex Ionescu. All rights reserved.
+Copyright (c) Timo Kreuzer All rights reserved.
Header Name:
- mmtypes.h (X86)
+ mmtypes.h (AMD64)
Abstract:
- i386 Type definitions for the Memory Manager
+ AMD64 Type definitions for the Memory Manager
Author:
Alex Ionescu (alex.ionescu(a)reactos.com) 06-Oct-2004
+ Timo Kreuzer (timo.kreuzer(a)reactos.com) 29-Jul-2008
--*/
@@ -43,29 +45,26 @@
#endif
//
-// PAE SEG0 Base?
-//
-#define KSEG0_BASE_PAE 0xE0000000
-
-//
// Page Table Entry Definitions
//
-typedef struct _HARDWARE_PTE_X86
+typedef struct _HARDWARE_PTE_AMD64
{
- ULONG Valid:1;
- ULONG Write:1;
- ULONG Owner:1;
- ULONG WriteThrough:1;
- ULONG CacheDisable:1;
- ULONG Accessed:1;
- ULONG Dirty:1;
- ULONG LargePage:1;
- ULONG Global:1;
- ULONG CopyOnWrite:1;
- ULONG Prototype: 1;
- ULONG reserved: 1;
- ULONG PageFrameNumber:20;
-} HARDWARE_PTE_X86, *PHARDWARE_PTE_X86;
+ ULONGLONG Valid:1;
+ ULONGLONG Write:1;
+ ULONGLONG Owner:1;
+ ULONGLONG WriteThrough:1;
+ ULONGLONG CacheDisable:1;
+ ULONGLONG Accessed:1;
+ ULONGLONG Dirty:1;
+ ULONGLONG LargePage:1;
+ ULONGLONG Global:1;
+ ULONGLONG CopyOnWrite:1;
+ ULONGLONG Prototype: 1;
+ ULONGLONG reserved1: 1;
+ ULONGLONG PageFrameNumber:40;
+ ULONGLONG reserved2:11;
+ ULONGLONG NoExecute:1;
+} HARDWARE_PTE_AMD64, *PHARDWARE_PTE_AMD64;
typedef struct _MMPTE_SOFTWARE
{
@@ -124,46 +123,33 @@
typedef struct _MMPTE_HARDWARE
{
- ULONG Valid:1;
- ULONG Write:1;
- ULONG Owner:1;
- ULONG WriteThrough:1;
- ULONG CacheDisable:1;
- ULONG Accessed:1;
- ULONG Dirty:1;
- ULONG LargePage:1;
- ULONG Global:1;
- ULONG CopyOnWrite:1;
- ULONG Prototype:1;
- ULONG reserved:1;
- ULONG PageFrameNumber:20;
+ ULONGLONG Valid:1;
+ ULONGLONG Write:1;
+ ULONGLONG Owner:1;
+ ULONGLONG WriteThrough:1;
+ ULONGLONG CacheDisable:1;
+ ULONGLONG Accessed:1;
+ ULONGLONG Dirty:1;
+ ULONGLONG LargePage:1;
+ ULONGLONG Global:1;
+ ULONGLONG CopyOnWrite:1;
+ ULONGLONG Prototype: 1;
+ ULONGLONG reserved1: 1;
+ ULONGLONG PageFrameNumber:40;
+ ULONGLONG reserved2:11;
+ ULONGLONG NoExecute:1;
} MMPTE_HARDWARE, *PMMPTE_HARDWARE;
#else
-typedef struct _MMPTE_HARDWARE
-{
- ULONG Valid:1;
- ULONG Writable:1;
- ULONG Owner:1;
- ULONG WriteThrough:1;
- ULONG CacheDisable:1;
- ULONG Accessed:1;
- ULONG Dirty:1;
- ULONG LargePage:1;
- ULONG Global:1;
- ULONG CopyOnWrite:1;
- ULONG Prototype:1;
- ULONG Write:1;
- ULONG PageFrameNumber:20;
-} MMPTE_HARDWARE, *PMMPTE_HARDWARE;
+#error MMPTE_HARDWARE undeclared
#endif
//
// Use the right PTE structure
//
-#define HARDWARE_PTE HARDWARE_PTE_X86
-#define PHARDWARE_PTE PHARDWARE_PTE_X86
+#define HARDWARE_PTE HARDWARE_PTE_AMD64
+#define PHARDWARE_PTE PHARDWARE_PTE_AMD64
#endif
Modified: branches/ros-amd64-bringup/reactos/include/ndk/arch/mmtypes.h
URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/inclu…
==============================================================================
--- branches/ros-amd64-bringup/reactos/include/ndk/arch/mmtypes.h [iso-8859-1] (original)
+++ branches/ros-amd64-bringup/reactos/include/ndk/arch/mmtypes.h [iso-8859-1] Tue Jul 29
10:22:17 2008
@@ -22,12 +22,14 @@
//
// Include the right file for this architecture.
//
-#if defined(_M_IX86) || defined(_M_AMD64)
+#if defined(_M_IX86)
#include <i386/mmtypes.h>
#elif defined(_M_PPC)
#include <powerpc/mmtypes.h>
#elif defined(_M_ARM)
#include <arm/mmtypes.h>
+#elif defined(_M_AMD64)
+#include <amd64/mmtypes.h>
#else
#error "Unknown processor"
#endif
Modified: branches/ros-amd64-bringup/reactos/include/psdk/intrin_x86.h
URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/inclu…
==============================================================================
--- branches/ros-amd64-bringup/reactos/include/psdk/intrin_x86.h [iso-8859-1] (original)
+++ branches/ros-amd64-bringup/reactos/include/psdk/intrin_x86.h [iso-8859-1] Tue Jul 29
10:22:17 2008
@@ -1078,8 +1078,24 @@
return value;
}
+#ifdef _M_AMD64
static __inline__ __attribute__((always_inline)) void __writecr0(const unsigned long long
Data)
{
+ __asm__("movq %q[Data], %%cr0" : : [Data] "q" (Data) :
"memory");
+}
+
+static __inline__ __attribute__((always_inline)) void __writecr3(const unsigned long long
Data)
+{
+ __asm__("movq %q[Data], %%cr3" : : [Data] "q" (Data) :
"memory");
+}
+
+static __inline__ __attribute__((always_inline)) void __writecr4(const unsigned long long
Data)
+{
+ __asm__("movq %q[Data], %%cr4" : : [Data] "q" (Data) :
"memory");
+}
+#else
+static __inline__ __attribute__((always_inline)) void __writecr0(const unsigned long long
Data)
+{
__asm__("mov %[Data], %%cr0" : : [Data] "q" ((const unsigned
long)(Data & 0xFFFFFFFF)) : "memory");
}
@@ -1092,6 +1108,7 @@
{
__asm__("mov %[Data], %%cr4" : : [Data] "q" ((const unsigned
long)(Data & 0xFFFFFFFF)) : "memory");
}
+#endif
static __inline__ __attribute__((always_inline)) void __invlpg(void * const Address)
{