53 unsigned int new_pages, old_pages;
68 &phys_addr ) ) != 0 ) {
70 DBG (
"EFI could not allocate %d pages: %s\n",
78 DBG (
"EFI allocated %d pages at %llx\n",
79 new_pages, phys_addr );
87 if ( old_ptr && ( old_ptr !=
NOWHERE ) ) {
91 ( (old_size < new_size) ? old_size : new_size ) );
94 if ( ( efirc = bs->
FreePages ( phys_addr, old_pages ) ) != 0 ){
96 DBG (
"EFI could not free %d pages at %llx: %s\n",
102 DBG (
"EFI freed %d pages at %llx\n", old_pages, phys_addr );
#define NULL
NULL pointer (VOID *)
UINT64 EFI_PHYSICAL_ADDRESS
64-bit physical memory address.
RETURN_STATUS EFI_STATUS
Function return status for EFI API.
#define EFI_SIZE_TO_PAGES(Size)
Macro that converts a size, in bytes, to a number of EFI_PAGESs.
@ EfiBootServicesData
The data portions of a loaded Boot Serves Driver, and the default data allocation type used by a Boot...
@ AllocateAnyPages
Allocate any available range of pages that satisfies the request.
struct arbelprm_rc_send_wqe rc
#define assert(condition)
Assert a condition at run-time.
static void * efi_urealloc(void *old_ptr, size_t new_size)
Reallocate external memory.
#define DBG(...)
Print a debugging message.
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
#define FILE_SECBOOT(_status)
Declare a file's UEFI Secure Boot permission status.
#define EEFI(efirc)
Convert an EFI status code to an iPXE status code.
EFI_SYSTEM_TABLE * efi_systab
void * urealloc(void *ptr, size_t new_size)
Reallocate external memory.
#define PROVIDE_UMALLOC(_subsys, _api_func, _func)
Provide a user memory allocation API implementation.
void * memcpy(void *dest, const void *src, size_t len) __nonnull
Access to external ("user") memory.
#define NOWHERE
Address for zero-length memory blocks.
char * strerror(int errno)
Retrieve string representation of error number.
EFI_ALLOCATE_PAGES AllocatePages