diff options
Diffstat (limited to 'drivers/s390/sysinfo.c')
-rw-r--r-- | drivers/s390/sysinfo.c | 456 |
1 files changed, 231 insertions, 225 deletions
diff --git a/drivers/s390/sysinfo.c b/drivers/s390/sysinfo.c index 66da840c9316..1e788e815ce7 100644 --- a/drivers/s390/sysinfo.c +++ b/drivers/s390/sysinfo.c | |||
@@ -5,26 +5,24 @@ | |||
5 | * Author(s): Ulrich Weigand (Ulrich.Weigand@de.ibm.com) | 5 | * Author(s): Ulrich Weigand (Ulrich.Weigand@de.ibm.com) |
6 | */ | 6 | */ |
7 | 7 | ||
8 | #include <linux/config.h> | ||
9 | #include <linux/kernel.h> | 8 | #include <linux/kernel.h> |
10 | #include <linux/mm.h> | 9 | #include <linux/mm.h> |
11 | #include <linux/proc_fs.h> | 10 | #include <linux/proc_fs.h> |
12 | #include <linux/init.h> | 11 | #include <linux/init.h> |
13 | #include <asm/ebcdic.h> | 12 | #include <asm/ebcdic.h> |
14 | 13 | ||
15 | struct sysinfo_1_1_1 | 14 | struct sysinfo_1_1_1 { |
16 | { | ||
17 | char reserved_0[32]; | 15 | char reserved_0[32]; |
18 | char manufacturer[16]; | 16 | char manufacturer[16]; |
19 | char type[4]; | 17 | char type[4]; |
20 | char reserved_1[12]; | 18 | char reserved_1[12]; |
21 | char model[16]; | 19 | char model_capacity[16]; |
22 | char sequence[16]; | 20 | char sequence[16]; |
23 | char plant[4]; | 21 | char plant[4]; |
22 | char model[16]; | ||
24 | }; | 23 | }; |
25 | 24 | ||
26 | struct sysinfo_1_2_1 | 25 | struct sysinfo_1_2_1 { |
27 | { | ||
28 | char reserved_0[80]; | 26 | char reserved_0[80]; |
29 | char sequence[16]; | 27 | char sequence[16]; |
30 | char plant[4]; | 28 | char plant[4]; |
@@ -32,9 +30,12 @@ struct sysinfo_1_2_1 | |||
32 | unsigned short cpu_address; | 30 | unsigned short cpu_address; |
33 | }; | 31 | }; |
34 | 32 | ||
35 | struct sysinfo_1_2_2 | 33 | struct sysinfo_1_2_2 { |
36 | { | 34 | char format; |
37 | char reserved_0[32]; | 35 | char reserved_0[1]; |
36 | unsigned short acc_offset; | ||
37 | char reserved_1[24]; | ||
38 | unsigned int secondary_capability; | ||
38 | unsigned int capability; | 39 | unsigned int capability; |
39 | unsigned short cpus_total; | 40 | unsigned short cpus_total; |
40 | unsigned short cpus_configured; | 41 | unsigned short cpus_configured; |
@@ -43,8 +44,12 @@ struct sysinfo_1_2_2 | |||
43 | unsigned short adjustment[0]; | 44 | unsigned short adjustment[0]; |
44 | }; | 45 | }; |
45 | 46 | ||
46 | struct sysinfo_2_2_1 | 47 | struct sysinfo_1_2_2_extension { |
47 | { | 48 | unsigned int alt_capability; |
49 | unsigned short alt_adjustment[0]; | ||
50 | }; | ||
51 | |||
52 | struct sysinfo_2_2_1 { | ||
48 | char reserved_0[80]; | 53 | char reserved_0[80]; |
49 | char sequence[16]; | 54 | char sequence[16]; |
50 | char plant[4]; | 55 | char plant[4]; |
@@ -52,15 +57,11 @@ struct sysinfo_2_2_1 | |||
52 | unsigned short cpu_address; | 57 | unsigned short cpu_address; |
53 | }; | 58 | }; |
54 | 59 | ||
55 | struct sysinfo_2_2_2 | 60 | struct sysinfo_2_2_2 { |
56 | { | ||
57 | char reserved_0[32]; | 61 | char reserved_0[32]; |
58 | unsigned short lpar_number; | 62 | unsigned short lpar_number; |
59 | char reserved_1; | 63 | char reserved_1; |
60 | unsigned char characteristics; | 64 | unsigned char characteristics; |
61 | #define LPAR_CHAR_DEDICATED (1 << 7) | ||
62 | #define LPAR_CHAR_SHARED (1 << 6) | ||
63 | #define LPAR_CHAR_LIMITED (1 << 5) | ||
64 | unsigned short cpus_total; | 65 | unsigned short cpus_total; |
65 | unsigned short cpus_configured; | 66 | unsigned short cpus_configured; |
66 | unsigned short cpus_standby; | 67 | unsigned short cpus_standby; |
@@ -72,12 +73,14 @@ struct sysinfo_2_2_2 | |||
72 | unsigned short cpus_shared; | 73 | unsigned short cpus_shared; |
73 | }; | 74 | }; |
74 | 75 | ||
75 | struct sysinfo_3_2_2 | 76 | #define LPAR_CHAR_DEDICATED (1 << 7) |
76 | { | 77 | #define LPAR_CHAR_SHARED (1 << 6) |
78 | #define LPAR_CHAR_LIMITED (1 << 5) | ||
79 | |||
80 | struct sysinfo_3_2_2 { | ||
77 | char reserved_0[31]; | 81 | char reserved_0[31]; |
78 | unsigned char count; | 82 | unsigned char count; |
79 | struct | 83 | struct { |
80 | { | ||
81 | char reserved_0[4]; | 84 | char reserved_0[4]; |
82 | unsigned short cpus_total; | 85 | unsigned short cpus_total; |
83 | unsigned short cpus_configured; | 86 | unsigned short cpus_configured; |
@@ -91,136 +94,223 @@ struct sysinfo_3_2_2 | |||
91 | } vm[8]; | 94 | } vm[8]; |
92 | }; | 95 | }; |
93 | 96 | ||
94 | union s390_sysinfo | 97 | static inline int stsi(void *sysinfo, int fc, int sel1, int sel2) |
95 | { | 98 | { |
96 | struct sysinfo_1_1_1 sysinfo_1_1_1; | 99 | register int r0 asm("0") = (fc << 28) | sel1; |
97 | struct sysinfo_1_2_1 sysinfo_1_2_1; | 100 | register int r1 asm("1") = sel2; |
98 | struct sysinfo_1_2_2 sysinfo_1_2_2; | 101 | |
99 | struct sysinfo_2_2_1 sysinfo_2_2_1; | 102 | asm volatile( |
100 | struct sysinfo_2_2_2 sysinfo_2_2_2; | 103 | " stsi 0(%2)\n" |
101 | struct sysinfo_3_2_2 sysinfo_3_2_2; | 104 | "0: jz 2f\n" |
102 | }; | 105 | "1: lhi %0,%3\n" |
103 | 106 | "2:\n" | |
104 | static inline int stsi (void *sysinfo, | 107 | EX_TABLE(0b,1b) |
105 | int fc, int sel1, int sel2) | 108 | : "+d" (r0) : "d" (r1), "a" (sysinfo), "K" (-ENOSYS) |
106 | { | 109 | : "cc", "memory" ); |
107 | int cc, retv; | 110 | return r0; |
108 | |||
109 | #ifndef CONFIG_64BIT | ||
110 | __asm__ __volatile__ ( "lr\t0,%2\n" | ||
111 | "\tlr\t1,%3\n" | ||
112 | "\tstsi\t0(%4)\n" | ||
113 | "0:\tipm\t%0\n" | ||
114 | "\tsrl\t%0,28\n" | ||
115 | "1:lr\t%1,0\n" | ||
116 | ".section .fixup,\"ax\"\n" | ||
117 | "2:\tlhi\t%0,3\n" | ||
118 | "\tbras\t1,3f\n" | ||
119 | "\t.long 1b\n" | ||
120 | "3:\tl\t1,0(1)\n" | ||
121 | "\tbr\t1\n" | ||
122 | ".previous\n" | ||
123 | ".section __ex_table,\"a\"\n" | ||
124 | "\t.align 4\n" | ||
125 | "\t.long 0b,2b\n" | ||
126 | ".previous\n" | ||
127 | : "=d" (cc), "=d" (retv) | ||
128 | : "d" ((fc << 28) | sel1), "d" (sel2), "a" (sysinfo) | ||
129 | : "cc", "memory", "0", "1" ); | ||
130 | #else | ||
131 | __asm__ __volatile__ ( "lr\t0,%2\n" | ||
132 | "lr\t1,%3\n" | ||
133 | "\tstsi\t0(%4)\n" | ||
134 | "0:\tipm\t%0\n" | ||
135 | "\tsrl\t%0,28\n" | ||
136 | "1:lr\t%1,0\n" | ||
137 | ".section .fixup,\"ax\"\n" | ||
138 | "2:\tlhi\t%0,3\n" | ||
139 | "\tjg\t1b\n" | ||
140 | ".previous\n" | ||
141 | ".section __ex_table,\"a\"\n" | ||
142 | "\t.align 8\n" | ||
143 | "\t.quad 0b,2b\n" | ||
144 | ".previous\n" | ||
145 | : "=d" (cc), "=d" (retv) | ||
146 | : "d" ((fc << 28) | sel1), "d" (sel2), "a" (sysinfo) | ||
147 | : "cc", "memory", "0", "1" ); | ||
148 | #endif | ||
149 | |||
150 | return cc? -1 : retv; | ||
151 | } | 111 | } |
152 | 112 | ||
153 | static inline int stsi_0 (void) | 113 | static inline int stsi_0(void) |
154 | { | 114 | { |
155 | int rc = stsi (NULL, 0, 0, 0); | 115 | int rc = stsi (NULL, 0, 0, 0); |
156 | return rc == -1 ? rc : (((unsigned int)rc) >> 28); | 116 | return rc == -ENOSYS ? rc : (((unsigned int) rc) >> 28); |
157 | } | 117 | } |
158 | 118 | ||
159 | static inline int stsi_1_1_1 (struct sysinfo_1_1_1 *info) | 119 | static int stsi_1_1_1(struct sysinfo_1_1_1 *info, char *page, int len) |
160 | { | 120 | { |
161 | int rc = stsi (info, 1, 1, 1); | 121 | if (stsi(info, 1, 1, 1) == -ENOSYS) |
162 | if (rc != -1) | 122 | return len; |
163 | { | 123 | |
164 | EBCASC (info->manufacturer, sizeof(info->manufacturer)); | 124 | EBCASC(info->manufacturer, sizeof(info->manufacturer)); |
165 | EBCASC (info->type, sizeof(info->type)); | 125 | EBCASC(info->type, sizeof(info->type)); |
166 | EBCASC (info->model, sizeof(info->model)); | 126 | EBCASC(info->model, sizeof(info->model)); |
167 | EBCASC (info->sequence, sizeof(info->sequence)); | 127 | EBCASC(info->sequence, sizeof(info->sequence)); |
168 | EBCASC (info->plant, sizeof(info->plant)); | 128 | EBCASC(info->plant, sizeof(info->plant)); |
169 | } | 129 | EBCASC(info->model_capacity, sizeof(info->model_capacity)); |
170 | return rc == -1 ? rc : 0; | 130 | len += sprintf(page + len, "Manufacturer: %-16.16s\n", |
131 | info->manufacturer); | ||
132 | len += sprintf(page + len, "Type: %-4.4s\n", | ||
133 | info->type); | ||
134 | if (info->model[0] != '\0') | ||
135 | /* | ||
136 | * Sigh: the model field has been renamed with System z9 | ||
137 | * to model_capacity and a new model field has been added | ||
138 | * after the plant field. To avoid confusing older programs | ||
139 | * the "Model:" prints "model_capacity model" or just | ||
140 | * "model_capacity" if the model string is empty . | ||
141 | */ | ||
142 | len += sprintf(page + len, | ||
143 | "Model: %-16.16s %-16.16s\n", | ||
144 | info->model_capacity, info->model); | ||
145 | else | ||
146 | len += sprintf(page + len, "Model: %-16.16s\n", | ||
147 | info->model_capacity); | ||
148 | len += sprintf(page + len, "Sequence Code: %-16.16s\n", | ||
149 | info->sequence); | ||
150 | len += sprintf(page + len, "Plant: %-4.4s\n", | ||
151 | info->plant); | ||
152 | len += sprintf(page + len, "Model Capacity: %-16.16s\n", | ||
153 | info->model_capacity); | ||
154 | return len; | ||
171 | } | 155 | } |
172 | 156 | ||
173 | static inline int stsi_1_2_1 (struct sysinfo_1_2_1 *info) | 157 | #if 0 /* Currently unused */ |
158 | static int stsi_1_2_1(struct sysinfo_1_2_1 *info, char *page, int len) | ||
174 | { | 159 | { |
175 | int rc = stsi (info, 1, 2, 1); | 160 | if (stsi(info, 1, 2, 1) == -ENOSYS) |
176 | if (rc != -1) | 161 | return len; |
177 | { | 162 | |
178 | EBCASC (info->sequence, sizeof(info->sequence)); | 163 | len += sprintf(page + len, "\n"); |
179 | EBCASC (info->plant, sizeof(info->plant)); | 164 | EBCASC(info->sequence, sizeof(info->sequence)); |
180 | } | 165 | EBCASC(info->plant, sizeof(info->plant)); |
181 | return rc == -1 ? rc : 0; | 166 | len += sprintf(page + len, "Sequence Code of CPU: %-16.16s\n", |
167 | info->sequence); | ||
168 | len += sprintf(page + len, "Plant of CPU: %-16.16s\n", | ||
169 | info->plant); | ||
170 | return len; | ||
182 | } | 171 | } |
172 | #endif | ||
183 | 173 | ||
184 | static inline int stsi_1_2_2 (struct sysinfo_1_2_2 *info) | 174 | static int stsi_1_2_2(struct sysinfo_1_2_2 *info, char *page, int len) |
185 | { | 175 | { |
186 | int rc = stsi (info, 1, 2, 2); | 176 | struct sysinfo_1_2_2_extension *ext; |
187 | return rc == -1 ? rc : 0; | 177 | int i; |
178 | |||
179 | if (stsi(info, 1, 2, 2) == -ENOSYS) | ||
180 | return len; | ||
181 | ext = (struct sysinfo_1_2_2_extension *) | ||
182 | ((unsigned long) info + info->acc_offset); | ||
183 | |||
184 | len += sprintf(page + len, "\n"); | ||
185 | len += sprintf(page + len, "CPUs Total: %d\n", | ||
186 | info->cpus_total); | ||
187 | len += sprintf(page + len, "CPUs Configured: %d\n", | ||
188 | info->cpus_configured); | ||
189 | len += sprintf(page + len, "CPUs Standby: %d\n", | ||
190 | info->cpus_standby); | ||
191 | len += sprintf(page + len, "CPUs Reserved: %d\n", | ||
192 | info->cpus_reserved); | ||
193 | |||
194 | if (info->format == 1) { | ||
195 | /* | ||
196 | * Sigh 2. According to the specification the alternate | ||
197 | * capability field is a 32 bit floating point number | ||
198 | * if the higher order 8 bits are not zero. Printing | ||
199 | * a floating point number in the kernel is a no-no, | ||
200 | * always print the number as 32 bit unsigned integer. | ||
201 | * The user-space needs to know about the stange | ||
202 | * encoding of the alternate cpu capability. | ||
203 | */ | ||
204 | len += sprintf(page + len, "Capability: %u %u\n", | ||
205 | info->capability, ext->alt_capability); | ||
206 | for (i = 2; i <= info->cpus_total; i++) | ||
207 | len += sprintf(page + len, | ||
208 | "Adjustment %02d-way: %u %u\n", | ||
209 | i, info->adjustment[i-2], | ||
210 | ext->alt_adjustment[i-2]); | ||
211 | |||
212 | } else { | ||
213 | len += sprintf(page + len, "Capability: %u\n", | ||
214 | info->capability); | ||
215 | for (i = 2; i <= info->cpus_total; i++) | ||
216 | len += sprintf(page + len, | ||
217 | "Adjustment %02d-way: %u\n", | ||
218 | i, info->adjustment[i-2]); | ||
219 | } | ||
220 | |||
221 | if (info->secondary_capability != 0) | ||
222 | len += sprintf(page + len, "Secondary Capability: %d\n", | ||
223 | info->secondary_capability); | ||
224 | |||
225 | return len; | ||
188 | } | 226 | } |
189 | 227 | ||
190 | static inline int stsi_2_2_1 (struct sysinfo_2_2_1 *info) | 228 | #if 0 /* Currently unused */ |
229 | static int stsi_2_2_1(struct sysinfo_2_2_1 *info, char *page, int len) | ||
191 | { | 230 | { |
192 | int rc = stsi (info, 2, 2, 1); | 231 | if (stsi(info, 2, 2, 1) == -ENOSYS) |
193 | if (rc != -1) | 232 | return len; |
194 | { | 233 | |
195 | EBCASC (info->sequence, sizeof(info->sequence)); | 234 | len += sprintf(page + len, "\n"); |
196 | EBCASC (info->plant, sizeof(info->plant)); | 235 | EBCASC (info->sequence, sizeof(info->sequence)); |
197 | } | 236 | EBCASC (info->plant, sizeof(info->plant)); |
198 | return rc == -1 ? rc : 0; | 237 | len += sprintf(page + len, "Sequence Code of logical CPU: %-16.16s\n", |
238 | info->sequence); | ||
239 | len += sprintf(page + len, "Plant of logical CPU: %-16.16s\n", | ||
240 | info->plant); | ||
241 | return len; | ||
199 | } | 242 | } |
243 | #endif | ||
200 | 244 | ||
201 | static inline int stsi_2_2_2 (struct sysinfo_2_2_2 *info) | 245 | static int stsi_2_2_2(struct sysinfo_2_2_2 *info, char *page, int len) |
202 | { | 246 | { |
203 | int rc = stsi (info, 2, 2, 2); | 247 | if (stsi(info, 2, 2, 2) == -ENOSYS) |
204 | if (rc != -1) | 248 | return len; |
205 | { | 249 | |
206 | EBCASC (info->name, sizeof(info->name)); | 250 | EBCASC (info->name, sizeof(info->name)); |
207 | } | 251 | |
208 | return rc == -1 ? rc : 0; | 252 | len += sprintf(page + len, "\n"); |
253 | len += sprintf(page + len, "LPAR Number: %d\n", | ||
254 | info->lpar_number); | ||
255 | |||
256 | len += sprintf(page + len, "LPAR Characteristics: "); | ||
257 | if (info->characteristics & LPAR_CHAR_DEDICATED) | ||
258 | len += sprintf(page + len, "Dedicated "); | ||
259 | if (info->characteristics & LPAR_CHAR_SHARED) | ||
260 | len += sprintf(page + len, "Shared "); | ||
261 | if (info->characteristics & LPAR_CHAR_LIMITED) | ||
262 | len += sprintf(page + len, "Limited "); | ||
263 | len += sprintf(page + len, "\n"); | ||
264 | |||
265 | len += sprintf(page + len, "LPAR Name: %-8.8s\n", | ||
266 | info->name); | ||
267 | |||
268 | len += sprintf(page + len, "LPAR Adjustment: %d\n", | ||
269 | info->caf); | ||
270 | |||
271 | len += sprintf(page + len, "LPAR CPUs Total: %d\n", | ||
272 | info->cpus_total); | ||
273 | len += sprintf(page + len, "LPAR CPUs Configured: %d\n", | ||
274 | info->cpus_configured); | ||
275 | len += sprintf(page + len, "LPAR CPUs Standby: %d\n", | ||
276 | info->cpus_standby); | ||
277 | len += sprintf(page + len, "LPAR CPUs Reserved: %d\n", | ||
278 | info->cpus_reserved); | ||
279 | len += sprintf(page + len, "LPAR CPUs Dedicated: %d\n", | ||
280 | info->cpus_dedicated); | ||
281 | len += sprintf(page + len, "LPAR CPUs Shared: %d\n", | ||
282 | info->cpus_shared); | ||
283 | return len; | ||
209 | } | 284 | } |
210 | 285 | ||
211 | static inline int stsi_3_2_2 (struct sysinfo_3_2_2 *info) | 286 | static int stsi_3_2_2(struct sysinfo_3_2_2 *info, char *page, int len) |
212 | { | 287 | { |
213 | int rc = stsi (info, 3, 2, 2); | 288 | int i; |
214 | if (rc != -1) | 289 | |
215 | { | 290 | if (stsi(info, 3, 2, 2) == -ENOSYS) |
216 | int i; | 291 | return len; |
217 | for (i = 0; i < info->count; i++) | 292 | for (i = 0; i < info->count; i++) { |
218 | { | 293 | EBCASC (info->vm[i].name, sizeof(info->vm[i].name)); |
219 | EBCASC (info->vm[i].name, sizeof(info->vm[i].name)); | 294 | EBCASC (info->vm[i].cpi, sizeof(info->vm[i].cpi)); |
220 | EBCASC (info->vm[i].cpi, sizeof(info->vm[i].cpi)); | 295 | len += sprintf(page + len, "\n"); |
221 | } | 296 | len += sprintf(page + len, "VM%02d Name: %-8.8s\n", |
297 | i, info->vm[i].name); | ||
298 | len += sprintf(page + len, "VM%02d Control Program: %-16.16s\n", | ||
299 | i, info->vm[i].cpi); | ||
300 | |||
301 | len += sprintf(page + len, "VM%02d Adjustment: %d\n", | ||
302 | i, info->vm[i].caf); | ||
303 | |||
304 | len += sprintf(page + len, "VM%02d CPUs Total: %d\n", | ||
305 | i, info->vm[i].cpus_total); | ||
306 | len += sprintf(page + len, "VM%02d CPUs Configured: %d\n", | ||
307 | i, info->vm[i].cpus_configured); | ||
308 | len += sprintf(page + len, "VM%02d CPUs Standby: %d\n", | ||
309 | i, info->vm[i].cpus_standby); | ||
310 | len += sprintf(page + len, "VM%02d CPUs Reserved: %d\n", | ||
311 | i, info->vm[i].cpus_reserved); | ||
222 | } | 312 | } |
223 | return rc == -1 ? rc : 0; | 313 | return len; |
224 | } | 314 | } |
225 | 315 | ||
226 | 316 | ||
@@ -228,118 +318,34 @@ static int proc_read_sysinfo(char *page, char **start, | |||
228 | off_t off, int count, | 318 | off_t off, int count, |
229 | int *eof, void *data) | 319 | int *eof, void *data) |
230 | { | 320 | { |
231 | unsigned long info_page = get_zeroed_page (GFP_KERNEL); | 321 | unsigned long info = get_zeroed_page (GFP_KERNEL); |
232 | union s390_sysinfo *info = (union s390_sysinfo *) info_page; | 322 | int level, len; |
233 | int len = 0; | ||
234 | int level; | ||
235 | int i; | ||
236 | 323 | ||
237 | if (!info) | 324 | if (!info) |
238 | return 0; | 325 | return 0; |
239 | 326 | ||
240 | level = stsi_0 (); | 327 | len = 0; |
241 | 328 | level = stsi_0(); | |
242 | if (level >= 1 && stsi_1_1_1 (&info->sysinfo_1_1_1) == 0) | 329 | if (level >= 1) |
243 | { | 330 | len = stsi_1_1_1((struct sysinfo_1_1_1 *) info, page, len); |
244 | len += sprintf (page+len, "Manufacturer: %-16.16s\n", | ||
245 | info->sysinfo_1_1_1.manufacturer); | ||
246 | len += sprintf (page+len, "Type: %-4.4s\n", | ||
247 | info->sysinfo_1_1_1.type); | ||
248 | len += sprintf (page+len, "Model: %-16.16s\n", | ||
249 | info->sysinfo_1_1_1.model); | ||
250 | len += sprintf (page+len, "Sequence Code: %-16.16s\n", | ||
251 | info->sysinfo_1_1_1.sequence); | ||
252 | len += sprintf (page+len, "Plant: %-4.4s\n", | ||
253 | info->sysinfo_1_1_1.plant); | ||
254 | } | ||
255 | |||
256 | if (level >= 1 && stsi_1_2_2 (&info->sysinfo_1_2_2) == 0) | ||
257 | { | ||
258 | len += sprintf (page+len, "\n"); | ||
259 | len += sprintf (page+len, "CPUs Total: %d\n", | ||
260 | info->sysinfo_1_2_2.cpus_total); | ||
261 | len += sprintf (page+len, "CPUs Configured: %d\n", | ||
262 | info->sysinfo_1_2_2.cpus_configured); | ||
263 | len += sprintf (page+len, "CPUs Standby: %d\n", | ||
264 | info->sysinfo_1_2_2.cpus_standby); | ||
265 | len += sprintf (page+len, "CPUs Reserved: %d\n", | ||
266 | info->sysinfo_1_2_2.cpus_reserved); | ||
267 | |||
268 | len += sprintf (page+len, "Capability: %d\n", | ||
269 | info->sysinfo_1_2_2.capability); | ||
270 | 331 | ||
271 | for (i = 2; i <= info->sysinfo_1_2_2.cpus_total; i++) | 332 | if (level >= 1) |
272 | len += sprintf (page+len, "Adjustment %02d-way: %d\n", | 333 | len = stsi_1_2_2((struct sysinfo_1_2_2 *) info, page, len); |
273 | i, info->sysinfo_1_2_2.adjustment[i-2]); | ||
274 | } | ||
275 | 334 | ||
276 | if (level >= 2 && stsi_2_2_2 (&info->sysinfo_2_2_2) == 0) | 335 | if (level >= 2) |
277 | { | 336 | len = stsi_2_2_2((struct sysinfo_2_2_2 *) info, page, len); |
278 | len += sprintf (page+len, "\n"); | ||
279 | len += sprintf (page+len, "LPAR Number: %d\n", | ||
280 | info->sysinfo_2_2_2.lpar_number); | ||
281 | |||
282 | len += sprintf (page+len, "LPAR Characteristics: "); | ||
283 | if (info->sysinfo_2_2_2.characteristics & LPAR_CHAR_DEDICATED) | ||
284 | len += sprintf (page+len, "Dedicated "); | ||
285 | if (info->sysinfo_2_2_2.characteristics & LPAR_CHAR_SHARED) | ||
286 | len += sprintf (page+len, "Shared "); | ||
287 | if (info->sysinfo_2_2_2.characteristics & LPAR_CHAR_LIMITED) | ||
288 | len += sprintf (page+len, "Limited "); | ||
289 | len += sprintf (page+len, "\n"); | ||
290 | |||
291 | len += sprintf (page+len, "LPAR Name: %-8.8s\n", | ||
292 | info->sysinfo_2_2_2.name); | ||
293 | |||
294 | len += sprintf (page+len, "LPAR Adjustment: %d\n", | ||
295 | info->sysinfo_2_2_2.caf); | ||
296 | |||
297 | len += sprintf (page+len, "LPAR CPUs Total: %d\n", | ||
298 | info->sysinfo_2_2_2.cpus_total); | ||
299 | len += sprintf (page+len, "LPAR CPUs Configured: %d\n", | ||
300 | info->sysinfo_2_2_2.cpus_configured); | ||
301 | len += sprintf (page+len, "LPAR CPUs Standby: %d\n", | ||
302 | info->sysinfo_2_2_2.cpus_standby); | ||
303 | len += sprintf (page+len, "LPAR CPUs Reserved: %d\n", | ||
304 | info->sysinfo_2_2_2.cpus_reserved); | ||
305 | len += sprintf (page+len, "LPAR CPUs Dedicated: %d\n", | ||
306 | info->sysinfo_2_2_2.cpus_dedicated); | ||
307 | len += sprintf (page+len, "LPAR CPUs Shared: %d\n", | ||
308 | info->sysinfo_2_2_2.cpus_shared); | ||
309 | } | ||
310 | 337 | ||
311 | if (level >= 3 && stsi_3_2_2 (&info->sysinfo_3_2_2) == 0) | 338 | if (level >= 3) |
312 | { | 339 | len = stsi_3_2_2((struct sysinfo_3_2_2 *) info, page, len); |
313 | for (i = 0; i < info->sysinfo_3_2_2.count; i++) | ||
314 | { | ||
315 | len += sprintf (page+len, "\n"); | ||
316 | len += sprintf (page+len, "VM%02d Name: %-8.8s\n", | ||
317 | i, info->sysinfo_3_2_2.vm[i].name); | ||
318 | len += sprintf (page+len, "VM%02d Control Program: %-16.16s\n", | ||
319 | i, info->sysinfo_3_2_2.vm[i].cpi); | ||
320 | |||
321 | len += sprintf (page+len, "VM%02d Adjustment: %d\n", | ||
322 | i, info->sysinfo_3_2_2.vm[i].caf); | ||
323 | |||
324 | len += sprintf (page+len, "VM%02d CPUs Total: %d\n", | ||
325 | i, info->sysinfo_3_2_2.vm[i].cpus_total); | ||
326 | len += sprintf (page+len, "VM%02d CPUs Configured: %d\n", | ||
327 | i, info->sysinfo_3_2_2.vm[i].cpus_configured); | ||
328 | len += sprintf (page+len, "VM%02d CPUs Standby: %d\n", | ||
329 | i, info->sysinfo_3_2_2.vm[i].cpus_standby); | ||
330 | len += sprintf (page+len, "VM%02d CPUs Reserved: %d\n", | ||
331 | i, info->sysinfo_3_2_2.vm[i].cpus_reserved); | ||
332 | } | ||
333 | } | ||
334 | 340 | ||
335 | free_page (info_page); | 341 | free_page (info); |
336 | return len; | 342 | return len; |
337 | } | 343 | } |
338 | 344 | ||
339 | static __init int create_proc_sysinfo(void) | 345 | static __init int create_proc_sysinfo(void) |
340 | { | 346 | { |
341 | create_proc_read_entry ("sysinfo", 0444, NULL, | 347 | create_proc_read_entry("sysinfo", 0444, NULL, |
342 | proc_read_sysinfo, NULL); | 348 | proc_read_sysinfo, NULL); |
343 | return 0; | 349 | return 0; |
344 | } | 350 | } |
345 | 351 | ||