Skip to content

Commit a43cac0

Browse files
daveyoungtorvalds
authored andcommitted
kexec: split kexec_file syscall code to kexec_file.c
Split kexec_file syscall related code to another file kernel/kexec_file.c so that the #ifdef CONFIG_KEXEC_FILE in kexec.c can be dropped. Sharing variables and functions are moved to kernel/kexec_internal.h per suggestion from Vivek and Petr. [akpm@linux-foundation.org: fix bisectability] [akpm@linux-foundation.org: declare the various arch_kexec functions] [akpm@linux-foundation.org: fix build] Signed-off-by: Dave Young <dyoung@redhat.com> Cc: Eric W. Biederman <ebiederm@xmission.com> Cc: Vivek Goyal <vgoyal@redhat.com> Cc: Petr Tesarik <ptesarik@suse.cz> Cc: Theodore Ts'o <tytso@mit.edu> Cc: Josh Boyer <jwboyer@fedoraproject.org> Cc: David Howells <dhowells@redhat.com> Cc: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent a202fbb commit a43cac0

File tree

5 files changed

+1090
-1045
lines changed

5 files changed

+1090
-1045
lines changed

include/linux/kexec.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,17 @@ int crash_shrink_memory(unsigned long new_size);
318318
size_t crash_get_memory_size(void);
319319
void crash_free_reserved_phys_range(unsigned long begin, unsigned long end);
320320

321+
int __weak arch_kexec_kernel_image_probe(struct kimage *image, void *buf,
322+
unsigned long buf_len);
323+
void * __weak arch_kexec_kernel_image_load(struct kimage *image);
324+
int __weak arch_kimage_file_post_load_cleanup(struct kimage *image);
325+
int __weak arch_kexec_kernel_verify_sig(struct kimage *image, void *buf,
326+
unsigned long buf_len);
327+
int __weak arch_kexec_apply_relocations_add(const Elf_Ehdr *ehdr,
328+
Elf_Shdr *sechdrs, unsigned int relsec);
329+
int __weak arch_kexec_apply_relocations(const Elf_Ehdr *ehdr, Elf_Shdr *sechdrs,
330+
unsigned int relsec);
331+
321332
#else /* !CONFIG_KEXEC */
322333
struct pt_regs;
323334
struct task_struct;

kernel/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ obj-$(CONFIG_MODULE_SIG) += module_signing.o
5050
obj-$(CONFIG_KALLSYMS) += kallsyms.o
5151
obj-$(CONFIG_BSD_PROCESS_ACCT) += acct.o
5252
obj-$(CONFIG_KEXEC) += kexec.o
53+
obj-$(CONFIG_KEXEC_FILE) += kexec_file.o
5354
obj-$(CONFIG_BACKTRACE_SELF_TEST) += backtracetest.o
5455
obj-$(CONFIG_COMPAT) += compat.o
5556
obj-$(CONFIG_CGROUPS) += cgroup.o

0 commit comments

Comments
 (0)