Author: tkreuzer Date: Tue Jul 29 19:30:00 2008 New Revision: 34940
URL: http://svn.reactos.org/svn/reactos?rev=34940&view=rev Log: - fix ExQueryPoolBlockSize prototype - make KI_USER_SHARED_DATA and IMAGE_ORDINAL_FLAG64 a ULONGLONG - fix definition if IMAGE_OPTIONAL_HEADER64 - add KPCR structure - add __readcrx intrinsics -
Modified: branches/ros-amd64-bringup/reactos/include/ddk/ntifs.h branches/ros-amd64-bringup/reactos/include/ddk/winddk.h branches/ros-amd64-bringup/reactos/include/psdk/intrin_x86.h branches/ros-amd64-bringup/reactos/include/psdk/winnt.h
Modified: branches/ros-amd64-bringup/reactos/include/ddk/ntifs.h URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/includ... ============================================================================== --- branches/ros-amd64-bringup/reactos/include/ddk/ntifs.h [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/include/ddk/ntifs.h [iso-8859-1] Tue Jul 29 19:30:00 2008 @@ -2499,7 +2499,7 @@ );
NTKERNELAPI -ULONG +SIZE_T NTAPI ExQueryPoolBlockSize ( IN PVOID PoolBlock,
Modified: branches/ros-amd64-bringup/reactos/include/ddk/winddk.h URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/includ... ============================================================================== --- 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 19:30:00 2008 @@ -5485,7 +5485,28 @@ #define PROFILE_LEVEL 15 #define HIGH_LEVEL 15
-#define KI_USER_SHARED_DATA 0xFFFFF78000000000 +#define KI_USER_SHARED_DATA 0xFFFFF78000000000ULL + +typedef struct _KPCR +{ + NT_TIB NtTib; + struct _KPRCB *CurrentPrcb; + ULONG64 SavedRcx; + ULONG64 SavedR11; + KIRQL Irql; + UCHAR SecondLevelCacheAssociativity; + UCHAR Number; + UCHAR Fill0; + ULONG Irr; + ULONG IrrActive; + ULONG Idr; + USHORT MajorVersion; + USHORT MinorVersion; + ULONG StallScaleFactor; + union _KIDTENTRY64 *IdtBase; + union _KGDTENTRY64 *GdtBase; + struct _KTSS64 *TssBase; +} KPCR, *PKPCR;
typedef struct _KFLOATING_SAVE { ULONG Dummy; @@ -5502,6 +5523,13 @@ NTAPI KeGetCurrentThread( VOID); + +FORCEINLINE +ULONG +KeGetCurrentProcessorNumber(VOID) +{ + return (ULONG)__readgsbyte(FIELD_OFFSET(KPCR, Number)); +}
#elif defined(__PowerPC__)
Modified: branches/ros-amd64-bringup/reactos/include/psdk/intrin_x86.h URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/includ... ============================================================================== --- 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 19:30:00 2008 @@ -1050,6 +1050,67 @@
/*** Protected memory management ***/ + +#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"); +} + +static __inline__ __attribute__((always_inline)) unsigned long long __readcr0(void) +{ + unsigned long long value; + __asm__ __volatile__("movq %%cr0, %q[value]" : [value] "=q" (value)); + return value; +} + +static __inline__ __attribute__((always_inline)) unsigned long long __readcr2(void) +{ + unsigned long long value; + __asm__ __volatile__("movq %%cr2, %q[value]" : [value] "=q" (value)); + return value; +} + +static __inline__ __attribute__((always_inline)) unsigned long long __readcr3(void) +{ + unsigned long long value; + __asm__ __volatile__("movq %%cr3, %q[value]" : [value] "=q" (value)); + return value; +} + +static __inline__ __attribute__((always_inline)) unsigned long long __readcr4(void) +{ + unsigned long long value; + __asm__ __volatile__("movq %%cr4, %q[value]" : [value] "=q" (value)); + return value; +} + +#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"); +} + +static __inline__ __attribute__((always_inline)) void __writecr3(const unsigned long long Data) +{ + __asm__("mov %[Data], %%cr3" : : [Data] "q" ((const unsigned long)(Data & 0xFFFFFFFF)) : "memory"); +} + +static __inline__ __attribute__((always_inline)) void __writecr4(const unsigned long long Data) +{ + __asm__("mov %[Data], %%cr4" : : [Data] "q" ((const unsigned long)(Data & 0xFFFFFFFF)) : "memory"); +} + static __inline__ __attribute__((always_inline)) unsigned long __readcr0(void) { unsigned long value; @@ -1078,36 +1139,6 @@ 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"); -} - -static __inline__ __attribute__((always_inline)) void __writecr3(const unsigned long long Data) -{ - __asm__("mov %[Data], %%cr3" : : [Data] "q" ((const unsigned long)(Data & 0xFFFFFFFF)) : "memory"); -} - -static __inline__ __attribute__((always_inline)) void __writecr4(const unsigned long long Data) -{ - __asm__("mov %[Data], %%cr4" : : [Data] "q" ((const unsigned long)(Data & 0xFFFFFFFF)) : "memory"); -} #endif
static __inline__ __attribute__((always_inline)) void __invlpg(void * const Address)
Modified: branches/ros-amd64-bringup/reactos/include/psdk/winnt.h URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/includ... ============================================================================== --- branches/ros-amd64-bringup/reactos/include/psdk/winnt.h [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/include/psdk/winnt.h [iso-8859-1] Tue Jul 29 19:30:00 2008 @@ -3388,7 +3388,7 @@ WORD MinorImageVersion; WORD MajorSubsystemVersion; WORD MinorSubsystemVersion; - DWORD Reserved1; + DWORD Win32VersionValue; DWORD SizeOfImage; DWORD SizeOfHeaders; DWORD CheckSum; @@ -3647,7 +3647,7 @@ } IMAGE_THUNK_DATA32; typedef IMAGE_THUNK_DATA32 *PIMAGE_THUNK_DATA32;
-#define IMAGE_ORDINAL_FLAG64 0x8000000000000000 +#define IMAGE_ORDINAL_FLAG64 0x8000000000000000ULL #define IMAGE_ORDINAL_FLAG32 0x80000000 #define IMAGE_ORDINAL64(Ordinal) (Ordinal & 0xffff) #define IMAGE_ORDINAL32(Ordinal) (Ordinal & 0xffff)