blob: 6d112868272da25419a1feda5a43ab04e8ad15d9 [file] [log] [blame]
Greg Kroah-Hartman6f52b162017-11-01 15:08:43 +01001/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
David Howells607ca462012-10-13 10:46:48 +01002#ifndef _UAPILINUX_KEXEC_H
3#define _UAPILINUX_KEXEC_H
4
5/* kexec system call - It loads the new kernel to boot into.
6 * kexec does not sync, or unmount filesystems so if you need
7 * that to happen you need to do that yourself.
8 */
9
10#include <linux/types.h>
11
12/* kexec flags for different usage scenarios */
13#define KEXEC_ON_CRASH 0x00000001
14#define KEXEC_PRESERVE_CONTEXT 0x00000002
15#define KEXEC_ARCH_MASK 0xffff0000
16
Vivek Goyalcb105252014-08-08 14:25:57 -070017/*
18 * Kexec file load interface flags.
19 * KEXEC_FILE_UNLOAD : Unload already loaded kexec/kdump image.
20 * KEXEC_FILE_ON_CRASH : Load/unload operation belongs to kdump image.
21 * KEXEC_FILE_NO_INITRAMFS : No initramfs is being loaded. Ignore the initrd
22 * fd field.
23 */
24#define KEXEC_FILE_UNLOAD 0x00000001
25#define KEXEC_FILE_ON_CRASH 0x00000002
26#define KEXEC_FILE_NO_INITRAMFS 0x00000004
27
David Howells607ca462012-10-13 10:46:48 +010028/* These values match the ELF architecture values.
29 * Unless there is a good reason that should continue to be the case.
30 */
31#define KEXEC_ARCH_DEFAULT ( 0 << 16)
32#define KEXEC_ARCH_386 ( 3 << 16)
Geert Uytterhoeven7d5f5fa2013-08-20 22:51:47 +020033#define KEXEC_ARCH_68K ( 4 << 16)
David Howells607ca462012-10-13 10:46:48 +010034#define KEXEC_ARCH_X86_64 (62 << 16)
35#define KEXEC_ARCH_PPC (20 << 16)
36#define KEXEC_ARCH_PPC64 (21 << 16)
37#define KEXEC_ARCH_IA_64 (50 << 16)
38#define KEXEC_ARCH_ARM (40 << 16)
39#define KEXEC_ARCH_S390 (22 << 16)
40#define KEXEC_ARCH_SH (42 << 16)
41#define KEXEC_ARCH_MIPS_LE (10 << 16)
42#define KEXEC_ARCH_MIPS ( 8 << 16)
Geoff Levandd28f6df2016-06-23 17:54:48 +000043#define KEXEC_ARCH_AARCH64 (183 << 16)
David Howells607ca462012-10-13 10:46:48 +010044
45/* The artificial cap on the number of segments passed to kexec_load. */
46#define KEXEC_SEGMENT_MAX 16
47
48#ifndef __KERNEL__
49/*
50 * This structure is used to hold the arguments that are used when
51 * loading kernel binaries.
52 */
53struct kexec_segment {
54 const void *buf;
55 size_t bufsz;
56 const void *mem;
57 size_t memsz;
58};
59
David Howells607ca462012-10-13 10:46:48 +010060#endif /* __KERNEL__ */
61
62#endif /* _UAPILINUX_KEXEC_H */