kexec.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
  2. #ifndef _UAPILINUX_KEXEC_H
  3. #define _UAPILINUX_KEXEC_H
  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. #include <linux/types.h>
  9. /* kexec flags for different usage scenarios */
  10. #define KEXEC_ON_CRASH 0x00000001
  11. #define KEXEC_PRESERVE_CONTEXT 0x00000002
  12. #define KEXEC_ARCH_MASK 0xffff0000
  13. /*
  14. * Kexec file load interface flags.
  15. * KEXEC_FILE_UNLOAD : Unload already loaded kexec/kdump image.
  16. * KEXEC_FILE_ON_CRASH : Load/unload operation belongs to kdump image.
  17. * KEXEC_FILE_NO_INITRAMFS : No initramfs is being loaded. Ignore the initrd
  18. * fd field.
  19. */
  20. #define KEXEC_FILE_UNLOAD 0x00000001
  21. #define KEXEC_FILE_ON_CRASH 0x00000002
  22. #define KEXEC_FILE_NO_INITRAMFS 0x00000004
  23. /* These values match the ELF architecture values.
  24. * Unless there is a good reason that should continue to be the case.
  25. */
  26. #define KEXEC_ARCH_DEFAULT ( 0 << 16)
  27. #define KEXEC_ARCH_386 ( 3 << 16)
  28. #define KEXEC_ARCH_68K ( 4 << 16)
  29. #define KEXEC_ARCH_X86_64 (62 << 16)
  30. #define KEXEC_ARCH_PPC (20 << 16)
  31. #define KEXEC_ARCH_PPC64 (21 << 16)
  32. #define KEXEC_ARCH_IA_64 (50 << 16)
  33. #define KEXEC_ARCH_ARM (40 << 16)
  34. #define KEXEC_ARCH_S390 (22 << 16)
  35. #define KEXEC_ARCH_SH (42 << 16)
  36. #define KEXEC_ARCH_MIPS_LE (10 << 16)
  37. #define KEXEC_ARCH_MIPS ( 8 << 16)
  38. #define KEXEC_ARCH_AARCH64 (183 << 16)
  39. /* The artificial cap on the number of segments passed to kexec_load. */
  40. #define KEXEC_SEGMENT_MAX 16
  41. #ifndef __KERNEL__
  42. /*
  43. * This structure is used to hold the arguments that are used when
  44. * loading kernel binaries.
  45. */
  46. struct kexec_segment {
  47. const void *buf;
  48. size_t bufsz;
  49. const void *mem;
  50. size_t memsz;
  51. };
  52. #endif /* __KERNEL__ */
  53. #endif /* _UAPILINUX_KEXEC_H */