.\" Copyright (C) 2010 Intel Corporation .\" Author: Andi Kleen .\" .\" %%%LICENSE_START(VERBATIM) .\" Permission is granted to make and distribute verbatim copies of this .\" manual provided the copyright notice and this permission notice are .\" preserved on all copies. .\" .\" Permission is granted to copy and distribute modified versions of this .\" manual under the conditions for verbatim copying, provided that the .\" entire resulting derived work is distributed under the terms of a .\" permission notice identical to this one. .\" .\" Since the Linux kernel and libraries are constantly changing, this .\" manual page may be incorrect or out-of-date. The author(s) assume no .\" responsibility for errors or omissions, or for damages resulting from .\" the use of the information contained herein. The author(s) may not .\" have taken the same level of care in the production of this manual, .\" which is licensed free of charge, as they might when working .\" professionally. .\" .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. .\" %%%LICENSE_END .\" .\"******************************************************************* .\" .\" This file was generated with po4a. Translate the source file. .\" .\"******************************************************************* .\" Japanese Version Copyright (c) 2012 Akihiro MOTOKI .\" all rights reserved. .\" Translated 2012-05-05, Akihiro MOTOKI .\" Updated 2013-05-06, Akihiro MOTOKI .\" .TH KEXEC_LOAD 2 2012\-07\-13 Linux "Linux Programmer's Manual" .SH 名前 kexec_load \- 新しいカーネルを後で実行するためにロードする .SH 書式 \fB#include \fP .br \fBlong kexec_load(unsigned long \fP\fIentry\fP\fB, unsigned long \fP\fInr_segments\fP\fB,\fP .br \fB struct kexec_segment *\fP\fIsegments\fP\fB, unsigned long \fP\fIflags\fP\fB);\fP \fI注\fP: このシステムコールには glibc のラッパー関数は存在しない。「注意」の節を参照。 .SH 説明 \fBkexec_load\fP() システムコールは、新しいカーネルをロードし、 その後の \fBreboot\fP(2) で実行できるようにする。 .PP \fIflags\fP 引き数はマスクビットで、 その上位ビットでシステムコールの呼び出しの動作を制御する。 \fIflags\fP には以下の値を指定できる。 .TP \fBKEXEC_ON_CRASH\fP (Linux 2.6.13 以降) .\" FIXME figure out how this is really used システムのクラッシュ時に、新しいカーネルを自動的に実行する。 .TP \fBKEXEC_PRESERVE_CONTEXT\fP (Linux 2.6.27 以降) 新しいカーネルを実行する前に、 システムのハードウェアとソフトウェアの状態を保存する。 システムの中断時 (suspend) などで使用できる。 このフラグは、カーネルの設定で \fBCONFIG_KEXEC_JUMP\fP が有効の場合のみ 利用可能であり、 \fInr_segments\fP が 0 より大きい場合のみ効果がある。 .PP \fIflags\fP の下位ビットには、実行されるカーネルのアーキテクチャが入る。 現在のアーキテクチャを使うことを意味する定数 \fBKEXEC_ARCH_DEFAULT\fP か、 アーキテクチャ定数 \fBKEXEC_ARCH_386\fP, \fBKEXEC_ARCH_X86_64\fP, \fBKEXEC_ARCH_PPC\fP, \fBKEXEC_ARCH_PPC64\fP, \fBKEXEC_ARCH_IA_64\fP, \fBKEXEC_ARCH_ARM\fP, \fBKEXEC_ARCH_S390\fP, \fBKEXEC_ARCH_SH\fP, \fBKEXEC_ARCH_MIPS\fP, \fBKEXEC_ARCH_MIPS_LE\fP の いずれか一つを (OR で) 指定する。指定するアーキテクチャは、 システムの CPU で実行可能なものでなければならない。 \fIentry\fP 引き数は、カーネルイメージの物理エントリーアドレスである。 \fInr_segments\fP 引き数は、 \fIsegments\fP ポインタが指すセグメントの 数である。 \fIsegments\fP 引き数は \fIkexec_segment\fP 構造体の配列で、 この構造体によりカーネルの配置が定義される。 .in +4n .nf struct kexec_segment { void *buf; /* Buffer in user space */ size_t bufsz; /* Buffer length in user space */ void *mem; /* Physical address of kernel */ size_t memsz; /* Physical address length */ }; .fi .in .PP .\" FIXME elaborate on the following: \fIsegments\fP で定義されたカーネルイメージは、 呼び出したプロセスから予約済みメモリにコピーされる。 .SH 返り値 成功すると、 \fBkexec_load\fP は 0 を返す。 エラーの場合、 \-1 が返り、 \fIerrno\fP にエラーを示す値が設定される。 .SH エラー .TP \fBEBUSY\fP 別のクラッシュカーネルがすでにロードされているか、 クラッシュカーネルがすでに使用されている。 .TP \fBEINVAL\fP .\" KEXEC_SEGMENT_MAX == 16 \fIflags\fP が無効である。 \fInr_segments\fP が大きすぎる。 .TP \fBEPERM\fP 呼び出し側が \fBCAP_SYS_BOOT\fP ケーパビリティを持っていない。 .SH バージョン \fBkexec_load\fP() システムコールは Linux 2.6.13 で初めて登場した。 .SH 準拠 このシステムコールは Linux 固有である。 .SH 注意 現在のところ、 \fBkexec_load\fP() は glibc ではサポートされていない。 \fBsyscall\fP(2) を使って呼び出すこと。 .PP .\" FIXME Andi submitted a patch for this. .\" Check if it got accepted later. 必要な定数は Linux カーネルのソースファイル \fIlinux/kexec.h\fP で定義されている が、現在のところ glibc には公開されていない。 そのため、これらの定数は手動で定義しなければならない。 このシステムコールは、カーネルの設定で \fBCONFIG_KEXEC\fP が有効になって いる場合にのみ利用できる。 .SH 関連項目 \fBreboot\fP(2), \fBsyscall\fP(2) .SH この文書について この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.65 の一部 である。プロジェクトの説明とバグ報告に関する情報は http://www.kernel.org/doc/man\-pages/ に書かれている。