summaryrefslogtreecommitdiff
path: root/include/efi_loader.h
diff options
context:
space:
mode:
authorYing-Chun Liu (PaulLiu) <paul.liu@linaro.org>2025-07-03 07:28:09 +0100
committerIlias Apalodimas <ilias.apalodimas@linaro.org>2025-07-03 12:25:56 +0300
commit3c08df58cc43c3ae8ec378ab0e32cfe548313c39 (patch)
treeb894f1004498d9913ce44e29e10b31656fc20057 /include/efi_loader.h
parente7a85ec651ed5794eb9a837e1073f6b3146af501 (diff)
lib: efi_loader: efi_memory.c: add efi_realloc() for realloc memory
Add efi_realloc() for realloc memory that previously alloc by efi_alloc(). Note that if realloced memory is explicitly allocated as BootServicesData. Cc: Heinrich Schuchardt <xypron.glpk@gmx.de> Cc: Ilias Apalodimas <ilias.apalodimas@linaro.org> Cc: Peter Robinson <pbrobinson@gmail.com> Cc: Simon Glass <sjg@chromium.org> Signed-off-by: Ying-Chun Liu (PaulLiu) <paul.liu@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Diffstat (limited to 'include/efi_loader.h')
-rw-r--r--include/efi_loader.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/efi_loader.h b/include/efi_loader.h
index c02bc1b7ef4..b60ea58d71f 100644
--- a/include/efi_loader.h
+++ b/include/efi_loader.h
@@ -875,6 +875,16 @@ efi_status_t efi_next_variable_name(efi_uintn_t *size, u16 **buf,
#define efi_size_in_pages(size) (((size) + EFI_PAGE_MASK) >> EFI_PAGE_SHIFT)
/* Allocate boot service data pool memory */
void *efi_alloc(size_t len);
+/**
+ * efi_realloc() - reallocate boot services data pool memory
+ *
+ * Reallocate memory from pool for a new size and copy the data from old one.
+ *
+ * @ptr: pointer to the buffer
+ * @size: number of bytes to allocate
+ * Return: EFI status to indicate success or not
+ */
+efi_status_t efi_realloc(void **ptr, size_t len);
/* Allocate pages on the specified alignment */
void *efi_alloc_aligned_pages(u64 len, int memory_type, size_t align);
/* More specific EFI memory allocator, called by EFI payloads */