Services
Version 1.02 12/12/00 47
Description
The AllocatePages() function allocates the requested number of pages and returns a pointer
to the base address of the page range in the location referenced by Memory. The function scans the
memory map to locate free pages. When it finds a physically contiguous block of pages that is
large enough and also satisfies the value of Type, it changes the memory map to indicate that the
pages are now of type MemoryType.
In general, EFI OS loaders and EFI applications should allocate memory (and pool) of type
EfiLoaderData. Boot service drivers must allocate memory (and pool) of type
EfiBootServicesData. Runtime drivers should allocate memory (and pool) of type
EfiRuntimeServicesData (although such allocation can only be made during boot services
time).
Allocation requests of Type AllocateAnyPages allocate any available range of pages that
satisfies the request. On input, the address pointed to by Memory is ignored.
Allocation requests of Type AllocateMaxAddress allocate any available range of pages
whose uppermost address is less than or equal to the address pointed to by Memory on input.
Allocation requests of Type AllocateAddress allocate pages at the address pointed to by
Memory on input.
Status Codes Returned
EFI_SUCCESS The requested pages were allocated.
EFI_OUT_OF_RESOURCES The pages could not be allocated.
EFI_INVALID_PARAMETER One of the parameters has an invalid value.