OSDN Git Service

RISC-V: Add PE/COFF header for EFI stub
authorAtish Patra <atish.patra@wdc.com>
Thu, 17 Sep 2020 22:37:13 +0000 (15:37 -0700)
committerPalmer Dabbelt <palmerdabbelt@google.com>
Fri, 2 Oct 2020 21:31:16 +0000 (14:31 -0700)
commitcb7d2dd5612a77a2597c00fce770a52c921e2ea5
tree99d82b1126b5fd909e0253276e827a946a0daefd
parente8dcb61f2ade040a372d66907d220dd3fdee2505
RISC-V: Add PE/COFF header for EFI stub

Linux kernel Image can appear as an EFI application With appropriate
PE/COFF header fields in the beginning of the Image header. An EFI
application loader can directly load a Linux kernel Image and an EFI
stub residing in kernel can boot Linux kernel directly.

Add the necessary PE/COFF header.

Signed-off-by: Atish Patra <atish.patra@wdc.com>
Link: https://lore.kernel.org/r/20200421033336.9663-3-atish.patra@wdc.com
[ardb: - use C prefix for c.li to ensure the expected opcode is emitted
       - align all image sections according to PE/COFF section alignment ]
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Reviewed-by: Anup Patel <anup@brainfault.org>
Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
arch/riscv/include/asm/sections.h [new file with mode: 0644]
arch/riscv/kernel/efi-header.S [new file with mode: 0644]
arch/riscv/kernel/head.S
arch/riscv/kernel/image-vars.h [new file with mode: 0644]
arch/riscv/kernel/vmlinux.lds.S