1 /* SPDX-License-Identifier: GPL-2.0 */
3 * definition for store system information stsi
5 * Copyright IBM Corp. 2001, 2008
7 * Author(s): Ulrich Weigand <weigand@de.ibm.com>
8 * Christian Borntraeger <borntraeger@de.ibm.com>
11 #ifndef __ASM_S390_SYSINFO_H
12 #define __ASM_S390_SYSINFO_H
14 #include <asm/bitsperlong.h>
15 #include <linux/uuid.h>
17 struct sysinfo_1_1_1
{
26 char manufacturer
[16];
29 char model_capacity
[16];
33 char model_perm_cap
[16];
34 char model_temp_cap
[16];
35 unsigned int model_cap_rating
;
36 unsigned int model_perm_cap_rating
;
37 unsigned int model_temp_cap_rating
;
38 unsigned char typepct
[5];
39 unsigned char reserved_2
[3];
45 struct sysinfo_1_2_1
{
50 unsigned short cpu_address
;
53 struct sysinfo_1_2_2
{
56 unsigned short acc_offset
;
57 unsigned char mt_installed
:1;
59 unsigned char mt_stid
:5;
61 unsigned char mt_gtid
:5;
63 unsigned int nominal_cap
;
64 unsigned int secondary_cap
;
65 unsigned int capability
;
66 unsigned short cpus_total
;
67 unsigned short cpus_configured
;
68 unsigned short cpus_standby
;
69 unsigned short cpus_reserved
;
70 unsigned short adjustment
[0];
73 struct sysinfo_1_2_2_extension
{
74 unsigned int alt_capability
;
75 unsigned short alt_adjustment
[0];
78 struct sysinfo_2_2_1
{
82 unsigned short cpu_id
;
83 unsigned short cpu_address
;
86 struct sysinfo_2_2_2
{
88 unsigned short lpar_number
;
90 unsigned char characteristics
;
91 unsigned short cpus_total
;
92 unsigned short cpus_configured
;
93 unsigned short cpus_standby
;
94 unsigned short cpus_reserved
;
98 unsigned char mt_installed
:1;
100 unsigned char mt_stid
:5;
102 unsigned char mt_gtid
:5;
104 unsigned char mt_psmtid
:5;
106 unsigned short cpus_dedicated
;
107 unsigned short cpus_shared
;
111 char reserved_5
[160];
115 #define LPAR_CHAR_DEDICATED (1 << 7)
116 #define LPAR_CHAR_SHARED (1 << 6)
117 #define LPAR_CHAR_LIMITED (1 << 5)
119 struct sysinfo_3_2_2
{
122 unsigned char count
:4;
125 unsigned short cpus_total
;
126 unsigned short cpus_configured
;
127 unsigned short cpus_standby
;
128 unsigned short cpus_reserved
;
134 unsigned int reserved_2
;
137 char reserved_3
[1504];
138 char ext_names
[8][256];
141 extern int topology_max_mnest
;
144 * Returns the maximum nesting level supported by the cpu topology code.
145 * The current maximum level is 4 which is the drawer level.
147 static inline unsigned char topology_mnest_limit(void)
149 return min(topology_max_mnest
, 4);
152 #define TOPOLOGY_NR_MAG 6
154 struct topology_core
{
156 unsigned char reserved0
[3];
160 unsigned char reserved1
;
161 unsigned short origin
;
165 struct topology_container
{
167 unsigned char reserved
[6];
171 union topology_entry
{
173 struct topology_core cpu
;
174 struct topology_container container
;
177 struct sysinfo_15_1_x
{
178 unsigned char reserved0
[2];
179 unsigned short length
;
180 unsigned char mag
[TOPOLOGY_NR_MAG
];
181 unsigned char reserved1
;
183 unsigned char reserved2
[4];
184 union topology_entry tle
[0];
187 int stsi(void *sysinfo
, int fc
, int sel1
, int sel2
);
190 * Service level reporting interface.
192 struct service_level
{
193 struct list_head list
;
194 void (*seq_print
)(struct seq_file
*, struct service_level
*);
197 int register_service_level(struct service_level
*);
198 int unregister_service_level(struct service_level
*);
200 int sthyi_fill(void *dst
, u64
*rc
);
201 #endif /* __ASM_S390_SYSINFO_H */