u-boot-brain/lib/efi_loader
Stefan Brüns 42417bc84d efi_loader: Track size of pool allocations to allow freeing
We need a functional free_pool implementation, as otherwise each
allocate_pool causes growth of the memory descriptor table.

Different to free_pages, free_pool does not provide the size for the
to be freed allocation, thus we have to track the size ourselves.

As the only EFI requirement for pool allocation is an alignment of
8 bytes, we can keep allocating a range using the page allocator,
reserve the first 8 bytes for our bookkeeping and hand out the
remainder to the caller. This saves us from having to use any
independent data structures for tracking.

To simplify the conversion between pool allocations and the corresponding
page allocation, we create an auxiliary struct efi_pool_allocation.

Given the allocation size free_pool size can handoff freeing the page
range, which was indirectly allocated by a call to allocate_pool,
to free_pages.

Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
Reviewed-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
2016-10-18 09:08:07 +02:00
..
efi_boottime.c efi_loader: Track size of pool allocations to allow freeing 2016-10-18 09:08:07 +02:00
efi_console.c efi_loader: Add console interface 2016-03-15 18:03:09 -04:00
efi_disk.c efi_loader: disk: Sanitize exposed devices 2016-08-08 13:33:00 -04:00
efi_gop.c efi_loader: Add DM_VIDEO support 2016-06-06 13:39:17 -04:00
efi_image_loader.c efi_loader: Fix relocations above 64kb image size 2016-08-20 14:03:27 -04:00
efi_memory.c efi_loader: Track size of pool allocations to allow freeing 2016-10-18 09:08:07 +02:00
efi_net.c efi_loader: Add network access support 2016-05-27 10:01:10 -04:00
efi_runtime.c efi_loader: Move to normal debug infrastructure 2016-06-06 13:39:16 -04:00
Kconfig efi_loader: Add bounce buffer support 2016-05-27 15:39:48 -04:00
Makefile efi_loader: Add network access support 2016-05-27 10:01:10 -04:00