Jump to content

KernVMAlloc: Difference between revisions

From EDM2
Ak120 (talk | contribs)
m Ak120 moved page OS2 API:KEE:KernVMAlloc to KernVMAlloc
Ak120 (talk | contribs)
mNo edit summary
Line 1: Line 1:
This is the equivalent of the [[DevHlp_VMAlloc]] function.
==Synopsis==
==Synopsis==
APIRET APIENTRY KernVMAlloc(ULONG size, ULONG flags, PVOID* linaddr, PVOID* physaddr, PSHORT sel);
APIRET APIENTRY KernVMAlloc(ULONG size, ULONG flags, PVOID* linaddr, PVOID* physaddr, PSHORT sel);
==Description==
This is the equivalent of the DevHlp_VMAlloc function.


==Parameters==
==Parameters==
 
;size:Number of bytes to allocate.  
size
;flags:One or more of the following flags. See DevHlp_VMAlloc docs for details.
    Number of bytes to allocate.  
KEE_VMA_16MB       allocate memory from below 16MB  
flags
KEE_VMA_FIXED     allocate memory that won't be swapped out  
    One or more of the following flags. See DevHlp_VMAlloc docs for details.
KEE_VMA_SWAP       allocate memory that is swappable  
 
KEE_VMA_CONTIG     allocate contiguous physical memory pages  
    KEE_VMA_16MB
KEE_VMA_PHYS       allocate physical memory (pass address in physaddr argument)  
        allocate memory from below 16MB  
KEE_VMA_PROCESS   allocate memory in the process address space.  
    KEE_VMA_FIXED
KEE_VMA_SGSCONT   register memory under screen group control  
        allocate memory that won't be swapped out  
KEE_VMA_GETSEL     return a GDT selector for the allocated memory.
    KEE_VMA_SWAP
                    This option exists also in DevHlp_VMAlloc (undocumented).  
        allocate memory that is swappable  
KEE_VMA_RESERVE   Don't commit the allocated memory.  
     KEE_VMA_CONTIG
KEE_VMA_SHARED     allocate memory that is shareable  
        allocate contiguous physical memory pages  
KEE_VMA_USEHIGHMEM allocate memory from above 16MB.  
    KEE_VMA_PHYS
;linaddr:address of a variable to receive the linear address of the memory.
        allocate physical memory (pass address in physaddr argument)  
;physaddr:address of a variable that contains the physical address of the memory.
    KEE_VMA_PROCESS
;sel:address of a variable to receive the allocated GDT selector, when KEE_VMA_GETSEL is set.  
        allocate memory in the process address space.  
    KEE_VMA_SGSCONT
        register memory under screen group control  
     KEE_VMA_GETSEL
        return a GDT selector for the allocated memory. This option exists also in DevHlp_VMAlloc (undocumented).  
    KEE_VMA_RESERVE
        Don't commit the allocated memory.  
     KEE_VMA_SHARED
        allocate memory that is shareable  
    KEE_VMA_USEHIGHMEM
        allocate memory from above 16MB.  
 
linaddr
    address of a variable to receive the linear address of the memory.  
physaddr
    address of a variable that contains the physical address of the memory.  
sel
    address of a variable to receive the allocated GDT selector, when KEE_VMA_GETSEL is set.  


[[Category:The OS/2 API Project]]
[[Category:The OS/2 API Project]]

Revision as of 00:42, 27 February 2017

This is the equivalent of the DevHlp_VMAlloc function.

Synopsis

APIRET APIENTRY KernVMAlloc(ULONG size, ULONG flags, PVOID* linaddr, PVOID* physaddr, PSHORT sel);

Parameters

size
Number of bytes to allocate.
flags
One or more of the following flags. See DevHlp_VMAlloc docs for details.
KEE_VMA_16MB       allocate memory from below 16MB 
KEE_VMA_FIXED      allocate memory that won't be swapped out 
KEE_VMA_SWAP       allocate memory that is swappable 
KEE_VMA_CONTIG     allocate contiguous physical memory pages 
KEE_VMA_PHYS       allocate physical memory (pass address in physaddr argument) 
KEE_VMA_PROCESS    allocate memory in the process address space. 
KEE_VMA_SGSCONT    register memory under screen group control 
KEE_VMA_GETSEL     return a GDT selector for the allocated memory.
                   This option exists also in DevHlp_VMAlloc (undocumented). 
KEE_VMA_RESERVE    Don't commit the allocated memory. 
KEE_VMA_SHARED     allocate memory that is shareable 
KEE_VMA_USEHIGHMEM allocate memory from above 16MB. 
linaddr
address of a variable to receive the linear address of the memory.
physaddr
address of a variable that contains the physical address of the memory.
sel
address of a variable to receive the allocated GDT selector, when KEE_VMA_GETSEL is set.