kexec.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #ifndef _UAPILINUX_KEXEC_H
  2. #define _UAPILINUX_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. /* These values match the ELF architecture values.
  13. * Unless there is a good reason that should continue to be the case.
  14. */
  15. #define KEXEC_ARCH_DEFAULT ( 0 << 16)
  16. #define KEXEC_ARCH_386 ( 3 << 16)
  17. #define KEXEC_ARCH_68K ( 4 << 16)
  18. #define KEXEC_ARCH_X86_64 (62 << 16)
  19. #define KEXEC_ARCH_PPC (20 << 16)
  20. #define KEXEC_ARCH_PPC64 (21 << 16)
  21. #define KEXEC_ARCH_IA_64 (50 << 16)
  22. #define KEXEC_ARCH_ARM (40 << 16)
  23. #define KEXEC_ARCH_S390 (22 << 16)
  24. #define KEXEC_ARCH_SH (42 << 16)
  25. #define KEXEC_ARCH_MIPS_LE (10 << 16)
  26. #define KEXEC_ARCH_MIPS ( 8 << 16)
  27. /* The artificial cap on the number of segments passed to kexec_load. */
  28. #define KEXEC_SEGMENT_MAX 16
  29. #ifndef __KERNEL__
  30. /*
  31. * This structure is used to hold the arguments that are used when
  32. * loading kernel binaries.
  33. */
  34. struct kexec_segment {
  35. const void *buf;
  36. size_t bufsz;
  37. const void *mem;
  38. size_t memsz;
  39. };
  40. /* Load a new kernel image as described by the kexec_segment array
  41. * consisting of passed number of segments at the entry-point address.
  42. * The flags allow different useage types.
  43. */
  44. extern int kexec_load(void *, size_t, struct kexec_segment *,
  45. unsigned long int);
  46. #endif /* __KERNEL__ */
  47. #endif /* _UAPILINUX_KEXEC_H */