[PATCH v2 05/28] efi_loader: Show the resulting memory address from an alloc

Heinrich Schuchardt xypron.glpk at gmx.de
Thu Nov 28 17:26:12 CET 2024


On 28.11.24 16:47, Simon Glass wrote:
> Update efi_allocate_pool_ext() to log the pointer returned from this
> call, which can be helpful when debugging.
>
> Signed-off-by: Simon Glass <sjg at chromium.org>
> ---
>
> Changes in v2:
> - Use EFI_PRINT() instead of log_debug()
>
>   lib/efi_loader/efi_boottime.c | 3 +++
>   1 file changed, 3 insertions(+)
>
> diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c
> index 080e7f78ae3..be8e4f41ad2 100644
> --- a/lib/efi_loader/efi_boottime.c
> +++ b/lib/efi_loader/efi_boottime.c
> @@ -511,6 +511,9 @@ static efi_status_t EFIAPI efi_allocate_pool_ext(int pool_type,
>
>   	EFI_ENTRY("%d, %zu, %p", pool_type, size, buffer);
>   	r = efi_allocate_pool(pool_type, size, buffer);
> +	if (r == EFI_SUCCESS)
> +		EFI_PRINT("*buffer = %p\n", *buffer);

The UEFI spec provides:

typedef UINT64 EFI_PHYSICAL_ADDRESS;

typedef
EFI_STATUS
(EFIAPI *EFI_ALLOCATE_PAGES) (
IN EFI_ALLOCATE_TYPE Type,
IN EFI_MEMORY_TYPE MemoryType,
IN UINTN Pages,
IN OUT EFI_PHYSICAL_ADDRESS *Memory
);

%p does not match u64.

Best regards

Heinrich

> +
>   	return EFI_EXIT(r);
>   }
>




More information about the U-Boot mailing list