kexec.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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_X86_64 (62 << 16)
  18. #define KEXEC_ARCH_PPC (20 << 16)
  19. #define KEXEC_ARCH_PPC64 (21 << 16)
  20. #define KEXEC_ARCH_IA_64 (50 << 16)
  21. #define KEXEC_ARCH_ARM (40 << 16)
  22. #define KEXEC_ARCH_S390 (22 << 16)
  23. #define KEXEC_ARCH_SH (42 << 16)
  24. #define KEXEC_ARCH_MIPS_LE (10 << 16)
  25. #define KEXEC_ARCH_MIPS ( 8 << 16)
  26. /* The artificial cap on the number of segments passed to kexec_load. */
  27. #define KEXEC_SEGMENT_MAX 16
  28. #ifndef __KERNEL__
  29. /*
  30. * This structure is used to hold the arguments that are used when
  31. * loading kernel binaries.
  32. */
  33. struct kexec_segment {
  34. const void *buf;
  35. size_t bufsz;
  36. const void *mem;
  37. size_t memsz;
  38. };
  39. /* Load a new kernel image as described by the kexec_segment array
  40. * consisting of passed number of segments at the entry-point address.
  41. * The flags allow different useage types.
  42. */
  43. extern int kexec_load(void *, size_t, struct kexec_segment *,
  44. unsigned long int);
  45. #endif /* __KERNEL__ */
  46. #endif /* _UAPILINUX_KEXEC_H */