内容简介
#include <syscall.h> #include <kexec.h>
long kexec_load(unsigned long entry, unsigned long nr_segments, %uA0%uA0 |
描述
kexec_load%uA0加载从当前地址空间中的新内核。这个系统调用只能用于由root。条目是一个指向新加载的可执行映像的入口点。这是内核将跳转到并开始执行新加载的图像的指令的存储器位置。
nr_segmentsꃞnotes the number of segments which will be passed to%uA0kexec_load. The value must not be greater than%uA0KEXEC_SEGMENT_MAX.
segmentsꃞnotes a pointer to the first element of an array of%uA0kexec_segmentelements. A%uA0kexec_segment%uA0element contains the details of a segment to be loaded in memory.
flags%uA0Sixteen most significant bits of the flag are used to communicate the architecture information (KEXEC_ARCH_*). The values for various architectures are same as defined by ELF specifications.%uA0 Lower sixteen bits have been reserved for miscellaneous information. Currently only one bit is being used and rest fifteen have been reserved for future use.%uA0 The least significant bit (KEXEC_ON_CRASH) can be set to inform the kernel that the memory memory image being loaded is to be executed upon a system crash and not regular boot. For regular boot, this bit is cleared.
返回值
On success, zero is returned. On error, nonzero value is returned, and%uA0errno%uA0is set appropriately.%uA0错误
EPERM%uA0the calling process has not sufficient permissions (is not root).EINVAL%uA0the%uA0flags%uA0argument contains an invalid combination of flags, or%uA0nr_segments%uA0is greater than%uA0KEXEC_SEGMENT_MAX.
ENOMEM%uA0there is not enough memory to store the kernel image.
EBUSY%uA0the memory location which should be written to is not available now.
%uA0