1 .\" Hey Emacs! This file is -*- nroff -*- source.
3 .\" Copyright (C) 2010 Andi Kleen
5 .\" Permission is granted to make and distribute verbatim copies of this
6 .\" manual provided the copyright notice and this permission notice are
7 .\" preserved on all copies.
9 .\" Permission is granted to copy and distribute modified versions of this
10 .\" manual under the conditions for verbatim copying, provided that the
11 .\" entire resulting derived work is distributed under the terms of a
12 .\" permission notice identical to this one.
14 .\" Since the Linux kernel and libraries are constantly changing, this
15 .\" manual page may be incorrect or out-of-date. The author(s) assume no
16 .\" responsibility for errors or omissions, or for damages resulting from
17 .\" the use of the information contained herein. The author(s) may not
18 .\" have taken the same level of care in the production of this manual,
19 .\" which is licensed free of charge, as they might when working
22 .\" Formatted or processed versions of this manual, if unaccompanied by
23 .\" the source, must acknowledge the copyright and authors of this work.
24 .TH KEXEC_LOAD 2 2010-10-31 "Linux" "Linux Programmer's Manual"
26 kexec_load \- load a new kernel for later execution
28 .b #include <linux/kexec.h>
30 .BI "long kexec_load(unsigned long " entry ", unsigned long " nr_segments ","
32 .BI " struct kexec_segment *" segments \
33 ", unsigned long " flags ");"
37 system call loads a new kernel that can be executed later by
42 argument is a mask whose high-order bits control the operation of the call.
43 The following values can be specified in
47 Execute the new kernel automatically on a system crash.
48 .\" FIXME figure out how this is really used
50 .B KEXEC_PRESERVE_CONTEXT
51 Preserve the system hardware and
52 software states before executing the new kernel.
53 This could be used for system suspend.
54 This flag is only available if the kernel was configured with
55 .BR CONFIG_KEXEC_JUMP ,
56 and is only effective if
62 contain the architecture of the to-be-executed kernel.
63 Specify (OR) the constant
65 to use the current architecture,
66 or one of the following architecture constants
68 .BR KEXEC_ARCH_X86_64 ,
70 .BR KEXEC_ARCH_PPC64 ,
71 .BR KEXEC_ARCH_IA_64 ,
77 .BR KEXEC_ARCH_MIPS_LE .
78 The architecture must be executable on the CPU of the system.
82 argument is the physical entry address in the kernel image.
85 argument is the number of segments pointed to by the
90 argument is an array of
92 structures which define the kernel layout:
96 struct kexec_segment {
97 void *buf; /* Buffer in user space */
98 size_t bufsz; /* Buffer length in user space */
99 void *mem; /* Physical address of kernel */
100 size_t memsz; /* Physical address length */
105 .\" FIXME elaborate on the following:
106 The kernel image defined by
108 is copied from the calling process into previously reserved memory.
113 On error, -1 is returned and
115 is set to indicate the error.
119 Another crash kernel is already being loaded
120 or a crash kernel is already in use.
125 .IR nr_segments is too large
126 .\" KEXEC_SEGMENT_MAX == 16
129 The caller does not have the
135 system call first appeared in Linux 2.6.7.
137 This system call is Linux-specific.
139 Currently, there is no glibc support for
144 The required constants are in the kernel source file
146 which is not currently exported to glibc.
147 .\" FIXME Andi submitted a patch for this.
148 .\" Check if it got accepted later.
149 Therefore, these constants must be defined manually.
151 This system call is only available if the kernel was configured with