kexec: kexec-generic
PATCH 8/14 kexec: kexec-generic
Here is the architecture independent part of kexec.
MAINTAINERS +11 -0
@@ -1244,6 +1244,17 @@ W: http://www.cse.unsw.edu.au/~neilb/patches/linux-devel/ S: Maintained +KEXEC +P: Eric Biederman +P: Randy Dunlap +M: [email protected] +M: [email protected] +W: http://www.xmission.com/~ebiederm/files/kexec/ +W: http://developer.osdl.org/rddunlap/kexec/ +L: [email protected] +L: [email protected] +S: Maintained + LANMEDIA WAN CARD DRIVER P: Andrew Stanley-Jones M: [email protected]
include/linux/kexec.h +56 -0
56 lines not on this page · raw message
include/linux/reboot.h +2 -0
@@ -51,6 +51,8 @@extern void machine_halt (void );extern void machine_power_off (void ); +extern void machine_shutdown (void ); +#endif #endif /* _LINUX_REBOOT_H */
kernel/Makefile +1 -0
@@ -18,6 +18,7 @@ obj-$(CONFIG_KALLSYMS) += kallsyms.o obj-$(CONFIG_PM) += power/ obj-$(CONFIG_BSD_PROCESS_ACCT) += acct.o +obj-$(CONFIG_KEXEC) += kexec.o obj-$(CONFIG_COMPAT) += compat.o obj-$(CONFIG_IKCONFIG) += configs.o obj-$(CONFIG_IKCONFIG_PROC) += configs.o
kernel/kexec.c +640 -0
640 lines not on this page · raw message
kernel/sys.c +21 -0
@@ -17,6 +17,8 @@#include <linux/init.h> #include <linux/highuid.h> #include <linux/fs.h> +#include <linux/kernel.h> +#include <linux/kexec.h> #include <linux/workqueue.h> #include <linux/device.h> #include <linux/times.h>
@@ -225,6 +227,7 @@ cond_syscall(sys_lookup_dcookie) cond_syscall(sys_swapon) cond_syscall(sys_swapoff) +cond_syscall(sys_kexec_load) cond_syscall(sys_init_module) cond_syscall(sys_delete_module) cond_syscall(sys_socketpair)
@@ -510,6 +513,24 @@machine_restart (buffer);break ; +#ifdef CONFIG_KEXEC +case LINUX_REBOOT_CMD_KEXEC : + { +struct kimage *image; + image =xchg (&kexec_image,0 ); +if (!image) { +unlock_kernel (); +return -EINVAL ; + } +notifier_call_chain (&reboot_notifier_list,SYS_RESTART ,NULL ); + system_state =SYSTEM_BOOTING ; +device_shutdown (); +printk (KERN_EMERG "Starting new kernel\n" ); +machine_shutdown (); +machine_kexec (image); +break ; + } +#endif #ifdef CONFIG_SOFTWARE_SUSPEND case LINUX_REBOOT_CMD_SW_SUSPEND : {