os_info.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * OS info memory interface
  4. *
  5. * Copyright IBM Corp. 2012
  6. * Author(s): Michael Holzheu <[email protected]>
  7. */
  8. #ifndef _ASM_S390_OS_INFO_H
  9. #define _ASM_S390_OS_INFO_H
  10. #include <linux/uio.h>
  11. #define OS_INFO_VERSION_MAJOR 1
  12. #define OS_INFO_VERSION_MINOR 1
  13. #define OS_INFO_MAGIC 0x4f53494e464f535aULL /* OSINFOSZ */
  14. #define OS_INFO_VMCOREINFO 0
  15. #define OS_INFO_REIPL_BLOCK 1
  16. struct os_info_entry {
  17. u64 addr;
  18. u64 size;
  19. u32 csum;
  20. } __packed;
  21. struct os_info {
  22. u64 magic;
  23. u32 csum;
  24. u16 version_major;
  25. u16 version_minor;
  26. u64 crashkernel_addr;
  27. u64 crashkernel_size;
  28. struct os_info_entry entry[2];
  29. u8 reserved[4024];
  30. } __packed;
  31. void os_info_init(void);
  32. void os_info_entry_add(int nr, void *ptr, u64 len);
  33. void os_info_crashkernel_add(unsigned long base, unsigned long size);
  34. u32 os_info_csum(struct os_info *os_info);
  35. #ifdef CONFIG_CRASH_DUMP
  36. void *os_info_old_entry(int nr, unsigned long *size);
  37. #else
  38. static inline void *os_info_old_entry(int nr, unsigned long *size)
  39. {
  40. return NULL;
  41. }
  42. #endif
  43. #endif /* _ASM_S390_OS_INFO_H */