From ead1274b7f9578e346b3cdcb3d9e2002ef8f0e75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Br=C3=BCns?= Date: Sun, 9 Oct 2016 22:17:18 +0200 Subject: efi_loader: Move efi_allocate_pool implementation to efi_memory.c MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We currently handle efi_allocate_pool() in our boot time service file. In the following patch, pool allocation will receive additional internal semantics that we should preserve inside efi_memory.c instead. As foundation for those changes, split the function into an externally facing efi_allocate_pool_ext() for use by payloads and an internal helper efi_allocate_pool() in efi_memory.c that handles the actual allocation. While at it, change the magic 0xfff / 12 constants to the more obvious EFI_PAGE_MASK/SHIFT defines. Signed-off-by: Stefan BrĂ¼ns Reviewed-by: Alexander Graf Signed-off-by: Alexander Graf --- include/efi_loader.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include') diff --git a/include/efi_loader.h b/include/efi_loader.h index 97388350eb9..f0473aba7cd 100644 --- a/include/efi_loader.h +++ b/include/efi_loader.h @@ -119,6 +119,9 @@ efi_status_t efi_allocate_pages(int type, int memory_type, unsigned long pages, uint64_t *memory); /* EFI memory free function. Not implemented today */ efi_status_t efi_free_pages(uint64_t memory, unsigned long pages); +/* EFI memory allocator for small allocations */ +efi_status_t efi_allocate_pool(int pool_type, unsigned long size, + void **buffer); /* Returns the EFI memory map */ efi_status_t efi_get_memory_map(unsigned long *memory_map_size, struct efi_mem_desc *memory_map, -- cgit v1.2.3