mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-03-31 19:41:46 +00:00
efi_loader: make pool allocations cacheline aligned
This avoids printf() spam about file reads (such as loading an image) into unaligned buffers (and the associated memcpy()). And generally seems like a good idea. Signed-off-by: Rob Clark <robdclark@gmail.com> [agraf: use __aligned] Signed-off-by: Alexander Graf <agraf@suse.de>
This commit is contained in:
parent
838ee4b479
commit
946160f334
1 changed files with 3 additions and 2 deletions
|
@ -43,7 +43,7 @@ void *efi_bounce_buffer;
|
||||||
*/
|
*/
|
||||||
struct efi_pool_allocation {
|
struct efi_pool_allocation {
|
||||||
u64 num_pages;
|
u64 num_pages;
|
||||||
char data[];
|
char data[] __aligned(ARCH_DMA_MINALIGN);
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -356,7 +356,8 @@ efi_status_t efi_allocate_pool(int pool_type, unsigned long size,
|
||||||
{
|
{
|
||||||
efi_status_t r;
|
efi_status_t r;
|
||||||
efi_physical_addr_t t;
|
efi_physical_addr_t t;
|
||||||
u64 num_pages = (size + sizeof(u64) + EFI_PAGE_MASK) >> EFI_PAGE_SHIFT;
|
u64 num_pages = (size + sizeof(struct efi_pool_allocation) +
|
||||||
|
EFI_PAGE_MASK) >> EFI_PAGE_SHIFT;
|
||||||
|
|
||||||
if (size == 0) {
|
if (size == 0) {
|
||||||
*buffer = NULL;
|
*buffer = NULL;
|
||||||
|
|
Loading…
Add table
Reference in a new issue