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