[NTOS]: Define portable MI_MAKE_ACCESSED_PAGE macro.

[NTOS]: Fix MiDetermineUserGlobalPteMask to account ARM, where the PDE and PTE formats are different.
[NTOS]: Fix MiDetermineUserGlobalPteMask to use portable PTE macros instead of hard-coding x86-only fields.

svn path=/trunk/; revision=49728
This commit is contained in:
Sir Richard 2010-11-23 16:34:30 +00:00
parent a93c65e3fe
commit 26d84c43e2
3 changed files with 9 additions and 5 deletions

View file

@ -20,6 +20,7 @@
#define PTE_BASE 0xC0000000
#define PTE_TOP 0xC03FFFFF
#define PDE_BASE 0xC0400000
#define PDE_TOP 0xC04FFFFF
#define HYPER_SPACE 0xC0500000
#if 0
@ -106,6 +107,7 @@ PULONG MmGetPageDirectory(VOID);
#define MI_MAKE_LOCAL_PAGE(x) ((x)->u.Hard.NonGlobal = 1)
#define MI_MAKE_DIRTY_PAGE(x)
#define MI_MAKE_ACCESSED_PAGE(x)
#define MI_MAKE_OWNER_PAGE(x) ((x)->u.Hard.Owner = 1)
#define MI_MAKE_WRITE_PAGE(x) ((x)->u.Hard.ReadOnly = 0)
#define MI_PAGE_DISABLE_CACHE(x) ((x)->u.Hard.Cached = 0)

View file

@ -51,6 +51,7 @@ PULONG MmGetPageDirectory(VOID);
#define MI_MAKE_LOCAL_PAGE(x) ((x)->u.Hard.Global = 0)
#define MI_MAKE_DIRTY_PAGE(x) ((x)->u.Hard.Dirty = 1)
#define MI_MAKE_ACCESSED_PAGE(x) ((x)->u.Hard.Accessed = 1)
#define MI_PAGE_DISABLE_CACHE(x) ((x)->u.Hard.CacheDisable = 1)
#define MI_PAGE_WRITE_THROUGH(x) ((x)->u.Hard.WriteThrough = 1)
#define MI_PAGE_WRITE_COMBINED(x) ((x)->u.Hard.WriteThrough = 0)

View file

@ -520,7 +520,7 @@ extern PMMWSL MmWorkingSetList;
//
ULONG
FORCEINLINE
MiDetermineUserGlobalPteMask(IN PMMPTE PointerPte)
MiDetermineUserGlobalPteMask(IN PVOID PointerPte)
{
MMPTE TempPte;
@ -529,14 +529,15 @@ MiDetermineUserGlobalPteMask(IN PMMPTE PointerPte)
/* Make it valid and accessed */
TempPte.u.Hard.Valid = TRUE;
TempPte.u.Hard.Accessed = TRUE;
MI_MAKE_ACCESSED_PAGE(&TempPte);
/* Is this for user-mode? */
if ((PointerPte <= MiHighestUserPte) ||
((PointerPte >= MiAddressToPde(NULL)) && (PointerPte <= MiHighestUserPde)))
if ((PointerPte <= (PVOID)MiHighestUserPte) ||
((PointerPte >= (PVOID)MiAddressToPde(NULL)) &&
(PointerPte <= (PVOID)MiHighestUserPde)))
{
/* Set the owner bit */
TempPte.u.Hard.Owner = TRUE;
MI_MAKE_OWNER_PAGE(&TempPte);
}
/* FIXME: We should also set the global bit */