diff options
| author | Eric W. Biederman <ebiederm@xmission.com> | 2005-06-25 17:57:52 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-06-25 19:24:48 -0400 |
| commit | dc009d92435f99498cbc579ce76bf28e837e2c14 (patch) | |
| tree | 2ba8732b28225593d996b8faa079dc6ab4bbc9bc /kernel/sys.c | |
| parent | d0537508a9921efced238b20967e50e519ac34af (diff) | |
[PATCH] kexec: add kexec syscalls
This patch introduces the architecture independent implementation the
sys_kexec_load, the compat_sys_kexec_load system calls.
Kexec on panic support has been integrated into the core patch and is
relatively clean.
In addition the hopefully architecture independent option
crashkernel=size@location has been docuemented. It's purpose is to reserve
space for the panic kernel to live, and where no DMA transfer will ever be
setup to access.
Signed-off-by: Eric Biederman <ebiederm@xmission.com>
Signed-off-by: Alexander Nyberg <alexn@telia.com>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Vivek Goyal <vgoyal@in.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel/sys.c')
| -rw-r--r-- | kernel/sys.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/kernel/sys.c b/kernel/sys.c index dac10161ca2..9a24374c23b 100644 --- a/kernel/sys.c +++ b/kernel/sys.c | |||
| @@ -16,6 +16,8 @@ | |||
| 16 | #include <linux/init.h> | 16 | #include <linux/init.h> |
| 17 | #include <linux/highuid.h> | 17 | #include <linux/highuid.h> |
| 18 | #include <linux/fs.h> | 18 | #include <linux/fs.h> |
| 19 | #include <linux/kernel.h> | ||
| 20 | #include <linux/kexec.h> | ||
| 19 | #include <linux/workqueue.h> | 21 | #include <linux/workqueue.h> |
| 20 | #include <linux/device.h> | 22 | #include <linux/device.h> |
| 21 | #include <linux/key.h> | 23 | #include <linux/key.h> |
| @@ -439,6 +441,24 @@ asmlinkage long sys_reboot(int magic1, int magic2, unsigned int cmd, void __user | |||
| 439 | machine_restart(buffer); | 441 | machine_restart(buffer); |
| 440 | break; | 442 | break; |
| 441 | 443 | ||
| 444 | #ifdef CONFIG_KEXEC | ||
| 445 | case LINUX_REBOOT_CMD_KEXEC: | ||
| 446 | { | ||
| 447 | struct kimage *image; | ||
| 448 | image = xchg(&kexec_image, 0); | ||
| 449 | if (!image) { | ||
| 450 | unlock_kernel(); | ||
| 451 | return -EINVAL; | ||
| 452 | } | ||
| 453 | notifier_call_chain(&reboot_notifier_list, SYS_RESTART, NULL); | ||
| 454 | system_state = SYSTEM_RESTART; | ||
| 455 | device_shutdown(); | ||
| 456 | printk(KERN_EMERG "Starting new kernel\n"); | ||
| 457 | machine_shutdown(); | ||
| 458 | machine_kexec(image); | ||
| 459 | break; | ||
| 460 | } | ||
| 461 | #endif | ||
| 442 | #ifdef CONFIG_SOFTWARE_SUSPEND | 462 | #ifdef CONFIG_SOFTWARE_SUSPEND |
| 443 | case LINUX_REBOOT_CMD_SW_SUSPEND: | 463 | case LINUX_REBOOT_CMD_SW_SUSPEND: |
| 444 | { | 464 | { |
