
From: Simon Glass <sjg@chromium.org> The device-path code requires memory allocation. Provide an implementation of these for use by the client. Note that this will not work for the stub, since in that case it needs to use U-Boot's memory allocation. This was a subject of a long argument on the mailing list about U-Boot using its own malloc() where possible, so it seems best to just leave this broken. Signed-off-by: Simon Glass <sjg@chromium.org> --- lib/efi_client/efi.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/lib/efi_client/efi.c b/lib/efi_client/efi.c index 6b1b6b10e2a..86856014c3e 100644 --- a/lib/efi_client/efi.c +++ b/lib/efi_client/efi.c @@ -172,6 +172,21 @@ void efi_free(struct efi_priv *priv, void *ptr) boot->free_pool(ptr); } +void *efi_alloc(size_t size) +{ + struct efi_priv *priv = efi_get_priv(); + efi_status_t ret; + + return efi_malloc(priv, size, &ret); +} + +void efi_free_pool(void *ptr) +{ + struct efi_priv *priv = efi_get_priv(); + + efi_free(priv, ptr); +} + int efi_store_memory_map(struct efi_priv *priv) { struct efi_boot_services *boot = priv->sys_table->boottime; -- 2.43.0