Jump to content

PSDHLP VMALLOC: Difference between revisions

From EDM2
Created page with "Allocate memory. This function is used to allocate virtual memory, or map virtual memory to physical memory, depending on the value of the flags. All virtual addresses are al..."
 
No edit summary
 
Line 1: Line 1:
{{DISPLAYTITLE:PSDHLP_VMALLOC}}
Allocate memory.
Allocate memory.



Latest revision as of 02:45, 20 May 2025

Allocate memory.

This function is used to allocate virtual memory, or map virtual memory to physical memory, depending on the value of the flags. All virtual addresses are allocated from the system arena (i.e. global address space).

Mode
Callable in Init and Kernel mode.

Syntax

PSDHLP_VMALLOC <keywords>

Parameters

Pointer to a VMALLOC structure.

  ulong_t addr;    (Input/Output)
  ulong_t cbsize;  (Input)
  ulong_t flags;   (Input)
addr
is filled with the linear address of the allocated or mapped memory on return from the help.
If VMALLOC_LOCSPECIFIC is specified, this field must contain the virtual address to map before calling the help.
If VMALLOC_PHYS is specified, this field must contain the physical address to map before calling the help.
cbsize
is the size of the allocation, or mapping in bytes.
flags
indicate which type of operation is to be performed.
VMALLOC_FIXED indicates that the allocated memory is to be fixed in memory (not-swappable or movable). If this flag is omitted, the allocated memory will be swappable by default.
VMALLOC_CONTIG indicates that the allocation must use contigous physical memory. If this flag is specified VMALLOC_FIXED must also be used.
VMALLOC_LOCSPECIFIC indicates a request for a memory allocation at a specific virtual address. If this flag is specified, the addr field must contain the virtual address to map.
Note: This flag can be used with the VMALLOC_PHYS flag to allocate memory where linear = physical.
VMALLOC_PHYS indicates a request for a virtual mapping of physical memory. If this flag is specified, the addr field must contain the physical address to map.
Note: This flag can be used with the VMALLOC_LOCSPECIFIC flag to allocate memory where linear = physical.
VMALLOC_1M indicates a request for a memory allocation below the 1MB boundary.

Return Code

Return code.

Remarks

The function can call a PSD help that may block.

Structure

typedef struct vmalloc_s {
   ulong_t addr;    (Input/Output)
   ulong_t cbsize;  (Input)
   ulong_t flags;   (Input)
} VMALLOC;