PD


#include <vmm.h>

typedef ULONG _cdecl FUNPAGE(PULONG ppagerdata, PVOID ppage,
    ULONG faultpage);
typedef FUNPAGE *PFUNPAGE;

typedef struct pd_s {
    PFUNPAGE pd_virginin;
    PFUNPAGE pd_taintedin;
    PFUNPAGE pd_cleanout;
    PFUNPAGE pd_dirtyout;
    PFUNPAGE pd_virginfree;
    PFUNPAGE pd_taintedfree;
    PFUNPAGE pd_dirty;
    ULONG pd_type;
} PD, *PPD;

Pager-descriptor structure. Contains pointers to a pager's callback functions, and information about the overcommit characteristics of the pages the pager manages.

pd_virginin and pd_taintedin

Addresses of the pager functions that the system calls swap a page into memory. If the page has never been written to, the system calls the function specified by the pd_virginin member; otherwise it calls the function specified by the pd_taintedin member.

These functions must return a nonzero value if successful, or zero otherwise. The parameters have the following meanings:

ppagerdata

Address of a pager-defined 32-bit value stored with the virtual page. The pager can modify this value during page in and out operations, but not at other times.

ppage

Ring-zero physical address of the page.

faultpage

Linear page number that triggered a page fault. A pager should not attempt to access this page number. Note that the same page can be mapped to more than one linear address.


pd_cleanout and pd_dirtyout

Addresses of the pager functions that the system calls to swap a page out of memory. If the page has not been written to since it was last paged out, the system calls the function specified by the pd_cleanout member; otherwise it calls the function specified by the pd_dirtyout member.

These functions must return a nonzero value if successful, or zero otherwise. The parameters have the following meanings:

ppagerdata

Address of a pager-defined 32-bit value stored with the virtual page. The pager can modify this value during page in and out operations, but not at other times.

ppage

Ring-zero physical address of the page.

faultpage

Always – 1.


pd_virginfree and pd_taintedfree

Addresses of the pager functions that the system calls when the last reference to a virtual page controlled by the pager is decommitted. If the page has never been written to since it was committed, the system calls the function specified by the pd_virginfree member; otherwise it calls the function specified by the pd_taintedfree member.

The return value of these functions is ignored. The parameters have the following meanings:

ppagerdata

Address of a pager-defined 32-bit value stored with the virtual page. The pager can modify this value during page in and out operations, but not at other times.

ppage

Ring-zero physical address of the page if it is in memory, NULL otherwise.

faultpage

Linear page number of the page being decommitted.


pd_dirty

Address of the pager function that the memory manager calls when it detects that a page has been written to. If a page is dirtied in more than one memory context, this function is called once for each context.

The return value of this function is ignored. The parameters have the following meanings:

ppagerdata

Address of a pager-defined 32-bit value stored with the virtual page. The pager can modify this value during page in and out operations, but not at other times.

ppage

Undefined.

faultpage

Linear page number of the dirtied page.


pd_type

Value specifying the overcommit characteristics of the pages associated with this pager. Can be one of these values:

PD_SWAPPER

Pages controlled by this pager may be paged out.

PD_PAGERONLY

Pages controlled by this pager are never paged out to the swap file. If this value is specified, the VMM calls the pager's virgin-in function as soon as a page is committed; the tainted-in and page-out functions are never called.


See also _PagerRegister