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