Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
0002 #ifndef _UAPILINUX_KEXEC_H
0003 #define _UAPILINUX_KEXEC_H
0004 
0005 /* kexec system call -  It loads the new kernel to boot into.
0006  * kexec does not sync, or unmount filesystems so if you need
0007  * that to happen you need to do that yourself.
0008  */
0009 
0010 #include <linux/types.h>
0011 
0012 /* kexec flags for different usage scenarios */
0013 #define KEXEC_ON_CRASH      0x00000001
0014 #define KEXEC_PRESERVE_CONTEXT  0x00000002
0015 #define KEXEC_ARCH_MASK     0xffff0000
0016 
0017 /*
0018  * Kexec file load interface flags.
0019  * KEXEC_FILE_UNLOAD : Unload already loaded kexec/kdump image.
0020  * KEXEC_FILE_ON_CRASH : Load/unload operation belongs to kdump image.
0021  * KEXEC_FILE_NO_INITRAMFS : No initramfs is being loaded. Ignore the initrd
0022  *                           fd field.
0023  */
0024 #define KEXEC_FILE_UNLOAD   0x00000001
0025 #define KEXEC_FILE_ON_CRASH 0x00000002
0026 #define KEXEC_FILE_NO_INITRAMFS 0x00000004
0027 
0028 /* These values match the ELF architecture values.
0029  * Unless there is a good reason that should continue to be the case.
0030  */
0031 #define KEXEC_ARCH_DEFAULT ( 0 << 16)
0032 #define KEXEC_ARCH_386     ( 3 << 16)
0033 #define KEXEC_ARCH_68K     ( 4 << 16)
0034 #define KEXEC_ARCH_PARISC  (15 << 16)
0035 #define KEXEC_ARCH_X86_64  (62 << 16)
0036 #define KEXEC_ARCH_PPC     (20 << 16)
0037 #define KEXEC_ARCH_PPC64   (21 << 16)
0038 #define KEXEC_ARCH_IA_64   (50 << 16)
0039 #define KEXEC_ARCH_ARM     (40 << 16)
0040 #define KEXEC_ARCH_S390    (22 << 16)
0041 #define KEXEC_ARCH_SH      (42 << 16)
0042 #define KEXEC_ARCH_MIPS_LE (10 << 16)
0043 #define KEXEC_ARCH_MIPS    ( 8 << 16)
0044 #define KEXEC_ARCH_AARCH64 (183 << 16)
0045 #define KEXEC_ARCH_RISCV   (243 << 16)
0046 #define KEXEC_ARCH_LOONGARCH    (258 << 16)
0047 
0048 /* The artificial cap on the number of segments passed to kexec_load. */
0049 #define KEXEC_SEGMENT_MAX 16
0050 
0051 #ifndef __KERNEL__
0052 /*
0053  * This structure is used to hold the arguments that are used when
0054  * loading  kernel binaries.
0055  */
0056 struct kexec_segment {
0057     const void *buf;
0058     __kernel_size_t bufsz;
0059     const void *mem;
0060     __kernel_size_t memsz;
0061 };
0062 
0063 #endif /* __KERNEL__ */
0064 
0065 #endif /* _UAPILINUX_KEXEC_H */