kvm tools, setup: Create private directory
[linux-2.6/next.git] / arch / s390 / include / asm / sysinfo.h
blob79d3d6e2e9c5681787ca1c8064c35b6a87992668
1 /*
2 * definition for store system information stsi
4 * Copyright IBM Corp. 2001,2008
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.
10 * Author(s): Ulrich Weigand <weigand@de.ibm.com>
11 * Christian Borntraeger <borntraeger@de.ibm.com>
14 #ifndef __ASM_S390_SYSINFO_H
15 #define __ASM_S390_SYSINFO_H
17 #include <asm/bitsperlong.h>
19 struct sysinfo_1_1_1 {
20 unsigned short :16;
21 unsigned char ccr;
22 unsigned char cai;
23 char reserved_0[28];
24 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];
31 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];
38 struct 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;
46 struct 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];
60 struct sysinfo_1_2_2_extension {
61 unsigned int alt_capability;
62 unsigned short alt_adjustment[0];
65 struct 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;
73 struct 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;
89 #define LPAR_CHAR_DEDICATED (1 << 7)
90 #define LPAR_CHAR_SHARED (1 << 6)
91 #define LPAR_CHAR_LIMITED (1 << 5)
93 struct sysinfo_3_2_2 {
94 char reserved_0[31];
95 unsigned char :4;
96 unsigned char count:4;
97 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];
108 } vm[8];
109 char reserved_544[3552];
112 #define TOPOLOGY_CPU_BITS 64
113 #define TOPOLOGY_NR_MAG 6
115 struct 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];
124 struct topology_container {
125 unsigned char reserved[7];
126 unsigned char id;
129 union topology_entry {
130 unsigned char nl;
131 struct topology_cpu cpu;
132 struct topology_container container;
135 struct 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];
145 static inline int stsi(void *sysinfo, int fc, int sel1, int sel2)
147 register int r0 asm("0") = (fc << 28) | sel1;
148 register int r1 asm("1") = sel2;
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;
162 * Service level reporting interface.
164 struct service_level {
165 struct list_head list;
166 void (*seq_print)(struct seq_file *, struct service_level *);
169 int register_service_level(struct service_level *);
170 int unregister_service_level(struct service_level *);
172 #endif /* __ASM_S390_SYSINFO_H */