kexec.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /*
  2. * Copyright IBM Corp. 2005
  3. *
  4. * Author(s): Rolf Adelsberger <adelsberger@de.ibm.com>
  5. *
  6. */
  7. #ifndef _S390_KEXEC_H
  8. #define _S390_KEXEC_H
  9. #include <asm/processor.h>
  10. #include <asm/page.h>
  11. /*
  12. * KEXEC_SOURCE_MEMORY_LIMIT maximum page get_free_page can return.
  13. * I.e. Maximum page that is mapped directly into kernel memory,
  14. * and kmap is not required.
  15. */
  16. /* Maximum physical address we can use pages from */
  17. #define KEXEC_SOURCE_MEMORY_LIMIT (-1UL)
  18. /* Maximum address we can reach in physical address mode */
  19. #define KEXEC_DESTINATION_MEMORY_LIMIT (-1UL)
  20. /* Maximum address we can use for the control pages */
  21. /* Not more than 2GB */
  22. #define KEXEC_CONTROL_MEMORY_LIMIT (1UL<<31)
  23. /* Maximum address we can use for the crash control pages */
  24. #define KEXEC_CRASH_CONTROL_MEMORY_LIMIT (-1UL)
  25. /* Allocate one page for the pdp and the second for the code */
  26. #define KEXEC_CONTROL_PAGE_SIZE 4096
  27. /* Alignment of crashkernel memory */
  28. #define KEXEC_CRASH_MEM_ALIGN HPAGE_SIZE
  29. /* The native architecture */
  30. #define KEXEC_ARCH KEXEC_ARCH_S390
  31. /*
  32. * Size for s390x ELF notes per CPU
  33. *
  34. * Seven notes plus zero note at the end: prstatus, fpregset, timer,
  35. * tod_cmp, tod_reg, control regs, and prefix
  36. */
  37. #define KEXEC_NOTE_BYTES \
  38. (ALIGN(sizeof(struct elf_note), 4) * 8 + \
  39. ALIGN(sizeof("CORE"), 4) * 7 + \
  40. ALIGN(sizeof(struct elf_prstatus), 4) + \
  41. ALIGN(sizeof(elf_fpregset_t), 4) + \
  42. ALIGN(sizeof(u64), 4) + \
  43. ALIGN(sizeof(u64), 4) + \
  44. ALIGN(sizeof(u32), 4) + \
  45. ALIGN(sizeof(u64) * 16, 4) + \
  46. ALIGN(sizeof(u32), 4) \
  47. )
  48. /* Provide a dummy definition to avoid build failures. */
  49. static inline void crash_setup_regs(struct pt_regs *newregs,
  50. struct pt_regs *oldregs) { }
  51. #endif /*_S390_KEXEC_H */