1 .TH KEXEC_LOAD 2 2010-06-16 "Linux" "Linux Programmer's Manual"
3 kexec_load \- Load a new kernel for later execution.
5 .b #include <linux/kexec.h>
7 .BI "long kexec_load(unsigned long " entry ", unsigned long " nr_segments ","
9 .BI "struct kexec_segment *" segments ", unsigned long " flags ");"
12 loads a new kernel that can be executed later
15 An alternative approach is to specify
19 argument and then the new kernel will be automatically executed on a
21 .\" XXX figure out how this is really used
23 .B KEXEC_PRESERVE_CONTEXT
26 kexec will preserve the system hard and
27 software state before executing the kexec kernel. This
28 could be used for system suspend.
31 also contains the architecture of the executed kernel or
34 for the current architecture.
35 Valid architectures are
45 .I KEXEC_ARCH_MIPS_LE.
46 The architecture must be executable on the CPU of the system.
49 is the virtual entry address in the kernel image.
51 is the number of segments pointed to by the
56 .I struct kexec_segment
57 structures which define the kernel layout:
61 struct kexec_segment {
62 void *buf; /* Buffer in user space */
63 size_t bufsz; /* Buffer length in user space */
64 void *mem; /* Virtual address of kernel */
65 size_t memsz; /* Virtual address length */
70 .\" XXX elaborate on this
71 The kernel image defined by
73 is copied from the calling process into previously reserved memory.
75 This system call is Linux-specific.
77 kexec_load is currently not defined in glibc. To call it use:
82 #include <asm/unistd.h>
83 #include <linux/kexec.h>
85 ret = syscall(__NR_kexec_load, entry, nr_segments, segments, flags);
89 .I linux/kexec.h as a exported header is only available in 2.6.38
90 and later kernels, in earlier kernels the constants need to be copied
91 out of the kernel source.