52 unsigned int new_pages, old_pages;
67 &phys_addr ) ) != 0 ) {
69 DBG (
"EFI could not allocate %d pages: %s\n",
77 DBG (
"EFI allocated %d pages at %llx\n",
78 new_pages, phys_addr );
86 if ( old_ptr && ( old_ptr !=
NOWHERE ) ) {
90 ( (old_size < new_size) ? old_size : new_size ) );
93 if ( ( efirc = bs->
FreePages ( phys_addr, old_pages ) ) != 0 ){
95 DBG (
"EFI could not free %d pages at %llx: %s\n",
101 DBG (
"EFI freed %d pages at %llx\n", old_pages, phys_addr );
static void * efi_urealloc(void *old_ptr, size_t new_size)
Reallocate external memory.
EFI_BOOT_SERVICES * BootServices
A pointer to the EFI Boot Services Table.
struct arbelprm_rc_send_wqe rc
#define NOWHERE
Address for zero-length memory blocks.
#define EEFI(efirc)
Convert an EFI status code to an iPXE status code.
UINT64 EFI_PHYSICAL_ADDRESS
64-bit physical memory address.
void * memcpy(void *dest, const void *src, size_t len) __nonnull
PROVIDE_UMALLOC(efi, urealloc, efi_urealloc)
assert((readw(&hdr->flags) &(GTF_reading|GTF_writing))==0)
Access to external ("user") memory.
char * strerror(int errno)
Retrieve string representation of error number.
#define EFI_SIZE_TO_PAGES(Size)
Macro that converts a size, in bytes, to a number of EFI_PAGESs.
EFI_ALLOCATE_PAGES AllocatePages
RETURN_STATUS EFI_STATUS
Function return status for EFI API.
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
Allocate any available range of pages that satisfies the request.
EFI_SYSTEM_TABLE * efi_systab
void * urealloc(void *ptr, size_t new_size)
Reallocate external memory.
The data portions of a loaded Boot Serves Driver, and the default data allocation type used by a Boot...
#define DBG(...)
Print a debugging message.
#define NULL
NULL pointer (VOID *)