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 
20 struct os_info_entry {
21 	u64	addr;
22 	u64	size;
23 	u32	csum;
24 } __packed;
25 
26 struct os_info {
27 	u64	magic;
28 	u32	csum;
29 	u16	version_major;
30 	u16	version_minor;
31 	u64	crashkernel_addr;
32 	u64	crashkernel_size;
33 	struct os_info_entry entry[2];
34 	u8	reserved[4024];
35 } __packed;
36 
37 void os_info_init(void);
38 void os_info_entry_add(int nr, void *ptr, u64 len);
39 void os_info_crashkernel_add(unsigned long base, unsigned long size);
40 u32 os_info_csum(struct os_info *os_info);
41 
42 #ifdef CONFIG_CRASH_DUMP
43 void *os_info_old_entry(int nr, unsigned long *size);
44 #else
os_info_old_entry(int nr,unsigned long * size)45 static inline void *os_info_old_entry(int nr, unsigned long *size)
46 {
47 	return NULL;
48 }
49 #endif
50 
51 #endif /* _ASM_S390_OS_INFO_H */
52