diff options
author | Ard Biesheuvel <ardb@kernel.org> | 2020-02-17 14:44:37 +0300 |
---|---|---|
committer | Ard Biesheuvel <ardb@kernel.org> | 2020-02-23 01:37:37 +0300 |
commit | 9f9223778ef385e79dc67f5ee48ee4c1fb757f6b (patch) | |
tree | 82aab113bd4467d603dc317435832205ac1e7c74 /drivers/firmware/efi/libstub/arm64-stub.c | |
parent | e951a1f427f2312e17b4e0f485e60068ca1423bb (diff) | |
download | linux-9f9223778ef385e79dc67f5ee48ee4c1fb757f6b.tar.xz |
efi/libstub/arm: Make efi_entry() an ordinary PE/COFF entrypoint
Expose efi_entry() as the PE/COFF entrypoint directly, instead of
jumping into a wrapper that fiddles with stack buffers and other
stuff that the compiler is much better at. The only reason this
code exists is to obtain a pointer to the base of the image, but
we can get the same value from the loaded_image protocol, which
we already need for other reasons anyway.
Update the return type as well, to make it consistent with what
is required for a PE/COFF executable entrypoint.
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Diffstat (limited to 'drivers/firmware/efi/libstub/arm64-stub.c')
-rw-r--r-- | drivers/firmware/efi/libstub/arm64-stub.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/firmware/efi/libstub/arm64-stub.c b/drivers/firmware/efi/libstub/arm64-stub.c index 2915b44132e6..ad5f24a4489b 100644 --- a/drivers/firmware/efi/libstub/arm64-stub.c +++ b/drivers/firmware/efi/libstub/arm64-stub.c @@ -49,7 +49,6 @@ efi_status_t handle_kernel_image(unsigned long *image_addr, { efi_status_t status; unsigned long kernel_size, kernel_memsize = 0; - void *old_image_addr = (void *)*image_addr; unsigned long preferred_offset; u64 phys_seed = 0; @@ -147,7 +146,7 @@ efi_status_t handle_kernel_image(unsigned long *image_addr, } *image_addr = *reserve_addr + TEXT_OFFSET; } - memcpy((void *)*image_addr, old_image_addr, kernel_size); + memcpy((void *)*image_addr, image->image_base, kernel_size); return EFI_SUCCESS; } |