blob: 04e6e9774708cb7301cc8e37ae46f3dbbca0799d [file] [log] [blame]
Christian Borntraegeraa24f7f2008-04-17 07:46:09 +02001/*
2 * definition for store system information stsi
3 *
Heiko Carstensa53c8fa2012-07-20 11:15:04 +02004 * Copyright IBM Corp. 2001, 2008
Christian Borntraegeraa24f7f2008-04-17 07:46:09 +02005 *
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 Carstens25502f02012-09-03 14:05:05 +020020 unsigned char p:1;
21 unsigned char :6;
22 unsigned char t:1;
23 unsigned char :8;
Heiko Carstens7aca2ed2010-10-25 16:10:16 +020024 unsigned char ccr;
25 unsigned char cai;
26 char reserved_0[28];
Christian Borntraegeraa24f7f2008-04-17 07:46:09 +020027 char manufacturer[16];
28 char type[4];
29 char reserved_1[12];
30 char model_capacity[16];
31 char sequence[16];
32 char plant[4];
33 char model[16];
Martin Schwidefskycbce70e2008-04-17 07:46:10 +020034 char model_perm_cap[16];
35 char model_temp_cap[16];
Heiko Carstens25502f02012-09-03 14:05:05 +020036 unsigned int model_cap_rating;
37 unsigned int model_perm_cap_rating;
38 unsigned int model_temp_cap_rating;
39 unsigned char typepct[5];
40 unsigned char reserved_2[3];
41 unsigned int ncr;
42 unsigned int npr;
43 unsigned int ntr;
Christian Borntraegeraa24f7f2008-04-17 07:46:09 +020044};
45
46struct sysinfo_1_2_1 {
47 char reserved_0[80];
48 char sequence[16];
49 char plant[4];
50 char reserved_1[2];
51 unsigned short cpu_address;
52};
53
54struct sysinfo_1_2_2 {
55 char format;
56 char reserved_0[1];
57 unsigned short acc_offset;
Heiko Carstens25502f02012-09-03 14:05:05 +020058 char reserved_1[20];
59 unsigned int nominal_cap;
60 unsigned int secondary_cap;
Christian Borntraegeraa24f7f2008-04-17 07:46:09 +020061 unsigned int capability;
62 unsigned short cpus_total;
63 unsigned short cpus_configured;
64 unsigned short cpus_standby;
65 unsigned short cpus_reserved;
66 unsigned short adjustment[0];
67};
68
69struct sysinfo_1_2_2_extension {
70 unsigned int alt_capability;
71 unsigned short alt_adjustment[0];
72};
73
74struct sysinfo_2_2_1 {
75 char reserved_0[80];
76 char sequence[16];
77 char plant[4];
78 unsigned short cpu_id;
79 unsigned short cpu_address;
80};
81
82struct sysinfo_2_2_2 {
83 char reserved_0[32];
84 unsigned short lpar_number;
85 char reserved_1;
86 unsigned char characteristics;
87 unsigned short cpus_total;
88 unsigned short cpus_configured;
89 unsigned short cpus_standby;
90 unsigned short cpus_reserved;
91 char name[8];
92 unsigned int caf;
93 char reserved_2[16];
94 unsigned short cpus_dedicated;
95 unsigned short cpus_shared;
96};
97
98#define LPAR_CHAR_DEDICATED (1 << 7)
99#define LPAR_CHAR_SHARED (1 << 6)
100#define LPAR_CHAR_LIMITED (1 << 5)
101
102struct sysinfo_3_2_2 {
103 char reserved_0[31];
Heiko Carstens8387c732010-02-26 22:37:39 +0100104 unsigned char :4;
105 unsigned char count:4;
Christian Borntraegeraa24f7f2008-04-17 07:46:09 +0200106 struct {
107 char reserved_0[4];
108 unsigned short cpus_total;
109 unsigned short cpus_configured;
110 unsigned short cpus_standby;
111 unsigned short cpus_reserved;
112 char name[8];
113 unsigned int caf;
114 char cpi[16];
115 char reserved_1[24];
116
117 } vm[8];
Christian Borntraeger92e6ecf2009-03-26 15:23:58 +0100118 char reserved_544[3552];
Christian Borntraegeraa24f7f2008-04-17 07:46:09 +0200119};
120
Heiko Carstensfade4dc2012-09-04 14:26:03 +0200121extern int topology_max_mnest;
122
Heiko Carstensc30f91b2010-10-25 16:10:53 +0200123#define TOPOLOGY_CPU_BITS 64
124#define TOPOLOGY_NR_MAG 6
125
126struct topology_cpu {
127 unsigned char reserved0[4];
128 unsigned char :6;
129 unsigned char pp:2;
130 unsigned char reserved1;
131 unsigned short origin;
132 unsigned long mask[TOPOLOGY_CPU_BITS / BITS_PER_LONG];
133};
134
135struct topology_container {
136 unsigned char reserved[7];
137 unsigned char id;
138};
139
140union topology_entry {
141 unsigned char nl;
142 struct topology_cpu cpu;
143 struct topology_container container;
144};
145
146struct sysinfo_15_1_x {
147 unsigned char reserved0[2];
148 unsigned short length;
149 unsigned char mag[TOPOLOGY_NR_MAG];
150 unsigned char reserved1;
151 unsigned char mnest;
152 unsigned char reserved2[4];
153 union topology_entry tle[0];
154};
155
Christian Borntraegeraa24f7f2008-04-17 07:46:09 +0200156static inline int stsi(void *sysinfo, int fc, int sel1, int sel2)
157{
158 register int r0 asm("0") = (fc << 28) | sel1;
159 register int r1 asm("1") = sel2;
160
161 asm volatile(
162 " stsi 0(%2)\n"
163 "0: jz 2f\n"
164 "1: lhi %0,%3\n"
165 "2:\n"
166 EX_TABLE(0b, 1b)
167 : "+d" (r0) : "d" (r1), "a" (sysinfo), "K" (-ENOSYS)
168 : "cc", "memory");
169 return r0;
170}
Heiko Carstensf291e172008-04-30 13:38:35 +0200171
Martin Schwidefsky6bcac502008-12-25 13:38:49 +0100172/*
173 * Service level reporting interface.
174 */
175struct service_level {
176 struct list_head list;
177 void (*seq_print)(struct seq_file *, struct service_level *);
178};
179
180int register_service_level(struct service_level *);
181int unregister_service_level(struct service_level *);
182
Heiko Carstensf291e172008-04-30 13:38:35 +0200183#endif /* __ASM_S390_SYSINFO_H */