kexec.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #ifndef LINUX_KEXEC_H
  2. #define LINUX_KEXEC_H
  3. /* kexec system call - It loads the new kernel to boot into.
  4. * kexec does not sync, or unmount filesystems so if you need
  5. * that to happen you need to do that yourself.
  6. */
  7. #include <linux/types.h>
  8. /* kexec flags for different usage scenarios */
  9. #define KEXEC_ON_CRASH 0x00000001
  10. #define KEXEC_PRESERVE_CONTEXT 0x00000002
  11. #define KEXEC_ARCH_MASK 0xffff0000
  12. /*
  13. * Kexec file load interface flags.
  14. * KEXEC_FILE_UNLOAD : Unload already loaded kexec/kdump image.
  15. * KEXEC_FILE_ON_CRASH : Load/unload operation belongs to kdump image.
  16. * KEXEC_FILE_NO_INITRAMFS : No initramfs is being loaded. Ignore the initrd
  17. * fd field.
  18. */
  19. #define KEXEC_FILE_UNLOAD 0x00000001
  20. #define KEXEC_FILE_ON_CRASH 0x00000002
  21. #define KEXEC_FILE_NO_INITRAMFS 0x00000004
  22. /* These values match the ELF architecture values.
  23. * Unless there is a good reason that should continue to be the case.
  24. */
  25. #define KEXEC_ARCH_DEFAULT ( 0 << 16)
  26. #define KEXEC_ARCH_386 ( 3 << 16)
  27. #define KEXEC_ARCH_68K ( 4 << 16)
  28. #define KEXEC_ARCH_X86_64 (62 << 16)
  29. #define KEXEC_ARCH_PPC (20 << 16)
  30. #define KEXEC_ARCH_PPC64 (21 << 16)
  31. #define KEXEC_ARCH_IA_64 (50 << 16)
  32. #define KEXEC_ARCH_ARM (40 << 16)
  33. #define KEXEC_ARCH_S390 (22 << 16)
  34. #define KEXEC_ARCH_SH (42 << 16)
  35. #define KEXEC_ARCH_MIPS_LE (10 << 16)
  36. #define KEXEC_ARCH_MIPS ( 8 << 16)
  37. /* The artificial cap on the number of segments passed to kexec_load. */
  38. #define KEXEC_SEGMENT_MAX 16
  39. /*
  40. * This structure is used to hold the arguments that are used when
  41. * loading kernel binaries.
  42. */
  43. struct kexec_segment {
  44. const void *buf;
  45. size_t bufsz;
  46. const void *mem;
  47. size_t memsz;
  48. };
  49. #endif /* LINUX_KEXEC_H */