aboutsummaryrefslogtreecommitdiff
path: root/drivers/firmware/efi/libstub/alignedmem.c
AgeCommit message (Collapse)AuthorFilesLines
2020-07-09efi/libstub: Fix gcc error around __umoddi3 for 32 bit buildsAtish Patra1-1/+1
32bit gcc doesn't support modulo operation on 64 bit data. It results in a __umoddi3 error while building EFI for 32 bit. Use bitwise operations instead of modulo operations to fix the issue. Signed-off-by: Atish Patra <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Ard Biesheuvel <[email protected]>
2020-04-24efi/libstub: Add API function to allocate aligned memoryArd Biesheuvel1-0/+57
Break out the code to create an aligned page allocation from mem.c and move it into a function efi_allocate_pages_aligned() in alignedmem.c. Update efi_allocate_pages() to invoke it unless the minimum alignment equals the EFI page size (4 KB), in which case the ordinary page allocator is sufficient. This way, efi_allocate_pages_aligned() will only be pulled into the build if it is actually being used (which will be on arm64 only in the immediate future) Signed-off-by: Ard Biesheuvel <[email protected]>