xref: /linux/arch/s390/include/asm/os_info.h (revision 31e9ccc67ce24f82120e41fcafd841f98838ff5c)
1b2441318SGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 */
24857d4bbSMichael Holzheu /*
34857d4bbSMichael Holzheu  * OS info memory interface
44857d4bbSMichael Holzheu  *
54857d4bbSMichael Holzheu  * Copyright IBM Corp. 2012
64857d4bbSMichael Holzheu  * Author(s): Michael Holzheu <holzheu@linux.vnet.ibm.com>
74857d4bbSMichael Holzheu  */
84857d4bbSMichael Holzheu #ifndef _ASM_S390_OS_INFO_H
94857d4bbSMichael Holzheu #define _ASM_S390_OS_INFO_H
104857d4bbSMichael Holzheu 
11ebbc9570SAlexander Gordeev #include <linux/uio.h>
12ebbc9570SAlexander Gordeev 
134857d4bbSMichael Holzheu #define OS_INFO_VERSION_MAJOR	1
144857d4bbSMichael Holzheu #define OS_INFO_VERSION_MINOR	1
154857d4bbSMichael Holzheu #define OS_INFO_MAGIC		0x4f53494e464f535aULL /* OSINFOSZ */
164857d4bbSMichael Holzheu 
174857d4bbSMichael Holzheu #define OS_INFO_VMCOREINFO	0
184857d4bbSMichael Holzheu #define OS_INFO_REIPL_BLOCK	1
19*31e9ccc6SMikhail Zaslonko #define OS_INFO_FLAGS_ENTRY	2
20*31e9ccc6SMikhail Zaslonko 
21*31e9ccc6SMikhail Zaslonko #define OS_INFO_FLAG_REIPL_CLEAR	(1UL << 0)
224857d4bbSMichael Holzheu 
234857d4bbSMichael Holzheu struct os_info_entry {
244857d4bbSMichael Holzheu 	u64	addr;
254857d4bbSMichael Holzheu 	u64	size;
264857d4bbSMichael Holzheu 	u32	csum;
274857d4bbSMichael Holzheu } __packed;
284857d4bbSMichael Holzheu 
294857d4bbSMichael Holzheu struct os_info {
304857d4bbSMichael Holzheu 	u64	magic;
314857d4bbSMichael Holzheu 	u32	csum;
324857d4bbSMichael Holzheu 	u16	version_major;
334857d4bbSMichael Holzheu 	u16	version_minor;
344857d4bbSMichael Holzheu 	u64	crashkernel_addr;
354857d4bbSMichael Holzheu 	u64	crashkernel_size;
36*31e9ccc6SMikhail Zaslonko 	struct os_info_entry entry[3];
37*31e9ccc6SMikhail Zaslonko 	u8	reserved[4004];
384857d4bbSMichael Holzheu } __packed;
394857d4bbSMichael Holzheu 
404857d4bbSMichael Holzheu void os_info_init(void);
414857d4bbSMichael Holzheu void os_info_entry_add(int nr, void *ptr, u64 len);
424857d4bbSMichael Holzheu void os_info_crashkernel_add(unsigned long base, unsigned long size);
434857d4bbSMichael Holzheu u32 os_info_csum(struct os_info *os_info);
444857d4bbSMichael Holzheu 
454857d4bbSMichael Holzheu #ifdef CONFIG_CRASH_DUMP
464857d4bbSMichael Holzheu void *os_info_old_entry(int nr, unsigned long *size);
474857d4bbSMichael Holzheu #else
484857d4bbSMichael Holzheu static inline void *os_info_old_entry(int nr, unsigned long *size)
494857d4bbSMichael Holzheu {
504857d4bbSMichael Holzheu 	return NULL;
514857d4bbSMichael Holzheu }
524857d4bbSMichael Holzheu #endif
534857d4bbSMichael Holzheu 
544857d4bbSMichael Holzheu #endif /* _ASM_S390_OS_INFO_H */
55