kexec.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * Copyright IBM Corp. 2005
  4. *
  5. * Author(s): Rolf Adelsberger <adelsberger@de.ibm.com>
  6. *
  7. */
  8. #ifndef _S390_KEXEC_H
  9. #define _S390_KEXEC_H
  10. #include <asm/processor.h>
  11. #include <asm/page.h>
  12. /*
  13. * KEXEC_SOURCE_MEMORY_LIMIT maximum page get_free_page can return.
  14. * I.e. Maximum page that is mapped directly into kernel memory,
  15. * and kmap is not required.
  16. */
  17. /* Maximum physical address we can use pages from */
  18. #define KEXEC_SOURCE_MEMORY_LIMIT (-1UL)
  19. /* Maximum address we can reach in physical address mode */
  20. #define KEXEC_DESTINATION_MEMORY_LIMIT (-1UL)
  21. /* Maximum address we can use for the control pages */
  22. /* Not more than 2GB */
  23. #define KEXEC_CONTROL_MEMORY_LIMIT (1UL<<31)
  24. /* Allocate control page with GFP_DMA */
  25. #define KEXEC_CONTROL_MEMORY_GFP GFP_DMA
  26. /* Maximum address we can use for the crash control pages */
  27. #define KEXEC_CRASH_CONTROL_MEMORY_LIMIT (-1UL)
  28. /* Allocate one page for the pdp and the second for the code */
  29. #define KEXEC_CONTROL_PAGE_SIZE 4096
  30. /* Alignment of crashkernel memory */
  31. #define KEXEC_CRASH_MEM_ALIGN HPAGE_SIZE
  32. /* The native architecture */
  33. #define KEXEC_ARCH KEXEC_ARCH_S390
  34. /* Provide a dummy definition to avoid build failures. */
  35. static inline void crash_setup_regs(struct pt_regs *newregs,
  36. struct pt_regs *oldregs) { }
  37. struct kimage;
  38. struct s390_load_data {
  39. /* Pointer to the kernel buffer. Used to register cmdline etc.. */
  40. void *kernel_buf;
  41. /* Total size of loaded segments in memory. Used as an offset. */
  42. size_t memsz;
  43. /* Load address of initrd. Used to register INITRD_START in kernel. */
  44. unsigned long initrd_load_addr;
  45. };
  46. int kexec_file_add_purgatory(struct kimage *image,
  47. struct s390_load_data *data);
  48. int kexec_file_add_initrd(struct kimage *image,
  49. struct s390_load_data *data,
  50. char *initrd, unsigned long initrd_len);
  51. int *kexec_file_update_kernel(struct kimage *iamge,
  52. struct s390_load_data *data);
  53. extern const struct kexec_file_ops s390_kexec_image_ops;
  54. extern const struct kexec_file_ops s390_kexec_elf_ops;
  55. #endif /*_S390_KEXEC_H */