linux/include/uapi/linux/kexec.h

/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
#ifndef _UAPILINUX_KEXEC_H
#define _UAPILINUX_KEXEC_H

/* kexec system call -  It loads the new kernel to boot into.
 * kexec does not sync, or unmount filesystems so if you need
 * that to happen you need to do that yourself.
 */

#include <linux/types.h>

/* kexec flags for different usage scenarios */
#define KEXEC_ON_CRASH
#define KEXEC_PRESERVE_CONTEXT
#define KEXEC_UPDATE_ELFCOREHDR
#define KEXEC_CRASH_HOTPLUG_SUPPORT
#define KEXEC_ARCH_MASK

/*
 * Kexec file load interface flags.
 * KEXEC_FILE_UNLOAD : Unload already loaded kexec/kdump image.
 * KEXEC_FILE_ON_CRASH : Load/unload operation belongs to kdump image.
 * KEXEC_FILE_NO_INITRAMFS : No initramfs is being loaded. Ignore the initrd
 *                           fd field.
 */
#define KEXEC_FILE_UNLOAD
#define KEXEC_FILE_ON_CRASH
#define KEXEC_FILE_NO_INITRAMFS
#define KEXEC_FILE_DEBUG

/* These values match the ELF architecture values.
 * Unless there is a good reason that should continue to be the case.
 */
#define KEXEC_ARCH_DEFAULT
#define KEXEC_ARCH_386
#define KEXEC_ARCH_68K
#define KEXEC_ARCH_PARISC
#define KEXEC_ARCH_X86_64
#define KEXEC_ARCH_PPC
#define KEXEC_ARCH_PPC64
#define KEXEC_ARCH_IA_64
#define KEXEC_ARCH_ARM
#define KEXEC_ARCH_S390
#define KEXEC_ARCH_SH
#define KEXEC_ARCH_MIPS_LE
#define KEXEC_ARCH_MIPS
#define KEXEC_ARCH_AARCH64
#define KEXEC_ARCH_RISCV
#define KEXEC_ARCH_LOONGARCH

/* The artificial cap on the number of segments passed to kexec_load. */
#define KEXEC_SEGMENT_MAX

#ifndef __KERNEL__
/*
 * This structure is used to hold the arguments that are used when
 * loading  kernel binaries.
 */
struct kexec_segment {
	const void *buf;
	__kernel_size_t bufsz;
	const void *mem;
	__kernel_size_t memsz;
};

#endif /* __KERNEL__ */

#endif /* _UAPILINUX_KEXEC_H */