blob: 79d3d6e2e9c5681787ca1c8064c35b6a87992668 [file] [log] [blame]
Christian Borntraegeraa24f7f2008-04-17 07:46:09 +02001/*
2 * definition for store system information stsi
3 *
4 * Copyright IBM Corp. 2001,2008
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License (version 2 only)
8 * as published by the Free Software Foundation.
9 *
10 * Author(s): Ulrich Weigand <weigand@de.ibm.com>
11 * Christian Borntraeger <borntraeger@de.ibm.com>
12 */
13
Heiko Carstensf291e172008-04-30 13:38:35 +020014#ifndef __ASM_S390_SYSINFO_H
15#define __ASM_S390_SYSINFO_H
16
Heiko Carstensc30f91b2010-10-25 16:10:53 +020017#include <asm/bitsperlong.h>
18
Christian Borntraegeraa24f7f2008-04-17 07:46:09 +020019struct sysinfo_1_1_1 {
Heiko Carstens7aca2ed2010-10-25 16:10:16 +020020 unsigned short :16;
21 unsigned char ccr;
22 unsigned char cai;
23 char reserved_0[28];
Christian Borntraegeraa24f7f2008-04-17 07:46:09 +020024 char manufacturer[16];
25 char type[4];
26 char reserved_1[12];
27 char model_capacity[16];
28 char sequence[16];
29 char plant[4];
30 char model[16];
Martin Schwidefskycbce70e2008-04-17 07:46:10 +020031 char model_perm_cap[16];
32 char model_temp_cap[16];
33 char model_cap_rating[4];
34 char model_perm_cap_rating[4];
35 char model_temp_cap_rating[4];
Christian Borntraegeraa24f7f2008-04-17 07:46:09 +020036};
37
38struct sysinfo_1_2_1 {
39 char reserved_0[80];
40 char sequence[16];
41 char plant[4];
42 char reserved_1[2];
43 unsigned short cpu_address;
44};
45
46struct sysinfo_1_2_2 {
47 char format;
48 char reserved_0[1];
49 unsigned short acc_offset;
50 char reserved_1[24];
51 unsigned int secondary_capability;
52 unsigned int capability;
53 unsigned short cpus_total;
54 unsigned short cpus_configured;
55 unsigned short cpus_standby;
56 unsigned short cpus_reserved;
57 unsigned short adjustment[0];
58};
59
60struct sysinfo_1_2_2_extension {
61 unsigned int alt_capability;
62 unsigned short alt_adjustment[0];
63};
64
65struct sysinfo_2_2_1 {
66 char reserved_0[80];
67 char sequence[16];
68 char plant[4];
69 unsigned short cpu_id;
70 unsigned short cpu_address;
71};
72
73struct sysinfo_2_2_2 {
74 char reserved_0[32];
75 unsigned short lpar_number;
76 char reserved_1;
77 unsigned char characteristics;
78 unsigned short cpus_total;
79 unsigned short cpus_configured;
80 unsigned short cpus_standby;
81 unsigned short cpus_reserved;
82 char name[8];
83 unsigned int caf;
84 char reserved_2[16];
85 unsigned short cpus_dedicated;
86 unsigned short cpus_shared;
87};
88
89#define LPAR_CHAR_DEDICATED (1 << 7)
90#define LPAR_CHAR_SHARED (1 << 6)
91#define LPAR_CHAR_LIMITED (1 << 5)
92
93struct sysinfo_3_2_2 {
94 char reserved_0[31];
Heiko Carstens8387c732010-02-26 22:37:39 +010095 unsigned char :4;
96 unsigned char count:4;
Christian Borntraegeraa24f7f2008-04-17 07:46:09 +020097 struct {
98 char reserved_0[4];
99 unsigned short cpus_total;
100 unsigned short cpus_configured;
101 unsigned short cpus_standby;
102 unsigned short cpus_reserved;
103 char name[8];
104 unsigned int caf;
105 char cpi[16];
106 char reserved_1[24];
107
108 } vm[8];
Christian Borntraeger92e6ecf2009-03-26 15:23:58 +0100109 char reserved_544[3552];
Christian Borntraegeraa24f7f2008-04-17 07:46:09 +0200110};
111
Heiko Carstensc30f91b2010-10-25 16:10:53 +0200112#define TOPOLOGY_CPU_BITS 64
113#define TOPOLOGY_NR_MAG 6
114
115struct topology_cpu {
116 unsigned char reserved0[4];
117 unsigned char :6;
118 unsigned char pp:2;
119 unsigned char reserved1;
120 unsigned short origin;
121 unsigned long mask[TOPOLOGY_CPU_BITS / BITS_PER_LONG];
122};
123
124struct topology_container {
125 unsigned char reserved[7];
126 unsigned char id;
127};
128
129union topology_entry {
130 unsigned char nl;
131 struct topology_cpu cpu;
132 struct topology_container container;
133};
134
135struct sysinfo_15_1_x {
136 unsigned char reserved0[2];
137 unsigned short length;
138 unsigned char mag[TOPOLOGY_NR_MAG];
139 unsigned char reserved1;
140 unsigned char mnest;
141 unsigned char reserved2[4];
142 union topology_entry tle[0];
143};
144
Christian Borntraegeraa24f7f2008-04-17 07:46:09 +0200145static inline int stsi(void *sysinfo, int fc, int sel1, int sel2)
146{
147 register int r0 asm("0") = (fc << 28) | sel1;
148 register int r1 asm("1") = sel2;
149
150 asm volatile(
151 " stsi 0(%2)\n"
152 "0: jz 2f\n"
153 "1: lhi %0,%3\n"
154 "2:\n"
155 EX_TABLE(0b, 1b)
156 : "+d" (r0) : "d" (r1), "a" (sysinfo), "K" (-ENOSYS)
157 : "cc", "memory");
158 return r0;
159}
Heiko Carstensf291e172008-04-30 13:38:35 +0200160
Martin Schwidefsky6bcac502008-12-25 13:38:49 +0100161/*
162 * Service level reporting interface.
163 */
164struct service_level {
165 struct list_head list;
166 void (*seq_print)(struct seq_file *, struct service_level *);
167};
168
169int register_service_level(struct service_level *);
170int unregister_service_level(struct service_level *);
171
Heiko Carstensf291e172008-04-30 13:38:35 +0200172#endif /* __ASM_S390_SYSINFO_H */