Export kexec.h
Subsystems (17)
PATCH 1/1 Export kexec.h
Export kexec.h
kexec_load is a system call and it needs a header
file with its input arguments.
Export the parts of kexec.h needed for this.
include/linux/Kbuild +2 -0
@@ -389,3 +389,5 @@ unifdef-y += xfrm.h objhdr-y += version.h header-y += wimax.h header-y += wimax/ + +unifdef-y += kexec.h
include/linux/kexec.h +40 -28
91 lines not on this page · raw message
RFC 1/1 use kexec_kernel.h for the kernel-only stuff [Was: [PATCH] Export kexec.h]
Quoted 6 lines · Andi Kleen
Export
kexec.h
kexec_loadis a system call and it needs a header
file with its input arguments.Export the parts of
kexec.hneeded for this.
Rather than introducing yet another file where
only a fraction is exported how about a split
where we put the kernel specific definitions in kexec_kernel.h. And kexec.h is the userspace interface (which is included by kexec_kernel.h).
We did it like this for pps some time ago.
Patch is trivial - appended below.
Sam
Quoted 1 line
From
2a560e5dbf4774a97db671f2d2813e02fb007ad8Mon Sep 17 00:00:00 2001
From: Sam Ravnborg <[email protected]>
Date: Sat, 19 Jun 2010 20:11:59 +0200
Subject: [PATCH] kexec: export kexec.h to userspace
kexec_load is a system call and it needs a header
file with its input arguments.
Split kexec.h in two parts:kexec.h - the userspace visible definitionskexec_kernel.h - the kernel definitions
Fix up all files that include kexec.h to include kexec_kernel.h In a few cases an unused include was dropped.
--- MAINTAINERS | 1 + arch/arm/kernel/machine_kexec.c | 2 +- arch/arm/kernel/traps.c | 2 +- arch/ia64/kernel/crash.c | 2 +- arch/ia64/kernel/efi.c | 2 +- arch/ia64/kernel/machine_kexec.c | 2 +- arch/ia64/kernel/setup.c | 2 +- arch/ia64/kernel/smp.c | 2 +- arch/ia64/mm/init.c | 2 +- arch/microblaze/kernel/prom.c | 2 +- arch/mips/kernel/machine_kexec.c | 2 +- arch/powerpc/kernel/crash.c | 2 +- arch/powerpc/kernel/machine_kexec.c | 2 +- arch/powerpc/kernel/machine_kexec_32.c | 2 +- arch/powerpc/kernel/machine_kexec_64.c | 2 +- arch/powerpc/kernel/prom.c | 2 +- arch/powerpc/kernel/traps.c | 2 +- arch/powerpc/platforms/cell/ras.c | 2 +- arch/powerpc/platforms/embedded6xx/gamecube.c | 2 +- arch/powerpc/platforms/embedded6xx/wii.c | 2 +- arch/powerpc/platforms/iseries/setup.c | 2 +- arch/s390/kernel/crash.c | 2 +- arch/s390/kernel/machine_kexec.c | 2 +- arch/sh/kernel/machine_kexec.c | 2 +- arch/sh/kernel/reboot.c | 2 +- arch/sh/kernel/setup.c | 2 +- arch/sh/kernel/traps_32.c | 2 +- arch/x86/kernel/crash.c | 2 +- arch/x86/kernel/dumpstack.c | 2 +- arch/x86/kernel/dumpstack_32.c | 1 - arch/x86/kernel/dumpstack_64.c | 1 - arch/x86/kernel/machine_kexec_32.c | 2 +- arch/x86/kernel/machine_kexec_64.c | 2 +- arch/x86/kernel/setup.c | 2 +- arch/x86/kernel/setup_percpu.c | 1 - arch/x86/kernel/traps.c | 1 - arch/x86/mm/numa_32.c | 1 - drivers/base/cpu.c | 2 +- include/linux/Kbuild | 1 + include/linux/crash_dump.h | 1 - include/linux/kexec.h | 200 ++----------------------- include/linux/kexec_kernel.h | 193 ++++++++++++++++++++++++ init/initramfs.c | 2 +- kernel/kexec.c | 2 +- kernel/ksysfs.c | 2 +- kernel/panic.c | 2 +- kernel/printk.c | 2 +- kernel/sys.c | 2 +- 48 files changed, 243 insertions(+), 234 deletions(-) create mode 100644 include/linux/kexec_kernel.h
MAINTAINERS +1 -0
@@ -3326,6 +3326,7 @@ W: http://ftp.kernel.org/pub/linux/kernel/people/horms/kexec-tools/ L: [email protected] S: Maintained F: include/linux/kexec.h +F: include/linux/kexec_kernel.h F: kernel/kexec.c KEYS/KEYRINGS:
arch/arm/kernel/machine_kexec.c +1 -1
@@ -3,7 +3,7 @@*/ #include <linux/mm.h> -#include <linux/kexec.h> +#include <linux/kexec_kernel.h> #include <linux/delay.h> #include <linux/reboot.h> #include <linux/io.h>
arch/arm/kernel/traps.c +1 -1
@@ -20,7 +20,7 @@#include <linux/hardirq.h> #include <linux/kdebug.h> #include <linux/module.h> -#include <linux/kexec.h> +#include <linux/kexec_kernel.h> #include <linux/delay.h> #include <linux/init.h>
arch/ia64/kernel/crash.c +1 -1
@@ -12,7 +12,7 @@#include <linux/delay.h> #include <linux/crash_dump.h> #include <linux/bootmem.h> -#include <linux/kexec.h> +#include <linux/kexec_kernel.h> #include <linux/elfcore.h> #include <linux/sysctl.h> #include <linux/init.h>
arch/ia64/kernel/efi.c +1 -1
@@ -29,7 +29,7 @@#include <linux/slab.h> #include <linux/time.h> #include <linux/efi.h> -#include <linux/kexec.h> +#include <linux/kexec_kernel.h> #include <linux/mm.h> #include <asm/io.h>
arch/ia64/kernel/machine_kexec.c +1 -1
@@ -11,7 +11,7 @@*/ #include <linux/mm.h> -#include <linux/kexec.h> +#include <linux/kexec_kernel.h> #include <linux/cpu.h> #include <linux/irq.h> #include <linux/efi.h>
arch/ia64/kernel/setup.c +1 -1
@@ -43,7 +43,7 @@#include <linux/initrd.h> #include <linux/pm.h> #include <linux/cpufreq.h> -#include <linux/kexec.h> +#include <linux/kexec_kernel.h> #include <linux/crash_dump.h> #include <asm/machvec.h>
arch/ia64/kernel/smp.c +1 -1
@@ -30,7 +30,7 @@#include <linux/delay.h> #include <linux/efi.h> #include <linux/bitops.h> -#include <linux/kexec.h> +#include <linux/kexec_kernel.h> #include <asm/atomic.h> #include <asm/current.h>
arch/ia64/mm/init.c +1 -1
@@ -19,7 +19,7 @@#include <linux/swap.h> #include <linux/proc_fs.h> #include <linux/bitops.h> -#include <linux/kexec.h> +#include <linux/kexec_kernel.h> #include <asm/dma.h> #include <asm/io.h>
arch/microblaze/kernel/prom.c +1 -1
@@ -26,7 +26,7 @@#include <linux/initrd.h> #include <linux/bitops.h> #include <linux/module.h> -#include <linux/kexec.h> +#include <linux/kexec_kernel.h> #include <linux/debugfs.h> #include <linux/irq.h> #include <linux/lmb.h>
arch/mips/kernel/machine_kexec.c +1 -1
@@ -6,7 +6,7 @@* Version 2. See the file COPYING for more details. */ -#include <linux/kexec.h> +#include <linux/kexec_kernel.h> #include <linux/mm.h> #include <linux/delay.h>
arch/powerpc/kernel/crash.c +1 -1
@@ -15,7 +15,7 @@#include <linux/kernel.h> #include <linux/smp.h> #include <linux/reboot.h> -#include <linux/kexec.h> +#include <linux/kexec_kernel.h> #include <linux/bootmem.h> #include <linux/crash_dump.h> #include <linux/delay.h>
arch/powerpc/kernel/machine_kexec.c +1 -1
@@ -9,7 +9,7 @@* Version 2. See the file COPYING for more details. */ -#include <linux/kexec.h> +#include <linux/kexec_kernel.h> #include <linux/reboot.h> #include <linux/threads.h> #include <linux/lmb.h>
arch/powerpc/kernel/machine_kexec_32.c +1 -1
@@ -9,7 +9,7 @@* Version 2. See the file COPYING for more details. */ -#include <linux/kexec.h> +#include <linux/kexec_kernel.h> #include <linux/mm.h> #include <linux/string.h> #include <asm/cacheflush.h>
arch/powerpc/kernel/machine_kexec_64.c +1 -1
@@ -10,7 +10,7 @@*/ -#include <linux/kexec.h> +#include <linux/kexec_kernel.h> #include <linux/smp.h> #include <linux/thread_info.h> #include <linux/init_task.h>
arch/powerpc/kernel/prom.c +1 -1
@@ -28,7 +28,7 @@#include <linux/initrd.h> #include <linux/bitops.h> #include <linux/module.h> -#include <linux/kexec.h> +#include <linux/kexec_kernel.h> #include <linux/debugfs.h> #include <linux/irq.h> #include <linux/lmb.h>
arch/powerpc/kernel/traps.c +1 -1
@@ -29,7 +29,7 @@#include <linux/prctl.h> #include <linux/delay.h> #include <linux/kprobes.h> -#include <linux/kexec.h> +#include <linux/kexec_kernel.h> #include <linux/backlight.h> #include <linux/bug.h> #include <linux/kdebug.h>
arch/powerpc/platforms/cell/ras.c +1 -1
@@ -14,7 +14,7 @@#include <linux/slab.h> #include <linux/smp.h> #include <linux/reboot.h> -#include <linux/kexec.h> +#include <linux/kexec_kernel.h> #include <linux/crash_dump.h> #include <asm/kexec.h>
arch/powerpc/platforms/embedded6xx/gamecube.c +1 -1
@@ -15,7 +15,7 @@#include <linux/kernel.h> #include <linux/init.h> #include <linux/irq.h> -#include <linux/kexec.h> +#include <linux/kexec_kernel.h> #include <linux/seq_file.h> #include <linux/of_platform.h>
arch/powerpc/platforms/embedded6xx/wii.c +1 -1
@@ -18,7 +18,7 @@#include <linux/init.h> #include <linux/irq.h> #include <linux/seq_file.h> -#include <linux/kexec.h> +#include <linux/kexec_kernel.h> #include <linux/of_platform.h> #include <linux/lmb.h> #include <mm/mmu_decl.h>
arch/powerpc/platforms/iseries/setup.c +1 -1
@@ -23,7 +23,7 @@#include <linux/string.h> #include <linux/seq_file.h> #include <linux/kdev_t.h> -#include <linux/kexec.h> +#include <linux/kexec_kernel.h> #include <linux/major.h> #include <linux/root_dev.h> #include <linux/kernel.h>
arch/s390/kernel/crash.c +1 -1
@@ -8,7 +8,7 @@*/ #include <linux/threads.h> -#include <linux/kexec.h> +#include <linux/kexec_kernel.h> #include <linux/reboot.h> void machine_crash_shutdown (struct pt_regs *regs)
arch/s390/kernel/machine_kexec.c +1 -1
@@ -9,7 +9,7 @@#include <linux/device.h> #include <linux/mm.h> -#include <linux/kexec.h> +#include <linux/kexec_kernel.h> #include <linux/delay.h> #include <linux/reboot.h> #include <asm/cio.h>
arch/sh/kernel/machine_kexec.c +1 -1
@@ -9,7 +9,7 @@* Version 2. See the file COPYING for more details. */ #include <linux/mm.h> -#include <linux/kexec.h> +#include <linux/kexec_kernel.h> #include <linux/delay.h> #include <linux/reboot.h> #include <linux/numa.h>
arch/sh/kernel/reboot.c +1 -1
@@ -1,5 +1,5 @@#include <linux/pm.h> -#include <linux/kexec.h> +#include <linux/kexec_kernel.h> #include <linux/kernel.h> #include <linux/reboot.h> #include <linux/module.h>
arch/sh/kernel/setup.c +1 -1
@@ -20,7 +20,7 @@#include <linux/pfn.h> #include <linux/fs.h> #include <linux/mm.h> -#include <linux/kexec.h> +#include <linux/kexec_kernel.h> #include <linux/module.h> #include <linux/smp.h> #include <linux/err.h>
arch/sh/kernel/traps_32.c +1 -1
@@ -22,7 +22,7 @@#include <linux/bug.h> #include <linux/debug_locks.h> #include <linux/kdebug.h> -#include <linux/kexec.h> +#include <linux/kexec_kernel.h> #include <linux/limits.h> #include <linux/sysfs.h> #include <linux/uaccess.h>
arch/x86/kernel/crash.c +1 -1
@@ -12,7 +12,7 @@#include <linux/kernel.h> #include <linux/smp.h> #include <linux/reboot.h> -#include <linux/kexec.h> +#include <linux/kexec_kernel.h> #include <linux/delay.h> #include <linux/elf.h> #include <linux/elfcore.h>
arch/x86/kernel/dumpstack.c +1 -1
@@ -2,6 +2,7 @@* Copyright (C) 1991, 1992 Linus Torvalds * Copyright (C) 2000, 2001, 2002 Andi Kleen, SuSE Labs */ +#include <linux/kexec_kernel.h> #include <linux/kallsyms.h> #include <linux/kprobes.h> #include <linux/uaccess.h>
@@ -11,7 +12,6 @@#include <linux/module.h> #include <linux/ptrace.h> #include <linux/ftrace.h> -#include <linux/kexec.h> #include <linux/bug.h> #include <linux/nmi.h> #include <linux/sysfs.h>
arch/x86/kernel/dumpstack_32.c +0 -1
@@ -9,7 +9,6 @@#include <linux/kdebug.h> #include <linux/module.h> #include <linux/ptrace.h> -#include <linux/kexec.h> #include <linux/sysfs.h> #include <linux/bug.h> #include <linux/nmi.h>
arch/x86/kernel/dumpstack_64.c +0 -1
@@ -9,7 +9,6 @@#include <linux/kdebug.h> #include <linux/module.h> #include <linux/ptrace.h> -#include <linux/kexec.h> #include <linux/sysfs.h> #include <linux/bug.h> #include <linux/nmi.h>
arch/x86/kernel/machine_kexec_32.c +1 -1
@@ -7,7 +7,7 @@*/ #include <linux/mm.h> -#include <linux/kexec.h> +#include <linux/kexec_kernel.h> #include <linux/delay.h> #include <linux/init.h> #include <linux/numa.h>
arch/x86/kernel/machine_kexec_64.c +1 -1
@@ -7,7 +7,7 @@*/ #include <linux/mm.h> -#include <linux/kexec.h> +#include <linux/kexec_kernel.h> #include <linux/string.h> #include <linux/gfp.h> #include <linux/reboot.h>
arch/x86/kernel/setup.c +1 -1
@@ -42,7 +42,7 @@#include <linux/edd.h> #include <linux/iscsi_ibft.h> #include <linux/nodemask.h> -#include <linux/kexec.h> +#include <linux/kexec_kernel.h> #include <linux/dmi.h> #include <linux/pfn.h> #include <linux/pci.h>
arch/x86/kernel/setup_percpu.c +0 -1
@@ -5,7 +5,6 @@#include <linux/init.h> #include <linux/bootmem.h> #include <linux/percpu.h> -#include <linux/kexec.h> #include <linux/crash_dump.h> #include <linux/smp.h> #include <linux/topology.h>
arch/x86/kernel/traps.c +0 -1
@@ -22,7 +22,6 @@#include <linux/string.h> #include <linux/delay.h> #include <linux/errno.h> -#include <linux/kexec.h> #include <linux/sched.h> #include <linux/timer.h> #include <linux/init.h>
arch/x86/mm/numa_32.c +0 -1
@@ -29,7 +29,6 @@#include <linux/initrd.h> #include <linux/nodemask.h> #include <linux/module.h> -#include <linux/kexec.h> #include <linux/pfn.h> #include <linux/swap.h> #include <linux/acpi.h>
drivers/base/cpu.c +1 -1
@@ -107,7 +107,7 @@ static inline void register_cpu_control(struct cpu *cpu)#endif /* CONFIG_HOTPLUG_CPU */ #ifdef CONFIG_KEXEC -#include <linux/kexec.h> +#include <linux/kexec_kernel.h> static ssize_t show_crash_notes (struct sys_device *dev,struct sysdev_attribute *attr,char *buf)
include/linux/Kbuild +1 -0
@@ -106,6 +106,7 @@ header-y += irda.h header-y += iso_fs.h header-y += ixjuser.h header-y += jffs2.h +header-y += kexec.h header-y += keyctl.h header-y += limits.h header-y += magic.h
include/linux/crash_dump.h +0 -1
@@ -2,7 +2,6 @@#define LINUX_CRASH_DUMP_H #ifdef CONFIG_CRASH_DUMP -#include <linux/kexec.h> #include <linux/device.h> #include <linux/proc_fs.h>
include/linux/kexec.h +10 -190
215 lines not on this page · raw message
include/linux/kexec_kernel.h new file +193 -0
193 lines not on this page · raw message
init/initramfs.c +1 -1
@@ -485,7 +485,7 @@ __setup("retain_initrd", retain_initrd_param);extern char __initramfs_start[], __initramfs_end[];#include <linux/initrd.h> -#include <linux/kexec.h> +#include <linux/kexec_kernel.h> static void __init free_initrd (void ) {
kernel/kexec.c +1 -1
@@ -11,7 +11,7 @@#include <linux/file.h> #include <linux/slab.h> #include <linux/fs.h> -#include <linux/kexec.h> +#include <linux/kexec_kernel.h> #include <linux/mutex.h> #include <linux/list.h> #include <linux/highmem.h>
kernel/ksysfs.c +1 -1
@@ -13,7 +13,7 @@#include <linux/sysfs.h> #include <linux/module.h> #include <linux/init.h> -#include <linux/kexec.h> +#include <linux/kexec_kernel.h> #include <linux/profile.h> #include <linux/sched.h>
kernel/panic.c +1 -1
@@ -8,6 +8,7 @@* This function is used through-out the kernel (including mm and fs) * to indicate a major problem. */ +#include <linux/kexec_kernel.h> #include <linux/debug_locks.h> #include <linux/interrupt.h> #include <linux/kmsg_dump.h>
@@ -17,7 +18,6 @@#include <linux/random.h> #include <linux/reboot.h> #include <linux/delay.h> -#include <linux/kexec.h> #include <linux/sched.h> #include <linux/sysrq.h> #include <linux/init.h>
kernel/printk.c +1 -1
@@ -32,7 +32,7 @@#include <linux/security.h> #include <linux/bootmem.h> #include <linux/syscalls.h> -#include <linux/kexec.h> +#include <linux/kexec_kernel.h> #include <linux/kdb.h> #include <linux/ratelimit.h> #include <linux/kmsg_dump.h>
kernel/sys.c +1 -1
@@ -16,7 +16,7 @@#include <linux/perf_event.h> #include <linux/resource.h> #include <linux/kernel.h> -#include <linux/kexec.h> +#include <linux/kexec_kernel.h> #include <linux/workqueue.h> #include <linux/capability.h> #include <linux/device.h>
Signature · 1 line
1.6.0.6
Re: [RFC] use kexec_kernel.h for the kernel-only stuff [Was: [PATCH] Export kexec.h]
Quoted 8 lines · Sam Ravnborg
Quoted 6 lines · Andi Kleen
Export
kexec.h
kexec_loadis a system call and it needs a header
file with its input arguments.Export the parts of
kexec.hneeded for this.
Quoted 7 lines
Rather than introducing yet another file where
only a fraction is exported how about a split
where we put the kernel specific definitions inkexec_kernel.h. Andkexec.his the userspace interface (which is included bykexec_kernel.h).We did it like this for pps some time ago.
Would work for me too, I have no strong opinion either way.
Being naturally lazy, I just went with the simpler patch myself.
-Andi
PATCH 1/1 kexec: export kexec.h to userspace
Quoted 1 line
From
23dc7f6d65a5bdcd05f2346b9f5cdaf232758db3Mon Sep 17 00:00:00 2001
From: Sam Ravnborg <[email protected]>
Date: Sat, 19 Jun 2010 20:11:59 +0200
Subject: [PATCH] kexec: export kexec.h to userspace
kexec_load is a system call and it needs a header
file with its input arguments.
Split kexec.h in two parts:kexec.h - the userspace visible definitionskexec_kernel.h - the kernel definitions
Fix up all files that include kexec.h to include kexec_kernel.h In a few cases an unused include was dropped.
---
Changes:
- Added ack from Andi. (Based on "that would work for me too" comment)
- Modified pattern in MAINTAINERS, thanks to Joe Perches
But it would be nice with a bit more comments on the split in two files...
Sam
MAINTAINERS | 2 +- arch/arm/kernel/machine_kexec.c | 2 +- arch/arm/kernel/traps.c | 2 +- arch/ia64/kernel/crash.c | 2 +- arch/ia64/kernel/efi.c | 2 +- arch/ia64/kernel/machine_kexec.c | 2 +- arch/ia64/kernel/setup.c | 2 +- arch/ia64/kernel/smp.c | 2 +- arch/ia64/mm/init.c | 2 +- arch/microblaze/kernel/prom.c | 2 +- arch/mips/kernel/machine_kexec.c | 2 +- arch/powerpc/kernel/crash.c | 2 +- arch/powerpc/kernel/machine_kexec.c | 2 +- arch/powerpc/kernel/machine_kexec_32.c | 2 +- arch/powerpc/kernel/machine_kexec_64.c | 2 +- arch/powerpc/kernel/prom.c | 2 +- arch/powerpc/kernel/traps.c | 2 +- arch/powerpc/platforms/cell/ras.c | 2 +- arch/powerpc/platforms/embedded6xx/gamecube.c | 2 +- arch/powerpc/platforms/embedded6xx/wii.c | 2 +- arch/powerpc/platforms/iseries/setup.c | 2 +- arch/s390/kernel/crash.c | 2 +- arch/s390/kernel/machine_kexec.c | 2 +- arch/sh/kernel/machine_kexec.c | 2 +- arch/sh/kernel/reboot.c | 2 +- arch/sh/kernel/setup.c | 2 +- arch/sh/kernel/traps_32.c | 2 +- arch/x86/kernel/crash.c | 2 +- arch/x86/kernel/dumpstack.c | 2 +- arch/x86/kernel/dumpstack_32.c | 1 - arch/x86/kernel/dumpstack_64.c | 1 - arch/x86/kernel/machine_kexec_32.c | 2 +- arch/x86/kernel/machine_kexec_64.c | 2 +- arch/x86/kernel/setup.c | 2 +- arch/x86/kernel/setup_percpu.c | 1 - arch/x86/kernel/traps.c | 1 - arch/x86/mm/numa_32.c | 1 - drivers/base/cpu.c | 2 +- include/linux/Kbuild | 1 + include/linux/crash_dump.h | 1 - include/linux/kexec.h | 200 ++----------------------- include/linux/kexec_kernel.h | 193 ++++++++++++++++++++++++ init/initramfs.c | 2 +- kernel/kexec.c | 2 +- kernel/ksysfs.c | 2 +- kernel/panic.c | 2 +- kernel/printk.c | 2 +- kernel/sys.c | 2 +- 48 files changed, 243 insertions(+), 235 deletions(-) create mode 100644 include/linux/kexec_kernel.h
MAINTAINERS +1 -1
@@ -3325,7 +3325,7 @@ M: Eric Biederman <[email protected]> W: http://ftp.kernel.org/pub/linux/kernel/people/horms/kexec-tools/ L: [email protected] S: Maintained -F: include/linux/kexec.h +F: include/linux/kexec* F: kernel/kexec.c KEYS/KEYRINGS:
arch/arm/kernel/machine_kexec.c +1 -1
@@ -3,7 +3,7 @@*/ #include <linux/mm.h> -#include <linux/kexec.h> +#include <linux/kexec_kernel.h> #include <linux/delay.h> #include <linux/reboot.h> #include <linux/io.h>
arch/arm/kernel/traps.c +1 -1
@@ -20,7 +20,7 @@#include <linux/hardirq.h> #include <linux/kdebug.h> #include <linux/module.h> -#include <linux/kexec.h> +#include <linux/kexec_kernel.h> #include <linux/delay.h> #include <linux/init.h>
arch/ia64/kernel/crash.c +1 -1
@@ -12,7 +12,7 @@#include <linux/delay.h> #include <linux/crash_dump.h> #include <linux/bootmem.h> -#include <linux/kexec.h> +#include <linux/kexec_kernel.h> #include <linux/elfcore.h> #include <linux/sysctl.h> #include <linux/init.h>
arch/ia64/kernel/efi.c +1 -1
@@ -29,7 +29,7 @@#include <linux/slab.h> #include <linux/time.h> #include <linux/efi.h> -#include <linux/kexec.h> +#include <linux/kexec_kernel.h> #include <linux/mm.h> #include <asm/io.h>
arch/ia64/kernel/machine_kexec.c +1 -1
@@ -11,7 +11,7 @@*/ #include <linux/mm.h> -#include <linux/kexec.h> +#include <linux/kexec_kernel.h> #include <linux/cpu.h> #include <linux/irq.h> #include <linux/efi.h>
arch/ia64/kernel/setup.c +1 -1
@@ -43,7 +43,7 @@#include <linux/initrd.h> #include <linux/pm.h> #include <linux/cpufreq.h> -#include <linux/kexec.h> +#include <linux/kexec_kernel.h> #include <linux/crash_dump.h> #include <asm/machvec.h>
arch/ia64/kernel/smp.c +1 -1
@@ -30,7 +30,7 @@#include <linux/delay.h> #include <linux/efi.h> #include <linux/bitops.h> -#include <linux/kexec.h> +#include <linux/kexec_kernel.h> #include <asm/atomic.h> #include <asm/current.h>
arch/ia64/mm/init.c +1 -1
@@ -19,7 +19,7 @@#include <linux/swap.h> #include <linux/proc_fs.h> #include <linux/bitops.h> -#include <linux/kexec.h> +#include <linux/kexec_kernel.h> #include <asm/dma.h> #include <asm/io.h>
arch/microblaze/kernel/prom.c +1 -1
@@ -26,7 +26,7 @@#include <linux/initrd.h> #include <linux/bitops.h> #include <linux/module.h> -#include <linux/kexec.h> +#include <linux/kexec_kernel.h> #include <linux/debugfs.h> #include <linux/irq.h> #include <linux/lmb.h>
arch/mips/kernel/machine_kexec.c +1 -1
@@ -6,7 +6,7 @@* Version 2. See the file COPYING for more details. */ -#include <linux/kexec.h> +#include <linux/kexec_kernel.h> #include <linux/mm.h> #include <linux/delay.h>
arch/powerpc/kernel/crash.c +1 -1
@@ -15,7 +15,7 @@#include <linux/kernel.h> #include <linux/smp.h> #include <linux/reboot.h> -#include <linux/kexec.h> +#include <linux/kexec_kernel.h> #include <linux/bootmem.h> #include <linux/crash_dump.h> #include <linux/delay.h>
arch/powerpc/kernel/machine_kexec.c +1 -1
@@ -9,7 +9,7 @@* Version 2. See the file COPYING for more details. */ -#include <linux/kexec.h> +#include <linux/kexec_kernel.h> #include <linux/reboot.h> #include <linux/threads.h> #include <linux/lmb.h>
arch/powerpc/kernel/machine_kexec_32.c +1 -1
@@ -9,7 +9,7 @@* Version 2. See the file COPYING for more details. */ -#include <linux/kexec.h> +#include <linux/kexec_kernel.h> #include <linux/mm.h> #include <linux/string.h> #include <asm/cacheflush.h>
arch/powerpc/kernel/machine_kexec_64.c +1 -1
@@ -10,7 +10,7 @@*/ -#include <linux/kexec.h> +#include <linux/kexec_kernel.h> #include <linux/smp.h> #include <linux/thread_info.h> #include <linux/init_task.h>
arch/powerpc/kernel/prom.c +1 -1
@@ -28,7 +28,7 @@#include <linux/initrd.h> #include <linux/bitops.h> #include <linux/module.h> -#include <linux/kexec.h> +#include <linux/kexec_kernel.h> #include <linux/debugfs.h> #include <linux/irq.h> #include <linux/lmb.h>
arch/powerpc/kernel/traps.c +1 -1
@@ -29,7 +29,7 @@#include <linux/prctl.h> #include <linux/delay.h> #include <linux/kprobes.h> -#include <linux/kexec.h> +#include <linux/kexec_kernel.h> #include <linux/backlight.h> #include <linux/bug.h> #include <linux/kdebug.h>
arch/powerpc/platforms/cell/ras.c +1 -1
@@ -14,7 +14,7 @@#include <linux/slab.h> #include <linux/smp.h> #include <linux/reboot.h> -#include <linux/kexec.h> +#include <linux/kexec_kernel.h> #include <linux/crash_dump.h> #include <asm/kexec.h>
arch/powerpc/platforms/embedded6xx/gamecube.c +1 -1
@@ -15,7 +15,7 @@#include <linux/kernel.h> #include <linux/init.h> #include <linux/irq.h> -#include <linux/kexec.h> +#include <linux/kexec_kernel.h> #include <linux/seq_file.h> #include <linux/of_platform.h>
arch/powerpc/platforms/embedded6xx/wii.c +1 -1
@@ -18,7 +18,7 @@#include <linux/init.h> #include <linux/irq.h> #include <linux/seq_file.h> -#include <linux/kexec.h> +#include <linux/kexec_kernel.h> #include <linux/of_platform.h> #include <linux/lmb.h> #include <mm/mmu_decl.h>
arch/powerpc/platforms/iseries/setup.c +1 -1
@@ -23,7 +23,7 @@#include <linux/string.h> #include <linux/seq_file.h> #include <linux/kdev_t.h> -#include <linux/kexec.h> +#include <linux/kexec_kernel.h> #include <linux/major.h> #include <linux/root_dev.h> #include <linux/kernel.h>
arch/s390/kernel/crash.c +1 -1
@@ -8,7 +8,7 @@*/ #include <linux/threads.h> -#include <linux/kexec.h> +#include <linux/kexec_kernel.h> #include <linux/reboot.h> void machine_crash_shutdown (struct pt_regs *regs)
arch/s390/kernel/machine_kexec.c +1 -1
@@ -9,7 +9,7 @@#include <linux/device.h> #include <linux/mm.h> -#include <linux/kexec.h> +#include <linux/kexec_kernel.h> #include <linux/delay.h> #include <linux/reboot.h> #include <asm/cio.h>
arch/sh/kernel/machine_kexec.c +1 -1
@@ -9,7 +9,7 @@* Version 2. See the file COPYING for more details. */ #include <linux/mm.h> -#include <linux/kexec.h> +#include <linux/kexec_kernel.h> #include <linux/delay.h> #include <linux/reboot.h> #include <linux/numa.h>
arch/sh/kernel/reboot.c +1 -1
@@ -1,5 +1,5 @@#include <linux/pm.h> -#include <linux/kexec.h> +#include <linux/kexec_kernel.h> #include <linux/kernel.h> #include <linux/reboot.h> #include <linux/module.h>
arch/sh/kernel/setup.c +1 -1
@@ -20,7 +20,7 @@#include <linux/pfn.h> #include <linux/fs.h> #include <linux/mm.h> -#include <linux/kexec.h> +#include <linux/kexec_kernel.h> #include <linux/module.h> #include <linux/smp.h> #include <linux/err.h>
arch/sh/kernel/traps_32.c +1 -1
@@ -22,7 +22,7 @@#include <linux/bug.h> #include <linux/debug_locks.h> #include <linux/kdebug.h> -#include <linux/kexec.h> +#include <linux/kexec_kernel.h> #include <linux/limits.h> #include <linux/sysfs.h> #include <linux/uaccess.h>
arch/x86/kernel/crash.c +1 -1
@@ -12,7 +12,7 @@#include <linux/kernel.h> #include <linux/smp.h> #include <linux/reboot.h> -#include <linux/kexec.h> +#include <linux/kexec_kernel.h> #include <linux/delay.h> #include <linux/elf.h> #include <linux/elfcore.h>
arch/x86/kernel/dumpstack.c +1 -1
@@ -2,6 +2,7 @@* Copyright (C) 1991, 1992 Linus Torvalds * Copyright (C) 2000, 2001, 2002 Andi Kleen, SuSE Labs */ +#include <linux/kexec_kernel.h> #include <linux/kallsyms.h> #include <linux/kprobes.h> #include <linux/uaccess.h>
@@ -11,7 +12,6 @@#include <linux/module.h> #include <linux/ptrace.h> #include <linux/ftrace.h> -#include <linux/kexec.h> #include <linux/bug.h> #include <linux/nmi.h> #include <linux/sysfs.h>
arch/x86/kernel/dumpstack_32.c +0 -1
@@ -9,7 +9,6 @@#include <linux/kdebug.h> #include <linux/module.h> #include <linux/ptrace.h> -#include <linux/kexec.h> #include <linux/sysfs.h> #include <linux/bug.h> #include <linux/nmi.h>
arch/x86/kernel/dumpstack_64.c +0 -1
@@ -9,7 +9,6 @@#include <linux/kdebug.h> #include <linux/module.h> #include <linux/ptrace.h> -#include <linux/kexec.h> #include <linux/sysfs.h> #include <linux/bug.h> #include <linux/nmi.h>
arch/x86/kernel/machine_kexec_32.c +1 -1
@@ -7,7 +7,7 @@*/ #include <linux/mm.h> -#include <linux/kexec.h> +#include <linux/kexec_kernel.h> #include <linux/delay.h> #include <linux/init.h> #include <linux/numa.h>
arch/x86/kernel/machine_kexec_64.c +1 -1
@@ -7,7 +7,7 @@*/ #include <linux/mm.h> -#include <linux/kexec.h> +#include <linux/kexec_kernel.h> #include <linux/string.h> #include <linux/gfp.h> #include <linux/reboot.h>
arch/x86/kernel/setup.c +1 -1
@@ -42,7 +42,7 @@#include <linux/edd.h> #include <linux/iscsi_ibft.h> #include <linux/nodemask.h> -#include <linux/kexec.h> +#include <linux/kexec_kernel.h> #include <linux/dmi.h> #include <linux/pfn.h> #include <linux/pci.h>
arch/x86/kernel/setup_percpu.c +0 -1
@@ -5,7 +5,6 @@#include <linux/init.h> #include <linux/bootmem.h> #include <linux/percpu.h> -#include <linux/kexec.h> #include <linux/crash_dump.h> #include <linux/smp.h> #include <linux/topology.h>
arch/x86/kernel/traps.c +0 -1
@@ -22,7 +22,6 @@#include <linux/string.h> #include <linux/delay.h> #include <linux/errno.h> -#include <linux/kexec.h> #include <linux/sched.h> #include <linux/timer.h> #include <linux/init.h>
arch/x86/mm/numa_32.c +0 -1
@@ -29,7 +29,6 @@#include <linux/initrd.h> #include <linux/nodemask.h> #include <linux/module.h> -#include <linux/kexec.h> #include <linux/pfn.h> #include <linux/swap.h> #include <linux/acpi.h>
drivers/base/cpu.c +1 -1
@@ -107,7 +107,7 @@ static inline void register_cpu_control(struct cpu *cpu)#endif /* CONFIG_HOTPLUG_CPU */ #ifdef CONFIG_KEXEC -#include <linux/kexec.h> +#include <linux/kexec_kernel.h> static ssize_t show_crash_notes (struct sys_device *dev,struct sysdev_attribute *attr,char *buf)
include/linux/Kbuild +1 -0
@@ -106,6 +106,7 @@ header-y += irda.h header-y += iso_fs.h header-y += ixjuser.h header-y += jffs2.h +header-y += kexec.h header-y += keyctl.h header-y += limits.h header-y += magic.h
include/linux/crash_dump.h +0 -1
@@ -2,7 +2,6 @@#define LINUX_CRASH_DUMP_H #ifdef CONFIG_CRASH_DUMP -#include <linux/kexec.h> #include <linux/device.h> #include <linux/proc_fs.h>
include/linux/kexec.h +10 -190
215 lines not on this page · raw message
include/linux/kexec_kernel.h new file +193 -0
193 lines not on this page · raw message
init/initramfs.c +1 -1
@@ -485,7 +485,7 @@ __setup("retain_initrd", retain_initrd_param);extern char __initramfs_start[], __initramfs_end[];#include <linux/initrd.h> -#include <linux/kexec.h> +#include <linux/kexec_kernel.h> static void __init free_initrd (void ) {
kernel/kexec.c +1 -1
@@ -11,7 +11,7 @@#include <linux/file.h> #include <linux/slab.h> #include <linux/fs.h> -#include <linux/kexec.h> +#include <linux/kexec_kernel.h> #include <linux/mutex.h> #include <linux/list.h> #include <linux/highmem.h>
kernel/ksysfs.c +1 -1
@@ -13,7 +13,7 @@#include <linux/sysfs.h> #include <linux/module.h> #include <linux/init.h> -#include <linux/kexec.h> +#include <linux/kexec_kernel.h> #include <linux/profile.h> #include <linux/sched.h>
kernel/panic.c +1 -1
@@ -8,6 +8,7 @@* This function is used through-out the kernel (including mm and fs) * to indicate a major problem. */ +#include <linux/kexec_kernel.h> #include <linux/debug_locks.h> #include <linux/interrupt.h> #include <linux/kmsg_dump.h>
@@ -17,7 +18,6 @@#include <linux/random.h> #include <linux/reboot.h> #include <linux/delay.h> -#include <linux/kexec.h> #include <linux/sched.h> #include <linux/sysrq.h> #include <linux/init.h>
kernel/printk.c +1 -1
@@ -32,7 +32,7 @@#include <linux/security.h> #include <linux/bootmem.h> #include <linux/syscalls.h> -#include <linux/kexec.h> +#include <linux/kexec_kernel.h> #include <linux/kdb.h> #include <linux/ratelimit.h> #include <linux/kmsg_dump.h>
kernel/sys.c +1 -1
@@ -16,7 +16,7 @@#include <linux/perf_event.h> #include <linux/resource.h> #include <linux/kernel.h> -#include <linux/kexec.h> +#include <linux/kexec_kernel.h> #include <linux/workqueue.h> #include <linux/capability.h> #include <linux/device.h>
Signature · 1 line
1.6.0.6
Re: [PATCH] kexec: export kexec.h to userspace
Quoted 8 lines · Sam Ravnborg
Quoted 1 line
From
23dc7f6d65a5bdcd05f2346b9f5cdaf232758db3Mon Sep 17 00:00:00 2001From: Sam Ravnborg <[email protected]>
Date: Sat, 19 Jun 2010 20:11:59 +0200
Subject: [PATCH] kexec: exportkexec.hto userspace
kexec_loadis a system call and it needs a header
file with its input arguments.
Quoted 6 lines
Split
kexec.hin two parts:kexec.h- the userspace visible definitionskexec_kernel.h- the kernel definitionsFix up all files that include
kexec.hto includekexec_kernel.hIn a few cases an unused include was dropped.
Can we please do this the other way around and create a kexec_user.h? Having a an xxx_user.h is a pattern we already have in the kernel. I can't find a signle xxxx_kernel.h
If we can modify the userspace /sbin/kexec code to use this file (or at least a copy of it). I will feel a lot more comfortable with this patch as the code will actually be tested.
Oh, and please copy the kexec list on patches like this as well.
I like the idea of this patch. I just don't trust the implementation yet.
Quoted 1,091 lines
Signed-off-by Sam Ravnborg <[email protected]>Acked-by Andi Kleen <[email protected]>Cc Eric Biederman <[email protected]>---
Changes:
- Added ack from Andi. (Based on "that would work for me too" comment)
- Modified pattern inMAINTAINERS, thanks to Joe PerchesBut it would be nice with a bit more comments on the split in two files...
Sam
MAINTAINERS | 2 +- arch/arm/kernel/machine_kexec.c | 2 +- arch/arm/kernel/traps.c | 2 +- arch/ia64/kernel/crash.c | 2 +- arch/ia64/kernel/efi.c | 2 +- arch/ia64/kernel/machine_kexec.c | 2 +- arch/ia64/kernel/setup.c | 2 +- arch/ia64/kernel/smp.c | 2 +- arch/ia64/mm/init.c | 2 +- arch/microblaze/kernel/prom.c | 2 +- arch/mips/kernel/machine_kexec.c | 2 +- arch/powerpc/kernel/crash.c | 2 +- arch/powerpc/kernel/machine_kexec.c | 2 +- arch/powerpc/kernel/machine_kexec_32.c | 2 +- arch/powerpc/kernel/machine_kexec_64.c | 2 +- arch/powerpc/kernel/prom.c | 2 +- arch/powerpc/kernel/traps.c | 2 +- arch/powerpc/platforms/cell/ras.c | 2 +- arch/powerpc/platforms/embedded6xx/gamecube.c | 2 +- arch/powerpc/platforms/embedded6xx/wii.c | 2 +- arch/powerpc/platforms/iseries/setup.c | 2 +- arch/s390/kernel/crash.c | 2 +- arch/s390/kernel/machine_kexec.c | 2 +- arch/sh/kernel/machine_kexec.c | 2 +- arch/sh/kernel/reboot.c | 2 +- arch/sh/kernel/setup.c | 2 +- arch/sh/kernel/traps_32.c | 2 +- arch/x86/kernel/crash.c | 2 +- arch/x86/kernel/dumpstack.c | 2 +- arch/x86/kernel/dumpstack_32.c | 1 - arch/x86/kernel/dumpstack_64.c | 1 - arch/x86/kernel/machine_kexec_32.c | 2 +- arch/x86/kernel/machine_kexec_64.c | 2 +- arch/x86/kernel/setup.c | 2 +- arch/x86/kernel/setup_percpu.c | 1 - arch/x86/kernel/traps.c | 1 - arch/x86/mm/numa_32.c | 1 - drivers/base/cpu.c | 2 +- include/linux/Kbuild | 1 + include/linux/crash_dump.h | 1 - include/linux/kexec.h | 200 ++----------------------- include/linux/kexec_kernel.h | 193 ++++++++++++++++++++++++ init/initramfs.c | 2 +- kernel/kexec.c | 2 +- kernel/ksysfs.c | 2 +- kernel/panic.c | 2 +- kernel/printk.c | 2 +- kernel/sys.c | 2 +- 48 files changed, 243 insertions(+), 235 deletions(-) create mode 100644 include/linux/kexec_kernel.hMAINTAINERS +1
-1@@ -3325,7 +3325,7 @@ M: Eric Biederman <[email protected]> W: http://ftp.kernel.org/pub/linux/kernel/people/horms/kexec-tools/ L: [email protected] S: Maintained -F: include/linux/kexec.h +F: include/linux/kexec* F: kernel/kexec.c KEYS/KEYRINGS:arch/arm/kernel/machine_kexec.c +1
-1@@ -3,7 +3,7 @@*/ #include <linux/mm.h> -#include <linux/kexec.h> +#include <linux/kexec_kernel.h> #include <linux/delay.h> #include <linux/reboot.h> #include <linux/io.h> arch/arm/kernel/traps.c +1
-1@@ -20,7 +20,7 @@#include <linux/hardirq.h> #include <linux/kdebug.h> #include <linux/module.h> -#include <linux/kexec.h> +#include <linux/kexec_kernel.h> #include <linux/delay.h> #include <linux/init.h> arch/ia64/kernel/crash.c +1
-1@@ -12,7 +12,7 @@#include <linux/delay.h> #include <linux/crash_dump.h> #include <linux/bootmem.h> -#include <linux/kexec.h> +#include <linux/kexec_kernel.h> #include <linux/elfcore.h> #include <linux/sysctl.h> #include <linux/init.h> arch/ia64/kernel/efi.c +1
-1@@ -29,7 +29,7 @@#include <linux/slab.h> #include <linux/time.h> #include <linux/efi.h> -#include <linux/kexec.h> +#include <linux/kexec_kernel.h> #include <linux/mm.h> #include <asm/io.h> arch/ia64/kernel/machine_kexec.c +1
-1@@ -11,7 +11,7 @@*/ #include <linux/mm.h> -#include <linux/kexec.h> +#include <linux/kexec_kernel.h> #include <linux/cpu.h> #include <linux/irq.h> #include <linux/efi.h> arch/ia64/kernel/setup.c +1
-1@@ -43,7 +43,7 @@#include <linux/initrd.h> #include <linux/pm.h> #include <linux/cpufreq.h> -#include <linux/kexec.h> +#include <linux/kexec_kernel.h> #include <linux/crash_dump.h> #include <asm/machvec.h> arch/ia64/kernel/smp.c +1
-1@@ -30,7 +30,7 @@#include <linux/delay.h> #include <linux/efi.h> #include <linux/bitops.h> -#include <linux/kexec.h> +#include <linux/kexec_kernel.h> #include <asm/atomic.h> #include <asm/current.h> arch/ia64/mm/init.c +1
-1@@ -19,7 +19,7 @@#include <linux/swap.h> #include <linux/proc_fs.h> #include <linux/bitops.h> -#include <linux/kexec.h> +#include <linux/kexec_kernel.h> #include <asm/dma.h> #include <asm/io.h> arch/microblaze/kernel/prom.c +1
-1@@ -26,7 +26,7 @@#include <linux/initrd.h> #include <linux/bitops.h> #include <linux/module.h> -#include <linux/kexec.h> +#include <linux/kexec_kernel.h> #include <linux/debugfs.h> #include <linux/irq.h> #include <linux/lmb.h> arch/mips/kernel/machine_kexec.c +1
-1@@ -6,7 +6,7 @@* Version 2. See the file COPYING for more details. */ -#include <linux/kexec.h> +#include <linux/kexec_kernel.h> #include <linux/mm.h> #include <linux/delay.h> arch/powerpc/kernel/crash.c +1
-1@@ -15,7 +15,7 @@#include <linux/kernel.h> #include <linux/smp.h> #include <linux/reboot.h> -#include <linux/kexec.h> +#include <linux/kexec_kernel.h> #include <linux/bootmem.h> #include <linux/crash_dump.h> #include <linux/delay.h> arch/powerpc/kernel/machine_kexec.c +1
-1@@ -9,7 +9,7 @@* Version 2. See the file COPYING for more details. */ -#include <linux/kexec.h> +#include <linux/kexec_kernel.h> #include <linux/reboot.h> #include <linux/threads.h> #include <linux/lmb.h> arch/powerpc/kernel/machine_kexec_32.c +1
-1@@ -9,7 +9,7 @@* Version 2. See the file COPYING for more details. */ -#include <linux/kexec.h> +#include <linux/kexec_kernel.h> #include <linux/mm.h> #include <linux/string.h> #include <asm/cacheflush.h> arch/powerpc/kernel/machine_kexec_64.c +1
-1@@ -10,7 +10,7 @@*/ -#include <linux/kexec.h> +#include <linux/kexec_kernel.h> #include <linux/smp.h> #include <linux/thread_info.h> #include <linux/init_task.h> arch/powerpc/kernel/prom.c +1
-1@@ -28,7 +28,7 @@#include <linux/initrd.h> #include <linux/bitops.h> #include <linux/module.h> -#include <linux/kexec.h> +#include <linux/kexec_kernel.h> #include <linux/debugfs.h> #include <linux/irq.h> #include <linux/lmb.h> arch/powerpc/kernel/traps.c +1
-1@@ -29,7 +29,7 @@#include <linux/prctl.h> #include <linux/delay.h> #include <linux/kprobes.h> -#include <linux/kexec.h> +#include <linux/kexec_kernel.h> #include <linux/backlight.h> #include <linux/bug.h> #include <linux/kdebug.h> arch/powerpc/platforms/cell/ras.c +1
-1@@ -14,7 +14,7 @@#include <linux/slab.h> #include <linux/smp.h> #include <linux/reboot.h> -#include <linux/kexec.h> +#include <linux/kexec_kernel.h> #include <linux/crash_dump.h> #include <asm/kexec.h> arch/powerpc/platforms/embedded6xx/gamecube.c +1
-1@@ -15,7 +15,7 @@#include <linux/kernel.h> #include <linux/init.h> #include <linux/irq.h> -#include <linux/kexec.h> +#include <linux/kexec_kernel.h> #include <linux/seq_file.h> #include <linux/of_platform.h> arch/powerpc/platforms/embedded6xx/wii.c +1
-1@@ -18,7 +18,7 @@#include <linux/init.h> #include <linux/irq.h> #include <linux/seq_file.h> -#include <linux/kexec.h> +#include <linux/kexec_kernel.h> #include <linux/of_platform.h> #include <linux/lmb.h> #include <mm/mmu_decl.h> arch/powerpc/platforms/iseries/setup.c +1
-1@@ -23,7 +23,7 @@#include <linux/string.h> #include <linux/seq_file.h> #include <linux/kdev_t.h> -#include <linux/kexec.h> +#include <linux/kexec_kernel.h> #include <linux/major.h> #include <linux/root_dev.h> #include <linux/kernel.h> arch/s390/kernel/crash.c +1
-1@@ -8,7 +8,7 @@*/ #include <linux/threads.h> -#include <linux/kexec.h> +#include <linux/kexec_kernel.h> #include <linux/reboot.h> void machine_crash_shutdown (struct pt_regs *regs)arch/s390/kernel/machine_kexec.c +1
-1@@ -9,7 +9,7 @@#include <linux/device.h> #include <linux/mm.h> -#include <linux/kexec.h> +#include <linux/kexec_kernel.h> #include <linux/delay.h> #include <linux/reboot.h> #include <asm/cio.h> arch/sh/kernel/machine_kexec.c +1
-1@@ -9,7 +9,7 @@* Version 2. See the file COPYING for more details. */ #include <linux/mm.h> -#include <linux/kexec.h> +#include <linux/kexec_kernel.h> #include <linux/delay.h> #include <linux/reboot.h> #include <linux/numa.h> arch/sh/kernel/reboot.c +1
-1@@ -1,5 +1,5 @@#include <linux/pm.h> -#include <linux/kexec.h> +#include <linux/kexec_kernel.h> #include <linux/kernel.h> #include <linux/reboot.h> #include <linux/module.h> arch/sh/kernel/setup.c +1
-1@@ -20,7 +20,7 @@#include <linux/pfn.h> #include <linux/fs.h> #include <linux/mm.h> -#include <linux/kexec.h> +#include <linux/kexec_kernel.h> #include <linux/module.h> #include <linux/smp.h> #include <linux/err.h> arch/sh/kernel/traps_32.c +1
-1@@ -22,7 +22,7 @@#include <linux/bug.h> #include <linux/debug_locks.h> #include <linux/kdebug.h> -#include <linux/kexec.h> +#include <linux/kexec_kernel.h> #include <linux/limits.h> #include <linux/sysfs.h> #include <linux/uaccess.h> arch/x86/kernel/crash.c +1
-1@@ -12,7 +12,7 @@#include <linux/kernel.h> #include <linux/smp.h> #include <linux/reboot.h> -#include <linux/kexec.h> +#include <linux/kexec_kernel.h> #include <linux/delay.h> #include <linux/elf.h> #include <linux/elfcore.h> arch/x86/kernel/dumpstack.c +1
-1@@ -2,6 +2,7 @@* Copyright (C) 1991, 1992 Linus Torvalds * Copyright (C) 2000, 2001, 2002 Andi Kleen, SuSE Labs */ +#include <linux/kexec_kernel.h> #include <linux/kallsyms.h> #include <linux/kprobes.h> #include <linux/uaccess.h> @@ -11,7 +12,6 @@#include <linux/module.h> #include <linux/ptrace.h> #include <linux/ftrace.h> -#include <linux/kexec.h> #include <linux/bug.h> #include <linux/nmi.h> #include <linux/sysfs.h> arch/x86/kernel/dumpstack_32.c +0
-1@@ -9,7 +9,6 @@#include <linux/kdebug.h> #include <linux/module.h> #include <linux/ptrace.h> -#include <linux/kexec.h> #include <linux/sysfs.h> #include <linux/bug.h> #include <linux/nmi.h> arch/x86/kernel/dumpstack_64.c +0
-1@@ -9,7 +9,6 @@#include <linux/kdebug.h> #include <linux/module.h> #include <linux/ptrace.h> -#include <linux/kexec.h> #include <linux/sysfs.h> #include <linux/bug.h> #include <linux/nmi.h> arch/x86/kernel/machine_kexec_32.c +1
-1@@ -7,7 +7,7 @@*/ #include <linux/mm.h> -#include <linux/kexec.h> +#include <linux/kexec_kernel.h> #include <linux/delay.h> #include <linux/init.h> #include <linux/numa.h> arch/x86/kernel/machine_kexec_64.c +1
-1@@ -7,7 +7,7 @@*/ #include <linux/mm.h> -#include <linux/kexec.h> +#include <linux/kexec_kernel.h> #include <linux/string.h> #include <linux/gfp.h> #include <linux/reboot.h> arch/x86/kernel/setup.c +1
-1@@ -42,7 +42,7 @@#include <linux/edd.h> #include <linux/iscsi_ibft.h> #include <linux/nodemask.h> -#include <linux/kexec.h> +#include <linux/kexec_kernel.h> #include <linux/dmi.h> #include <linux/pfn.h> #include <linux/pci.h> arch/x86/kernel/setup_percpu.c +0
-1@@ -5,7 +5,6 @@#include <linux/init.h> #include <linux/bootmem.h> #include <linux/percpu.h> -#include <linux/kexec.h> #include <linux/crash_dump.h> #include <linux/smp.h> #include <linux/topology.h> arch/x86/kernel/traps.c +0
-1@@ -22,7 +22,6 @@#include <linux/string.h> #include <linux/delay.h> #include <linux/errno.h> -#include <linux/kexec.h> #include <linux/sched.h> #include <linux/timer.h> #include <linux/init.h> arch/x86/mm/numa_32.c +0
-1@@ -29,7 +29,6 @@#include <linux/initrd.h> #include <linux/nodemask.h> #include <linux/module.h> -#include <linux/kexec.h> #include <linux/pfn.h> #include <linux/swap.h> #include <linux/acpi.h> drivers/base/cpu.c +1
-1@@ -107,7 +107,7 @@ static inline void register_cpu_control(struct cpu *cpu)#endif /* CONFIG_HOTPLUG_CPU */ #ifdef CONFIG_KEXEC -#include <linux/kexec.h> +#include <linux/kexec_kernel.h> static ssize_t show_crash_notes (struct sys_device *dev,struct sysdev_attribute *attr,char *buf)include/linux/Kbuild +1
-0@@ -106,6 +106,7 @@ header-y += irda.h header-y += iso_fs.h header-y += ixjuser.h header-y += jffs2.h +header-y += kexec.h header-y += keyctl.h header-y += limits.h header-y += magic.hinclude/linux/crash_dump.h +0
-1@@ -2,7 +2,6 @@#define LINUX_CRASH_DUMP_H #ifdef CONFIG_CRASH_DUMP -#include <linux/kexec.h> #include <linux/device.h> #include <linux/proc_fs.h> include/linux/kexec.h +10
-190@@ -1,168 +1,9 @@#ifndef LINUX_KEXEC_H #define LINUX_KEXEC_H -#ifdef CONFIG_KEXEC -#include <linux/types.h> -#include <linux/list.h> -#include <linux/linkage.h> -#include <linux/compat.h> -#include <linux/ioport.h> -#include <linux/elfcore.h> -#include <linux/elf.h> -#include <asm/kexec.h> - -/* Verify architecture specific macros are defined */ - -#ifndef KEXEC_SOURCE_MEMORY_LIMIT -#error KEXEC_SOURCE_MEMORY_LIMIT not defined -#endif - -#ifndef KEXEC_DESTINATION_MEMORY_LIMIT -#error KEXEC_DESTINATION_MEMORY_LIMIT not defined -#endif - -#ifndef KEXEC_CONTROL_MEMORY_LIMIT -#error KEXEC_CONTROL_MEMORY_LIMIT not defined -#endif - -#ifndef KEXEC_CONTROL_PAGE_SIZE -#error KEXEC_CONTROL_PAGE_SIZE not defined -#endif - -#ifndef KEXEC_ARCH -#error KEXEC_ARCH not defined -#endif - -#define KEXEC_NOTE_HEAD_BYTES ALIGN(sizeof(struct elf_note), 4) -#define KEXEC_CORE_NOTE_NAME "CORE" -#define KEXEC_CORE_NOTE_NAME_BYTES ALIGN(sizeof(KEXEC_CORE_NOTE_NAME), 4) -#define KEXEC_CORE_NOTE_DESC_BYTES ALIGN(sizeof(struct elf_prstatus), 4) -/* -* The per-cpu notes area is a list of notes terminated by a "NULL" -* note header. For kdump, the code in vmcore.c runs in the context -* of the second kernel to combine them into one note. -*/ -#define KEXEC_NOTE_BYTES ( (KEXEC_NOTE_HEAD_BYTES * 2) + \ - KEXEC_CORE_NOTE_NAME_BYTES + \ - KEXEC_CORE_NOTE_DESC_BYTES ) -/* -* This structure is used to hold the arguments that are used when loading -* kernel binaries. +* Kexec: one kernel loading another */ - -typedef unsigned long kimage_entry_t ; -#define IND_DESTINATION 0x1 -#define IND_INDIRECTION 0x2 -#define IND_DONE 0x4 -#define IND_SOURCE 0x8 - -#define KEXEC_SEGMENT_MAX 16 -struct kexec_segment { -void __user *buf; -size_t bufsz; -unsigned long mem;/* User space sees this as a (void *) ... */ -size_t memsz; -}; - -#ifdef CONFIG_COMPAT -struct compat_kexec_segment { -compat_uptr_t buf; -compat_size_t bufsz; -compat_ulong_t mem;/* User space sees this as a (void *) ... */ -compat_size_t memsz; -}; -#endif - -struct kimage { -kimage_entry_t head; -kimage_entry_t *entry; -kimage_entry_t *last_entry; - -unsigned long destination; - -unsigned long start; -struct page *control_code_page; -struct page *swap_page; - -unsigned long nr_segments; -struct kexec_segment segment[KEXEC_SEGMENT_MAX ]; - -struct list_head control_pages; -struct list_head dest_pages; -struct list_head unuseable_pages; - -/* Address of next control page to allocate for crash kernels. */ -unsigned long control_page; - -/* Flags to indicate special processing */ -unsigned int type :1 ; -#define KEXEC_TYPE_DEFAULT 0 -#define KEXEC_TYPE_CRASH 1 -unsigned int preserve_context :1 ; - -#ifdef ARCH_HAS_KIMAGE_ARCH -struct kimage_arch arch; -#endif -}; - - - -/* kexec interface functions */ -extern void machine_kexec (struct kimage *image); -extern int machine_kexec_prepare (struct kimage *image); -extern void machine_kexec_cleanup (struct kimage *image); -extern asmlinkage long sys_kexec_load (unsigned long entry, -unsigned long nr_segments, -struct kexec_segment __user *segments, -unsigned long flags); -extern int kernel_kexec (void ); -#ifdef CONFIG_COMPAT -extern asmlinkage long compat_sys_kexec_load (unsigned long entry, -unsigned long nr_segments, -struct compat_kexec_segment __user *segments, -unsigned long flags); -#endif -extern struct page *kimage_alloc_control_pages (struct kimage *image, -unsigned int order); -extern void crash_kexec (struct pt_regs *); -int kexec_should_crash (struct task_struct *); -void crash_save_cpu (struct pt_regs *regs,int cpu); -void crash_save_vmcoreinfo (void ); -void arch_crash_save_vmcoreinfo (void ); -void vmcoreinfo_append_str (const char *fmt, ...) - __attribute__ ((format (printf,1 ,2 ))); -unsigned long paddr_vmcoreinfo_note (void ); - -#define VMCOREINFO_OSRELEASE (value) \ - vmcoreinfo_append_str("OSRELEASE=%s\n", value) -#define VMCOREINFO_PAGESIZE (value) \ - vmcoreinfo_append_str("PAGESIZE=%ld\n", value) -#define VMCOREINFO_SYMBOL (name) \ - vmcoreinfo_append_str("SYMBOL(%s)=%lx\n", #name, (unsigned long)&name) -#define VMCOREINFO_SIZE (name) \ - vmcoreinfo_append_str("SIZE(%s)=%lu\n", #name, \ - (unsigned long)sizeof(name)) -#define VMCOREINFO_STRUCT_SIZE (name) \ - vmcoreinfo_append_str("SIZE(%s)=%lu\n", #name, \ - (unsigned long)sizeof(struct name)) -#define VMCOREINFO_OFFSET (name, field) \ - vmcoreinfo_append_str("OFFSET(%s.%s)=%lu\n", #name, #field, \ - (unsigned long)offsetof(struct name, field)) -#define VMCOREINFO_LENGTH (name, value) \ - vmcoreinfo_append_str("LENGTH(%s)=%lu\n", #name, (unsigned long)value) -#define VMCOREINFO_NUMBER (name) \ - vmcoreinfo_append_str("NUMBER(%s)=%ld\n", #name, (long)name) -#define VMCOREINFO_CONFIG (name) \ - vmcoreinfo_append_str("CONFIG_%s=y\n", #name) - -extern struct kimage *kexec_image; -extern struct kimage *kexec_crash_image; - -#ifndef kexec_flush_icache_page -#define kexec_flush_icache_page (page) -#endif -#define KEXEC_ON_CRASH 0x00000001#define KEXEC_PRESERVE_CONTEXT 0x00000002#define KEXEC_ARCH_MASK 0xffff0000@@ -182,37 +23,16 @@ extern struct kimage *kexec_crash_image;#define KEXEC_ARCH_MIPS_LE (10 << 16)#define KEXEC_ARCH_MIPS ( 8 << 16) -/* List of defined/legal kexec flags */ -#ifndef CONFIG_KEXEC_JUMP -#define KEXEC_FLAGS KEXEC_ON_CRASH +#define KEXEC_SEGMENT_MAX 16 +struct kexec_segment { +void __user *buf; +size_t bufsz; +#ifdef __KERNEL__ +unsigned long mem;/* User space sees this as a (void *) ... */ #else -#define KEXEC_FLAGS (KEXEC_ON_CRASH | KEXEC_PRESERVE_CONTEXT) +void *mem;#endif +size_t memsz; +}; -#define VMCOREINFO_BYTES (4096) -#define VMCOREINFO_NOTE_NAME "VMCOREINFO" -#define VMCOREINFO_NOTE_NAME_BYTES ALIGN(sizeof(VMCOREINFO_NOTE_NAME), 4) -#define VMCOREINFO_NOTE_SIZE (KEXEC_NOTE_HEAD_BYTES*2 + VMCOREINFO_BYTES \ - + VMCOREINFO_NOTE_NAME_BYTES) - -/* Location of a reserved region to hold the crash kernel. -*/ -extern struct resource crashk_res; -typedef u32 note_buf_t [KEXEC_NOTE_BYTES /4 ]; -extern note_buf_t __percpu *crash_notes; -extern u32 vmcoreinfo_note[VMCOREINFO_NOTE_SIZE /4 ]; -extern size_t vmcoreinfo_size; -extern size_t vmcoreinfo_max_size; - -int __init parse_crashkernel (char *cmdline,unsigned long long system_ram, -unsigned long long *crash_size,unsigned long long *crash_base); -int crash_shrink_memory (unsigned long new_size); -size_t crash_get_memory_size (void ); - -#else /* !CONFIG_KEXEC */ -struct pt_regs ; -struct task_struct ; -static inline void crash_kexec (struct pt_regs *regs) { } -static inline int kexec_should_crash (struct task_struct *p) {return 0 ; } -#endif /* CONFIG_KEXEC */ #endif /* LINUX_KEXEC_H */ include/linux/kexec_kernel.h new file +193
-0@@ -0,0 +1,193 @@ +#ifndef LINUX_KEXEC_KERNEL_H +#define LINUX_KEXEC_KERNEL_H + +#ifdef CONFIG_KEXEC +#include <linux/types.h> +#include <linux/list.h> +#include <linux/linkage.h> +#include <linux/compat.h> +#include <linux/ioport.h> +#include <linux/elfcore.h> +#include <linux/elf.h> +#include <asm/kexec.h> + +#include <linux/kexec.h> + +/* Verify architecture specific macros are defined */ + +#ifndef KEXEC_SOURCE_MEMORY_LIMIT +#error KEXEC_SOURCE_MEMORY_LIMIT not defined +#endif + +#ifndef KEXEC_DESTINATION_MEMORY_LIMIT +#error KEXEC_DESTINATION_MEMORY_LIMIT not defined +#endif + +#ifndef KEXEC_CONTROL_MEMORY_LIMIT +#error KEXEC_CONTROL_MEMORY_LIMIT not defined +#endif + +#ifndef KEXEC_CONTROL_PAGE_SIZE +#error KEXEC_CONTROL_PAGE_SIZE not defined +#endif + +#ifndef KEXEC_ARCH +#error KEXEC_ARCH not defined +#endif + +#define KEXEC_NOTE_HEAD_BYTES ALIGN(sizeof(struct elf_note), 4) +#define KEXEC_CORE_NOTE_NAME "CORE" +#define KEXEC_CORE_NOTE_NAME_BYTES ALIGN(sizeof(KEXEC_CORE_NOTE_NAME), 4) +#define KEXEC_CORE_NOTE_DESC_BYTES ALIGN(sizeof(struct elf_prstatus), 4) +/* +* The per-cpu notes area is a list of notes terminated by a "NULL" +* note header. For kdump, the code in vmcore.c runs in the context +* of the second kernel to combine them into one note. +*/ +#define KEXEC_NOTE_BYTES ( (KEXEC_NOTE_HEAD_BYTES * 2) + \ + KEXEC_CORE_NOTE_NAME_BYTES + \ + KEXEC_CORE_NOTE_DESC_BYTES ) + +/* +* This structure is used to hold the arguments that are used when loading +* kernel binaries. +*/ + +typedef unsigned long kimage_entry_t ; +#define IND_DESTINATION 0x1 +#define IND_INDIRECTION 0x2 +#define IND_DONE 0x4 +#define IND_SOURCE 0x8 + +#ifdef CONFIG_COMPAT +struct compat_kexec_segment { +compat_uptr_t buf; +compat_size_t bufsz; +compat_ulong_t mem;/* User space sees this as a (void *) ... */ +compat_size_t memsz; +}; +#endif + +struct kimage { +kimage_entry_t head; +kimage_entry_t *entry; +kimage_entry_t *last_entry; + +unsigned long destination; + +unsigned long start; +struct page *control_code_page; +struct page *swap_page; + +unsigned long nr_segments; +struct kexec_segment segment[KEXEC_SEGMENT_MAX ]; + +struct list_head control_pages; +struct list_head dest_pages; +struct list_head unuseable_pages; + +/* Address of next control page to allocate for crash kernels. */ +unsigned long control_page; + +/* Flags to indicate special processing */ +unsigned int type :1 ; +#define KEXEC_TYPE_DEFAULT 0 +#define KEXEC_TYPE_CRASH 1 +unsigned int preserve_context :1 ; + +#ifdef ARCH_HAS_KIMAGE_ARCH +struct kimage_arch arch; +#endif +}; + + + +/* kexec interface functions */ +extern void machine_kexec (struct kimage *image); +extern int machine_kexec_prepare (struct kimage *image); +extern void machine_kexec_cleanup (struct kimage *image); +extern asmlinkage long sys_kexec_load (unsigned long entry, +unsigned long nr_segments, +struct kexec_segment __user *segments, +unsigned long flags); +extern int kernel_kexec (void ); +#ifdef CONFIG_COMPAT +extern asmlinkage long compat_sys_kexec_load (unsigned long entry, +unsigned long nr_segments, +struct compat_kexec_segment __user *segments, +unsigned long flags); +#endif +extern struct page *kimage_alloc_control_pages (struct kimage *image, +unsigned int order); +extern void crash_kexec (struct pt_regs *); +int kexec_should_crash (struct task_struct *); +void crash_save_cpu (struct pt_regs *regs,int cpu); +void crash_save_vmcoreinfo (void ); +void arch_crash_save_vmcoreinfo (void ); +void vmcoreinfo_append_str (const char *fmt, ...) + __attribute__ ((format (printf,1 ,2 ))); +unsigned long paddr_vmcoreinfo_note (void ); + +#define VMCOREINFO_OSRELEASE (value) \ + vmcoreinfo_append_str("OSRELEASE=%s\n", value) +#define VMCOREINFO_PAGESIZE (value) \ + vmcoreinfo_append_str("PAGESIZE=%ld\n", value) +#define VMCOREINFO_SYMBOL (name) \ + vmcoreinfo_append_str("SYMBOL(%s)=%lx\n", #name, (unsigned long)&name) +#define VMCOREINFO_SIZE (name) \ + vmcoreinfo_append_str("SIZE(%s)=%lu\n", #name, \ + (unsigned long)sizeof(name)) +#define VMCOREINFO_STRUCT_SIZE (name) \ + vmcoreinfo_append_str("SIZE(%s)=%lu\n", #name, \ + (unsigned long)sizeof(struct name)) +#define VMCOREINFO_OFFSET (name, field) \ + vmcoreinfo_append_str("OFFSET(%s.%s)=%lu\n", #name, #field, \ + (unsigned long)offsetof(struct name, field)) +#define VMCOREINFO_LENGTH (name, value) \ + vmcoreinfo_append_str("LENGTH(%s)=%lu\n", #name, (unsigned long)value) +#define VMCOREINFO_NUMBER (name) \ + vmcoreinfo_append_str("NUMBER(%s)=%ld\n", #name, (long)name) +#define VMCOREINFO_CONFIG (name) \ + vmcoreinfo_append_str("CONFIG_%s=y\n", #name) + +extern struct kimage *kexec_image; +extern struct kimage *kexec_crash_image; + +#ifndef kexec_flush_icache_page +#define kexec_flush_icache_page (page) +#endif + +/* List of defined/legal kexec flags */ +#ifndef CONFIG_KEXEC_JUMP +#define KEXEC_FLAGS KEXEC_ON_CRASH +#else +#define KEXEC_FLAGS (KEXEC_ON_CRASH | KEXEC_PRESERVE_CONTEXT) +#endif + +#define VMCOREINFO_BYTES (4096) +#define VMCOREINFO_NOTE_NAME "VMCOREINFO" +#define VMCOREINFO_NOTE_NAME_BYTES ALIGN(sizeof(VMCOREINFO_NOTE_NAME), 4) +#define VMCOREINFO_NOTE_SIZE (KEXEC_NOTE_HEAD_BYTES*2 + VMCOREINFO_BYTES \ + + VMCOREINFO_NOTE_NAME_BYTES) + +/* Location of a reserved region to hold the crash kernel. +*/ +extern struct resource crashk_res; +typedef u32 note_buf_t [KEXEC_NOTE_BYTES /4 ]; +extern note_buf_t __percpu *crash_notes; +extern u32 vmcoreinfo_note[VMCOREINFO_NOTE_SIZE /4 ]; +extern size_t vmcoreinfo_size; +extern size_t vmcoreinfo_max_size; + +int __init parse_crashkernel (char *cmdline,unsigned long long system_ram, +unsigned long long *crash_size,unsigned long long *crash_base); +int crash_shrink_memory (unsigned long new_size); +size_t crash_get_memory_size (void ); + +#else /* !CONFIG_KEXEC */ +struct pt_regs ; +struct task_struct ; +static inline void crash_kexec (struct pt_regs *regs) { } +static inline int kexec_should_crash (struct task_struct *p) {return 0 ; } +#endif /* CONFIG_KEXEC */ +#endif /* LINUX_KEXEC_KERNEL_H */ init/initramfs.c +1
-1@@ -485,7 +485,7 @@ __setup("retain_initrd", retain_initrd_param);extern char __initramfs_start[], __initramfs_end[];#include <linux/initrd.h> -#include <linux/kexec.h> +#include <linux/kexec_kernel.h> static void __init free_initrd (void ) {kernel/kexec.c +1
-1@@ -11,7 +11,7 @@#include <linux/file.h> #include <linux/slab.h> #include <linux/fs.h> -#include <linux/kexec.h> +#include <linux/kexec_kernel.h> #include <linux/mutex.h> #include <linux/list.h> #include <linux/highmem.h> kernel/ksysfs.c +1
-1@@ -13,7 +13,7 @@#include <linux/sysfs.h> #include <linux/module.h> #include <linux/init.h> -#include <linux/kexec.h> +#include <linux/kexec_kernel.h> #include <linux/profile.h> #include <linux/sched.h> kernel/panic.c +1
-1@@ -8,6 +8,7 @@* This function is used through-out the kernel (including mm and fs) * to indicate a major problem. */ +#include <linux/kexec_kernel.h> #include <linux/debug_locks.h> #include <linux/interrupt.h> #include <linux/kmsg_dump.h> @@ -17,7 +18,6 @@#include <linux/random.h> #include <linux/reboot.h> #include <linux/delay.h> -#include <linux/kexec.h> #include <linux/sched.h> #include <linux/sysrq.h> #include <linux/init.h> kernel/printk.c +1
-1@@ -32,7 +32,7 @@#include <linux/security.h> #include <linux/bootmem.h> #include <linux/syscalls.h> -#include <linux/kexec.h> +#include <linux/kexec_kernel.h> #include <linux/kdb.h> #include <linux/ratelimit.h> #include <linux/kmsg_dump.h> kernel/sys.c +1
-1@@ -16,7 +16,7 @@#include <linux/perf_event.h> #include <linux/resource.h> #include <linux/kernel.h> -#include <linux/kexec.h> +#include <linux/kexec_kernel.h> #include <linux/workqueue.h> #include <linux/capability.h> #include <linux/device.h> Signature · 1 line
1.6.0.6
Re: [PATCH] kexec: export kexec.h to userspace
Quoted 3 lines
Can we please do this the other way around and create a
kexec_user.h? Having a anxxx_user.his a pattern we already have in the kernel. I can't find a signlexxxx_kernel.h
If you do that you have to change the man page.
Or just keep my simple patch.
-Andi
_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec
Re: [PATCH] kexec: export kexec.h to userspace
Quoted 7 lines · Andi Kleen
Quoted 3 lines
Can we please do this the other way around and create a
kexec_user.h? Having a anxxx_user.his a pattern we already have in the kernel. I can't find a signlexxxx_kernel.hIf you do that you have to change the man page.
Or just keep my simple patch.
It seems more logical to me to update the documentation - its new documentation, isn't it?
_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec
Quoted 10 lines · Andi Kleen
Export
kexec.h
kexec_loadis a system call and it needs a header
file with its input arguments.Export the parts of
kexec.hneeded for this.Signed-off-by Andi Kleen <[email protected]>
Is there a corresponding patch for /sbin/kexec ?
What is the reason for wanting to export a currently kernel only header?
Not that I am really opposed but without a bit more context I can't make a reasonable review of these patches.
Eric
Quoted 109 lines
include/linux/Kbuild +2
-0@@ -389,3 +389,5 @@ unifdef-y += xfrm.h objhdr-y += version.h header-y += wimax.h header-y += wimax/ + +unifdef-y += kexec.hinclude/linux/kexec.h +40
-28@@ -1,8 +1,46 @@#ifndef LINUX_KEXEC_H #define LINUX_KEXEC_H -#ifdef CONFIG_KEXEC +/* Kexec: one kernel loading another */ + +#ifdef __KERNEL__ +#include <linux/compiler.h> #include <linux/types.h> +#endif + +#define KEXEC_ON_CRASH 0x00000001 +#define KEXEC_PRESERVE_CONTEXT 0x00000002 +#define KEXEC_ARCH_MASK 0xffff0000 + +/* These values match the ELF architecture values. +* Unless there is a good reason that should continue to be the case. +*/ +#define KEXEC_ARCH_DEFAULT ( 0 << 16) +#define KEXEC_ARCH_386 ( 3 << 16) +#define KEXEC_ARCH_X86_64 (62 << 16) +#define KEXEC_ARCH_PPC (20 << 16) +#define KEXEC_ARCH_PPC64 (21 << 16) +#define KEXEC_ARCH_IA_64 (50 << 16) +#define KEXEC_ARCH_ARM (40 << 16) +#define KEXEC_ARCH_S390 (22 << 16) +#define KEXEC_ARCH_SH (42 << 16) +#define KEXEC_ARCH_MIPS_LE (10 << 16) +#define KEXEC_ARCH_MIPS ( 8 << 16) + +#define KEXEC_SEGMENT_MAX 16 +struct kexec_segment { +void __user *buf; +size_t bufsz; +#ifdef __KERNEL__ +unsigned long mem;/* User space sees this as a (void *) ... */ +#else +void *mem; +#endif +size_t memsz; +}; + +#ifdef __KERNEL__ +#ifdef CONFIG_KEXEC #include <linux/list.h> #include <linux/linkage.h> #include <linux/compat.h> @@ -57,14 +95,6 @@ typedef unsigned long kimage_entry_t;#define IND_DONE 0x4#define IND_SOURCE 0x8 -#define KEXEC_SEGMENT_MAX 16 -struct kexec_segment { -void __user *buf; -size_t bufsz; -unsigned long mem;/* User space sees this as a (void *) ... */ -size_t memsz; -}; - #ifdef CONFIG_COMPAT struct compat_kexec_segment { compat_uptr_t buf;@@ -163,25 +193,6 @@ extern struct kimage *kexec_crash_image;#define kexec_flush_icache_page (page)#endif -#define KEXEC_ON_CRASH 0x00000001 -#define KEXEC_PRESERVE_CONTEXT 0x00000002 -#define KEXEC_ARCH_MASK 0xffff0000 - -/* These values match the ELF architecture values. -* Unless there is a good reason that should continue to be the case. -*/ -#define KEXEC_ARCH_DEFAULT ( 0 << 16) -#define KEXEC_ARCH_386 ( 3 << 16) -#define KEXEC_ARCH_X86_64 (62 << 16) -#define KEXEC_ARCH_PPC (20 << 16) -#define KEXEC_ARCH_PPC64 (21 << 16) -#define KEXEC_ARCH_IA_64 (50 << 16) -#define KEXEC_ARCH_ARM (40 << 16) -#define KEXEC_ARCH_S390 (22 << 16) -#define KEXEC_ARCH_SH (42 << 16) -#define KEXEC_ARCH_MIPS_LE (10 << 16) -#define KEXEC_ARCH_MIPS ( 8 << 16) -/* List of defined/legal kexec flags */ #ifndef CONFIG_KEXEC_JUMP #define KEXEC_FLAGS KEXEC_ON_CRASH@@ -215,4 +226,5 @@ struct task_struct;static inline void crash_kexec (struct pt_regs *regs) { }static inline int kexec_should_crash (struct task_struct *p) {return 0 ; }#endif /* CONFIG_KEXEC */ +#endif #endif /* LINUX_KEXEC_H */
Quoted 1 line
Is there a corresponding patch for
/sbin/kexec?
No. This would be mostly for new users.
Quoted 1 line
What is the reason for wanting to export a currently kernel only header?
I wrote a manpage and realized the system call is unusable without a header.
-Andi