kexec.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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. /* Allocate control page with GFP_DMA */
  24. #define KEXEC_CONTROL_MEMORY_GFP GFP_DMA
  25. /* Maximum address we can use for the crash control pages */
  26. #define KEXEC_CRASH_CONTROL_MEMORY_LIMIT (-1UL)
  27. /* Allocate one page for the pdp and the second for the code */
  28. #define KEXEC_CONTROL_PAGE_SIZE 4096
  29. /* Alignment of crashkernel memory */
  30. #define KEXEC_CRASH_MEM_ALIGN HPAGE_SIZE
  31. /* The native architecture */
  32. #define KEXEC_ARCH KEXEC_ARCH_S390
  33. /*
  34. * Size for s390x ELF notes per CPU
  35. *
  36. * Seven notes plus zero note at the end: prstatus, fpregset, timer,
  37. * tod_cmp, tod_reg, control regs, and prefix
  38. */
  39. #define KEXEC_NOTE_BYTES \
  40. (ALIGN(sizeof(struct elf_note), 4) * 8 + \
  41. ALIGN(sizeof("CORE"), 4) * 7 + \
  42. ALIGN(sizeof(struct elf_prstatus), 4) + \
  43. ALIGN(sizeof(elf_fpregset_t), 4) + \
  44. ALIGN(sizeof(u64), 4) + \
  45. ALIGN(sizeof(u64), 4) + \
  46. ALIGN(sizeof(u32), 4) + \
  47. ALIGN(sizeof(u64) * 16, 4) + \
  48. ALIGN(sizeof(u32), 4) \
  49. )
  50. /* Provide a dummy definition to avoid build failures. */
  51. static inline void crash_setup_regs(struct pt_regs *newregs,
  52. struct pt_regs *oldregs) { }
  53. #endif /*_S390_KEXEC_H */