include vmm.inc VMMcall _PageDiscardPages, <LinPgNum, VM, nPages, flags> or eax, eax ; nonzero if discarded, zero if error jz not_discarded |
The _PageDiscardPages service marks pages as no longer in use, allowing the system to discard the pages. Subsequent attempts to access the page do not cause the system to read the previous contents of the page from disk.
LinPgNum
Specifies linear page number of the first page to discard. If this parameter is less than 110h or corresponds to a virtual machine high linear address, the VM parameter must specify a valid virtual machine handle. All pages of the specified range must be marked V86Pageable.
VM
Specifies a handle identifying the virtual machine containing the pages to discard.
nPages
Specifies the number of pages to discard.
flags
Specifies the operation flags. This parameter can be a combination of the following values:
Value | Meaning |
PageDiscard | Marks pages for a full discard by clearing both the P_ACC and P_DIRTY bits in the page-table entries. If this value is not given, this service only clears the P_ACC bit in the page-table entries. |
PageZeroInit | Fills the specified pages with zeros when a subsequent attempt to swap in the pages is made. This value only applies when the PageDiscard value is also given. If this value is not given, the content of the pages is undefined. |
All other values are reserved.
The EAX register contains a nonzero value if the service is successful. Otherwise EAX contains zero indicating an error, such as an invalid range or an invalid virtual machine handle.
This service ignores pages in the range which are not present or are locked. This service affects only pages that are subject to demand paging.
EAX