1KEXEC_LOAD(2)                 Linux System Calls                 KEXEC_LOAD(2)
2
3
4

NAME

6       kexec_load - loads a new kernel image to memory
7

SYNOPSIS

9       #include <syscall.h>
10       #include <kexec.h>
11
12       long kexec_load(unsigned long entry, unsigned long nr_segments,
13                      struct kexec_segment *segments, unsigned long flags);
14

DESCRIPTION

16       kexec_load  loads  the new kernel from the current address space.  This
17       system call can only be used by root.
18
19
20       entry is a pointer to the entry point of newly loaded executable image.
21       This is the memory location where kernel will jump to and start execut‐
22       ing instructions of newly loaded image.
23
24       nr_segments denotes the number of segments  which  will  be  passed  to
25       kexec_load.  The value must not be greater than KEXEC_SEGMENT_MAX.
26
27       segments  denotes  a  pointer  to  the  first  element  of  an array of
28       kexec_segment elements. A kexec_segment element contains the details of
29       a segment to be loaded in memory.
30
31       flags Sixteen most significant bits of the flag are used to communicate
32       the architecture information (KEXEC_ARCH_*).  The  values  for  various
33       architectures are same as defined by ELF specifications.
34
35       Lower  sixteen  bits  have been reserved for miscellaneous information.
36       Currently only one bit  is  being  used  and  rest  fifteen  have  been
37       reserved for future use.
38
39       The  least  significant  bit  (KEXEC_ON_CRASH) can be set to inform the
40       kernel that the memory memory image being loaded is to be executed upon
41       a  system  crash  and  not  regular boot. For regular boot, this bit is
42       cleared.
43
44

RETURN VALUE

46       On  success,   zero   is   returned.    On   error,  nonzero  value  is
47       returned, and errno is set appropriately.
48
49
50

ERRORS

52       EPERM the calling process has not sufficient permissions (is not root).
53
54       EINVAL  the flags argument contains an invalid combination of flags, or
55       nr_segments is greater than KEXEC_SEGMENT_MAX.
56
57       ENOMEM there is not enough memory to store the kernel image.
58
59       EBUSY the memory location which should be written to is  not  available
60       now.
61
62

AVAILABILITY

64       This syscall is implemented only since kernel 2.6.13
65
66
67
68Linux                          4 September 2006                  KEXEC_LOAD(2)
Impressum