mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 18:33:10 +00:00
[NTOS:MM/x64] Fix Interlocked(Compare)ExchangePte and PAGE_FROM_SSE for x64
This fixes using PFNs with more than 20 bits.
This commit is contained in:
parent
5912c11650
commit
e6fa62a8d2
1 changed files with 12 additions and 0 deletions
|
@ -159,11 +159,19 @@ typedef ULONG_PTR SWAPENTRY;
|
||||||
#error Unsupported architecture!
|
#error Unsupported architecture!
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef _M_AMD64
|
||||||
|
#define InterlockedCompareExchangePte(PointerPte, Exchange, Comperand) \
|
||||||
|
InterlockedCompareExchange64((PLONG64)(PointerPte), Exchange, Comperand)
|
||||||
|
|
||||||
|
#define InterlockedExchangePte(PointerPte, Value) \
|
||||||
|
InterlockedExchange64((PLONG64)(PointerPte), Value)
|
||||||
|
#else
|
||||||
#define InterlockedCompareExchangePte(PointerPte, Exchange, Comperand) \
|
#define InterlockedCompareExchangePte(PointerPte, Exchange, Comperand) \
|
||||||
InterlockedCompareExchange((PLONG)(PointerPte), Exchange, Comperand)
|
InterlockedCompareExchange((PLONG)(PointerPte), Exchange, Comperand)
|
||||||
|
|
||||||
#define InterlockedExchangePte(PointerPte, Value) \
|
#define InterlockedExchangePte(PointerPte, Value) \
|
||||||
InterlockedExchange((PLONG)(PointerPte), Value)
|
InterlockedExchange((PLONG)(PointerPte), Value)
|
||||||
|
#endif
|
||||||
|
|
||||||
typedef struct _MM_SECTION_SEGMENT
|
typedef struct _MM_SECTION_SEGMENT
|
||||||
{
|
{
|
||||||
|
@ -1282,7 +1290,11 @@ MmFindRegion(
|
||||||
#define IS_DIRTY_SSE(E) ((E) & 2)
|
#define IS_DIRTY_SSE(E) ((E) & 2)
|
||||||
#define WRITE_SSE(E) ((E) | 4)
|
#define WRITE_SSE(E) ((E) | 4)
|
||||||
#define IS_WRITE_SSE(E) ((E) & 4)
|
#define IS_WRITE_SSE(E) ((E) & 4)
|
||||||
|
#ifdef _WIN64
|
||||||
|
#define PAGE_FROM_SSE(E) ((E) & 0xFFFFFFF000ULL)
|
||||||
|
#else
|
||||||
#define PAGE_FROM_SSE(E) ((E) & 0xFFFFF000)
|
#define PAGE_FROM_SSE(E) ((E) & 0xFFFFF000)
|
||||||
|
#endif
|
||||||
#define SHARE_COUNT_FROM_SSE(E) (((E) & 0x00000FFC) >> 3)
|
#define SHARE_COUNT_FROM_SSE(E) (((E) & 0x00000FFC) >> 3)
|
||||||
#define MAX_SHARE_COUNT 0x1FF
|
#define MAX_SHARE_COUNT 0x1FF
|
||||||
#define MAKE_SSE(P, C) ((ULONG_PTR)((P) | ((C) << 3)))
|
#define MAKE_SSE(P, C) ((ULONG_PTR)((P) | ((C) << 3)))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue