ReactOS  0.4.15-dev-1206-g731eddf
page.c File Reference
#include <ntoskrnl.h>
#include <debug.h>
#include <mm/ARM3/miarm.h>
Include dependency graph for page.c:

Go to the source code of this file.

Macros

#define NDEBUG
 
#define MODULE_INVOLVED_IN_ARM3
 

Functions

VOID NTAPI MiFlushTlb (IN PMMPTE PointerPte, IN PVOID Address)
 
BOOLEAN NTAPI MmCreateProcessAddressSpace (IN ULONG MinWs, IN PEPROCESS Process, IN PULONG DirectoryTableBase)
 
NTSTATUS NTAPI MmCreateVirtualMappingUnsafe (IN PEPROCESS Process, IN PVOID Address, IN ULONG Protection, IN PPFN_NUMBER Pages, IN ULONG PageCount)
 
NTSTATUS NTAPI MmCreateVirtualMapping (IN PEPROCESS Process, IN PVOID Address, IN ULONG Protection, IN PPFN_NUMBER Pages, IN ULONG PageCount)
 
VOID NTAPI MmRawDeleteVirtualMapping (IN PVOID Address)
 
VOID NTAPI MmDeleteVirtualMapping (IN PEPROCESS Process, IN PVOID Address, OUT PBOOLEAN WasDirty, OUT PPFN_NUMBER Page)
 
VOID NTAPI MmDeletePageFileMapping (IN PEPROCESS Process, IN PVOID Address, IN SWAPENTRY *SwapEntry)
 
NTSTATUS NTAPI MmCreatePageFileMapping (IN PEPROCESS Process, IN PVOID Address, IN SWAPENTRY SwapEntry)
 
PFN_NUMBER NTAPI MmGetPfnForProcess (IN PEPROCESS Process, IN PVOID Address)
 
BOOLEAN NTAPI MmIsDirtyPage (IN PEPROCESS Process, IN PVOID Address)
 
VOID NTAPI MmSetCleanPage (IN PEPROCESS Process, IN PVOID Address)
 
VOID NTAPI MmSetDirtyPage (IN PEPROCESS Process, IN PVOID Address)
 
BOOLEAN NTAPI MmIsPagePresent (IN PEPROCESS Process, IN PVOID Address)
 
BOOLEAN NTAPI MmIsPageSwapEntry (IN PEPROCESS Process, IN PVOID Address)
 
ULONG NTAPI MmGetPageProtect (IN PEPROCESS Process, IN PVOID Address)
 
VOID NTAPI MmSetPageProtect (IN PEPROCESS Process, IN PVOID Address, IN ULONG Protection)
 
VOID NTAPI MmInitGlobalKernelPageDirectory (VOID)
 
VOID NTAPI MmGetPageFileMapping (PEPROCESS Process, PVOID Address, SWAPENTRY *SwapEntry)
 
BOOLEAN NTAPI MmIsDisabledPage (PEPROCESS Process, PVOID Address)
 
INIT_FUNCTION VOID NTAPI MiInitializeSessionSpaceLayout (VOID)
 

Variables

const ULONG MmProtectToPteMask [32]
 
const ULONG MmProtectToValue [32]
 
ULONG MmGlobalKernelPageDirectory [4096]
 
MMPDE ValidKernelPde = {.u.Hard.Valid = 1}
 
MMPTE ValidKernelPte = {.u.Hard.Valid = 1, .u.Hard.Sbo = 1}
 
MMPDE DemandZeroPde = {.u.Long = (MM_READWRITE << MM_PTE_SOFTWARE_PROTECTION_BITS)}
 
MMPTE DemandZeroPte = {.u.Long = (MM_READWRITE << MM_PTE_SOFTWARE_PROTECTION_BITS)}
 
MMPTE PrototypePte = {.u.Long = (MM_READWRITE << MM_PTE_SOFTWARE_PROTECTION_BITS) | PTE_PROTOTYPE | (MI_PTE_LOOKUP_NEEDED << PAGE_SHIFT)}
 
MMPTE ValidKernelPteLocal = {{0}}
 
MMPDE ValidKernelPdeLocal = {{0}}
 
MMPTE MmDecommittedPte = {{0}}
 

Macro Definition Documentation

◆ MODULE_INVOLVED_IN_ARM3

#define MODULE_INVOLVED_IN_ARM3

Definition at line 15 of file page.c.

◆ NDEBUG

#define NDEBUG

Definition at line 12 of file page.c.

Function Documentation

◆ MiFlushTlb()

VOID NTAPI MiFlushTlb ( IN PMMPTE  PointerPte,
IN PVOID  Address 
)

Definition at line 128 of file page.c.

130 {
132 }
#define UNIMPLEMENTED_DBGBREAK(...)
Definition: debug.h:57

◆ MiInitializeSessionSpaceLayout()

INIT_FUNCTION VOID NTAPI MiInitializeSessionSpaceLayout ( VOID  )

Definition at line 318 of file page.c.

319 {
320  ASSERT(FALSE);
321 }
#define FALSE
Definition: types.h:117
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)

◆ MmCreatePageFileMapping()

NTSTATUS NTAPI MmCreatePageFileMapping ( IN PEPROCESS  Process,
IN PVOID  Address,
IN SWAPENTRY  SwapEntry 
)

Definition at line 196 of file page.c.

199 {
201  return STATUS_NOT_IMPLEMENTED;
202 }
#define STATUS_NOT_IMPLEMENTED
Definition: ntstatus.h:239
#define UNIMPLEMENTED_DBGBREAK(...)
Definition: debug.h:57

◆ MmCreateProcessAddressSpace()

BOOLEAN NTAPI MmCreateProcessAddressSpace ( IN ULONG  MinWs,
IN PEPROCESS  Process,
IN PULONG  DirectoryTableBase 
)

Definition at line 136 of file page.c.

139 {
141  return FALSE;
142 }
#define FALSE
Definition: types.h:117
#define UNIMPLEMENTED_DBGBREAK(...)
Definition: debug.h:57

◆ MmCreateVirtualMapping()

NTSTATUS NTAPI MmCreateVirtualMapping ( IN PEPROCESS  Process,
IN PVOID  Address,
IN ULONG  Protection,
IN PPFN_NUMBER  Pages,
IN ULONG  PageCount 
)

Definition at line 158 of file page.c.

163 {
165  return STATUS_SUCCESS;
166 }
#define UNIMPLEMENTED_DBGBREAK(...)
Definition: debug.h:57
return STATUS_SUCCESS
Definition: btrfs.c:3014

◆ MmCreateVirtualMappingUnsafe()

NTSTATUS NTAPI MmCreateVirtualMappingUnsafe ( IN PEPROCESS  Process,
IN PVOID  Address,
IN ULONG  Protection,
IN PPFN_NUMBER  Pages,
IN ULONG  PageCount 
)

Definition at line 146 of file page.c.

151 {
153  return STATUS_SUCCESS;
154 }
#define UNIMPLEMENTED_DBGBREAK(...)
Definition: debug.h:57
return STATUS_SUCCESS
Definition: btrfs.c:3014

◆ MmDeletePageFileMapping()

VOID NTAPI MmDeletePageFileMapping ( IN PEPROCESS  Process,
IN PVOID  Address,
IN SWAPENTRY SwapEntry 
)

Definition at line 187 of file page.c.

190 {
192 }
#define UNIMPLEMENTED_DBGBREAK(...)
Definition: debug.h:57

◆ MmDeleteVirtualMapping()

VOID NTAPI MmDeleteVirtualMapping ( IN PEPROCESS  Process,
IN PVOID  Address,
OUT PBOOLEAN  WasDirty,
OUT PPFN_NUMBER  Page 
)

Definition at line 177 of file page.c.

181 {
183 }
#define UNIMPLEMENTED_DBGBREAK(...)
Definition: debug.h:57

◆ MmGetPageFileMapping()

VOID NTAPI MmGetPageFileMapping ( PEPROCESS  Process,
PVOID  Address,
SWAPENTRY SwapEntry 
)

Definition at line 299 of file page.c.

303 {
304  ASSERT(FALSE);
305 }
#define FALSE
Definition: types.h:117
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)

◆ MmGetPageProtect()

ULONG NTAPI MmGetPageProtect ( IN PEPROCESS  Process,
IN PVOID  Address 
)

Definition at line 258 of file page.c.

260 {
261  /* We don't enforce any protection on the pages -- they are all RWX */
262  return PAGE_READWRITE;
263 }
#define PAGE_READWRITE
Definition: nt_native.h:1304

◆ MmGetPfnForProcess()

PFN_NUMBER NTAPI MmGetPfnForProcess ( IN PEPROCESS  Process,
IN PVOID  Address 
)

Definition at line 206 of file page.c.

208 {
210  return 0;
211 }
#define UNIMPLEMENTED_DBGBREAK(...)
Definition: debug.h:57

◆ MmInitGlobalKernelPageDirectory()

VOID NTAPI MmInitGlobalKernelPageDirectory ( VOID  )

Definition at line 277 of file page.c.

278 {
279  ULONG i;
280  PULONG CurrentPageDirectory = (PULONG)PDE_BASE;
281 
282  /* Loop the 2GB of address space which belong to the kernel */
283  for (i = MiGetPdeOffset(MmSystemRangeStart); i < 2048; i++)
284  {
285  /* Check if we have an entry for this already */
286  if ((i != MiGetPdeOffset(PTE_BASE)) &&
287  (i != MiGetPdeOffset(HYPER_SPACE)) &&
289  (CurrentPageDirectory[i]))
290  {
291  /* We don't, link it in our global page directory */
292  MmGlobalKernelPageDirectory[i] = CurrentPageDirectory[i];
293  }
294  }
295 }
#define MiGetPdeOffset(x)
Definition: mm.h:188
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define PDE_BASE
Definition: winldr.c:21
#define PTE_BASE
Definition: mmx86.c:14
unsigned int * PULONG
Definition: retypes.h:1
#define HYPER_SPACE
Definition: mm.h:14
unsigned int ULONG
Definition: retypes.h:1
#define MmSystemRangeStart
Definition: mm.h:32
ULONG MmGlobalKernelPageDirectory[4096]
Definition: page.c:107

◆ MmIsDirtyPage()

BOOLEAN NTAPI MmIsDirtyPage ( IN PEPROCESS  Process,
IN PVOID  Address 
)

Definition at line 215 of file page.c.

217 {
219  return FALSE;
220 }
#define FALSE
Definition: types.h:117
#define UNIMPLEMENTED_DBGBREAK(...)
Definition: debug.h:57

◆ MmIsDisabledPage()

BOOLEAN NTAPI MmIsDisabledPage ( PEPROCESS  Process,
PVOID  Address 
)

Definition at line 309 of file page.c.

310 {
311  ASSERT(FALSE);
312  return FALSE;
313 }
#define FALSE
Definition: types.h:117
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)

◆ MmIsPagePresent()

BOOLEAN NTAPI MmIsPagePresent ( IN PEPROCESS  Process,
IN PVOID  Address 
)

Definition at line 240 of file page.c.

242 {
244  return FALSE;
245 }
#define FALSE
Definition: types.h:117
#define UNIMPLEMENTED_DBGBREAK(...)
Definition: debug.h:57

◆ MmIsPageSwapEntry()

BOOLEAN NTAPI MmIsPageSwapEntry ( IN PEPROCESS  Process,
IN PVOID  Address 
)

Definition at line 249 of file page.c.

251 {
253  return FALSE;
254 }
#define FALSE
Definition: types.h:117
#define UNIMPLEMENTED_DBGBREAK(...)
Definition: debug.h:57

◆ MmRawDeleteVirtualMapping()

VOID NTAPI MmRawDeleteVirtualMapping ( IN PVOID  Address)

Definition at line 170 of file page.c.

171 {
173 }
#define UNIMPLEMENTED_DBGBREAK(...)
Definition: debug.h:57

◆ MmSetCleanPage()

VOID NTAPI MmSetCleanPage ( IN PEPROCESS  Process,
IN PVOID  Address 
)

Definition at line 224 of file page.c.

226 {
228 }
#define UNIMPLEMENTED_DBGBREAK(...)
Definition: debug.h:57

◆ MmSetDirtyPage()

VOID NTAPI MmSetDirtyPage ( IN PEPROCESS  Process,
IN PVOID  Address 
)

Definition at line 232 of file page.c.

234 {
236 }
#define UNIMPLEMENTED_DBGBREAK(...)
Definition: debug.h:57

◆ MmSetPageProtect()

VOID NTAPI MmSetPageProtect ( IN PEPROCESS  Process,
IN PVOID  Address,
IN ULONG  Protection 
)

Definition at line 267 of file page.c.

270 {
271  /* We don't enforce any protection on the pages -- they are all RWX */
272  return;
273 }

Variable Documentation

◆ DemandZeroPde

Definition at line 114 of file page.c.

Referenced by MmGetPageTableForProcess().

◆ DemandZeroPte

Definition at line 115 of file page.c.

◆ MmDecommittedPte

MMPTE MmDecommittedPte = {{0}}

Definition at line 122 of file page.c.

◆ MmGlobalKernelPageDirectory

ULONG MmGlobalKernelPageDirectory[4096]

Definition at line 107 of file page.c.

Referenced by MmInitGlobalKernelPageDirectory().

◆ MmProtectToPteMask

const ULONG MmProtectToPteMask[32]

Definition at line 22 of file page.c.

◆ MmProtectToValue

const ULONG MmProtectToValue[32]

Definition at line 71 of file page.c.

◆ PrototypePte

Definition at line 118 of file page.c.

◆ ValidKernelPde

MMPDE ValidKernelPde = {.u.Hard.Valid = 1}

Definition at line 110 of file page.c.

◆ ValidKernelPdeLocal

MMPDE ValidKernelPdeLocal = {{0}}

Definition at line 121 of file page.c.

◆ ValidKernelPte

MMPTE ValidKernelPte = {.u.Hard.Valid = 1, .u.Hard.Sbo = 1}

Definition at line 111 of file page.c.

Referenced by MmCreateProcessAddressSpace().

◆ ValidKernelPteLocal

MMPTE ValidKernelPteLocal = {{0}}

Definition at line 120 of file page.c.