_UnmapFreePhysReg

include vmm.inc

VMMcall _UnmapFreePhysReg, <LinPgNum, nPages, flags>

or eax, eax ; nonzero if unmapped, zero if error

jz not_unmapped


The _UnmapFreePhysReg service unmaps a page in a free physical region, and places the physical memory back on the free list.

Parameters

LinPgNum

Specifies the linear page number of the first page to unmap. A linear page number is a linear address shifted right by 12 bits.

nPages

Specifies the number of pages in the region to unmap. This region must lie within the boundaries of a free physical region previously allocated using the _PageAllocate service.

flags

Specifies the operation flags. This parameter must be set to 0.

Return Value

The EAX register contains a nonzero value if the service is successful. Otherwise, EAX contains zero to indicate an error, such as an invalid linear page number, an invalid range of pages, or part of the range already not present.

Comments

This service is intended to be used in a free-physical-region callback procedure installed using the _SetFreePhysRegCalBk service. Virtual devices should not call this service until after the Sys_VM_Init message, or the Init_Complete message has been received.

If a virtual device maps pages using the PageFixed value with the _MapFreePhysReg service, it must not attempt to unmap the pages using the _UnmapFreePhysReg service.

Uses

EAX

See Also

_MapFreePhysReg, _PageAllocate