Skip to content

Commit 1df45f8

Browse files
Song Shuaipalmer-dabbelt
authored andcommitted
riscv: kexec_file: Split the loading of kernel and others
This is the preparative patch for kexec_file_load Image support. It separates the elf_kexec_load() as two parts: - the first part loads the vmlinux (or Image) - the second part loads other segments (e.g. initrd,fdt,purgatory) And the second part is exported as the load_extra_segments() function which would be used in both kexec-elf.c and kexec-image.c. No functional change intended. Signed-off-by: Song Shuai <[email protected]> Signed-off-by: Björn Töpel <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Ghiti <[email protected]> Signed-off-by: Palmer Dabbelt <[email protected]>
1 parent 9c32cda commit 1df45f8

File tree

5 files changed

+510
-486
lines changed

5 files changed

+510
-486
lines changed

arch/riscv/include/asm/kexec.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,11 @@ int arch_kexec_apply_relocations_add(struct purgatory_info *pi,
6767
struct kimage;
6868
int arch_kimage_file_post_load_cleanup(struct kimage *image);
6969
#define arch_kimage_file_post_load_cleanup arch_kimage_file_post_load_cleanup
70+
71+
int load_extra_segments(struct kimage *image, unsigned long kernel_start,
72+
unsigned long kernel_len, char *initrd,
73+
unsigned long initrd_len, char *cmdline,
74+
unsigned long cmdline_len);
7075
#endif
7176

7277
#endif

arch/riscv/kernel/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ obj-$(CONFIG_HOTPLUG_CPU) += cpu-hotplug.o
107107
obj-$(CONFIG_PARAVIRT) += paravirt.o
108108
obj-$(CONFIG_KGDB) += kgdb.o
109109
obj-$(CONFIG_KEXEC_CORE) += kexec_relocate.o crash_save_regs.o machine_kexec.o
110-
obj-$(CONFIG_KEXEC_FILE) += elf_kexec.o machine_kexec_file.o
110+
obj-$(CONFIG_KEXEC_FILE) += kexec_elf.o machine_kexec_file.o
111111
obj-$(CONFIG_CRASH_DUMP) += crash_dump.o
112112
obj-$(CONFIG_VMCORE_INFO) += vmcore_info.o
113113

0 commit comments

Comments
 (0)