lkml.org 
[lkml]   [2020]   [Jun]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[RFC PATCH 01/11] efi: Fix gcc error around __umoddi3 for 32 bit builds
    Date
    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 <atish.patra@wdc.com>
    ---
    drivers/firmware/efi/libstub/alignedmem.c | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    diff --git a/drivers/firmware/efi/libstub/alignedmem.c b/drivers/firmware/efi/libstub/alignedmem.c
    index cc89c4d6196f..1de9878ddd3a 100644
    --- a/drivers/firmware/efi/libstub/alignedmem.c
    +++ b/drivers/firmware/efi/libstub/alignedmem.c
    @@ -44,7 +44,7 @@ efi_status_t efi_allocate_pages_aligned(unsigned long size, unsigned long *addr,
    *addr = ALIGN((unsigned long)alloc_addr, align);

    if (slack > 0) {
    - int l = (alloc_addr % align) / EFI_PAGE_SIZE;
    + int l = (alloc_addr & (align - 1)) / EFI_PAGE_SIZE;

    if (l) {
    efi_bs_call(free_pages, alloc_addr, slack - l + 1);
    --
    2.24.0
    \
     
     \ /
      Last update: 2020-06-26 01:46    [W:4.742 / U:0.244 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site