Extensible Firmware Interface Specification
3.2
Memory Allocation Services
The functions that make up Memory Allocation Services are used during pre-boot to allocate and
free memory, and to obtain the system's memory map. See Table 3-4.
Table 3-4.
Memory Allocation Functions
Name
AllocatePages
FreePages
GetMemoryMap
AllocatePool
FreePool
The way in which these functions are used is directly related to an important feature of EFI memory
design. This feature, which stipulates that EFI firmware owns the system's memory map during
pre-boot, has three major consequences:
1. During pre-boot, all components (including executing EFI images) must cooperate with the
firmware by allocating and freeing memory from the system with the functions
AllocatePages(), AllocatePool(), FreePages(), and FreePool(). The
firmware dynamically maintains the memory map as these functions are called.
2. During pre-boot, an executing EFI Image must only use the memory it has allocated.
3. Before an executing EFI image exits and returns control to the firmware, it must free all
resources it has explicitly allocated. This includes all memory pages, pool allocations, open file
handles, etc. Memory allocated by the firmware to load an image is freed by the firmware
when the image is unloaded.
When EFI memory is allocated, it is "typed" according to the values in
Section 3.2.1). Some of the types have a different usage before
than they do afterwards. Table 3-5 lists each type and its usage before the call; Table 3-6 lists each
type and its usage after the call.
42
Type
Description
Boot
Allocates pages of a particular type.
Boot
Frees allocated pages.
Boot
Returns the current boot services memory map and memory map key.
Boot
Allocates a pool of a particular type.
Boot
Frees allocated pool.
12/12/00
EFI_MEMORY_TYPE
ExitBootServices()
Version 1.02
(see
is called
Need help?
Do you have a question about the Extensible Firmware Interface and is the answer not in the manual?