#include <vmm.h> ULONG EXTERNAL _PageCommitContig(ULONG page, ULONG npages, ULONG flags, ULONG alignmask, ULONG minphys, ULONG maxphys);
Commits physically contiguous pages to a range of linear addresses. ommitting physically contiguous pages is typically required only when interacting with hardware devices that impose external constraints on the physical properties of the memory on which they operate.
page and npages
Linear page number to commit the first physical page to, and the number of pages to commit. The entire range of linear addresses must have been previously reserved by a single call to the _PageReserve service, and none of the linear pages can be already committed. If the PC_NOLIN flag is specified, page is ignored.
flags
Zero or more of these values:
PC_USER | The pages are accessible at ring 3. |
PC_WRITEABLE | The pages are writeable. |
PCC_ZEROINIT | The pages are zero initialized. |
PCC_NOLIN | The pages are not mapped to any linear addresses. If PCC_NOLIN is passed, raw physical pages are allocated and the raw physical address is returned. Pages allocated in this way cannot be freed; they belong permanently to the caller. The PCC_NOLIN flag must not be combined with any of the other flags. |
alignmask
Value specifying the physical alignment of the memory. Can be one of these values:
0x00 | 4 K alignment |
0x01 | 8 K alignment |
0x03 | 16 K alignment |
0x07 | 32 K alignment |
0x0F | 64 K alignment |
0x1F | 128 K alignment |
minphys and maxphys
Minimum and maximum physical page numbers for new pages.
The pages allocated will be greater than or equal to minphys and strictly less than maxphys. For example, to ensure that the pages returned will lie below the 16MB boundary, pass minphys=0x0000 and maxphys=0x1000. If you do not wish to impose restrictions on the physical page numbers, pass minphys=0 and maxphys=-1.
This service is typically used when communicating with hardware devices which have peculiar requirements on the physical address on which they operate. The _PageCommit service does not ensure the physical properties of the pages committed.
Pages allocated by this service are allocated as PC_FIXED.