KVM: s390: arch backend for the kvm kernel module
[linux-2.6/openmoko-kernel/knife-kernel.git] / include / asm-s390 / sysinfo.h
blobabe10ae15e468d9e8e6733fd26e4a5b0d3bdc7e6
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 struct sysinfo_1_1_1 {
15 char reserved_0[32];
16 char manufacturer[16];
17 char type[4];
18 char reserved_1[12];
19 char model_capacity[16];
20 char sequence[16];
21 char plant[4];
22 char model[16];
23 char model_perm_cap[16];
24 char model_temp_cap[16];
25 char model_cap_rating[4];
26 char model_perm_cap_rating[4];
27 char model_temp_cap_rating[4];
30 struct sysinfo_1_2_1 {
31 char reserved_0[80];
32 char sequence[16];
33 char plant[4];
34 char reserved_1[2];
35 unsigned short cpu_address;
38 struct sysinfo_1_2_2 {
39 char format;
40 char reserved_0[1];
41 unsigned short acc_offset;
42 char reserved_1[24];
43 unsigned int secondary_capability;
44 unsigned int capability;
45 unsigned short cpus_total;
46 unsigned short cpus_configured;
47 unsigned short cpus_standby;
48 unsigned short cpus_reserved;
49 unsigned short adjustment[0];
52 struct sysinfo_1_2_2_extension {
53 unsigned int alt_capability;
54 unsigned short alt_adjustment[0];
57 struct sysinfo_2_2_1 {
58 char reserved_0[80];
59 char sequence[16];
60 char plant[4];
61 unsigned short cpu_id;
62 unsigned short cpu_address;
65 struct sysinfo_2_2_2 {
66 char reserved_0[32];
67 unsigned short lpar_number;
68 char reserved_1;
69 unsigned char characteristics;
70 unsigned short cpus_total;
71 unsigned short cpus_configured;
72 unsigned short cpus_standby;
73 unsigned short cpus_reserved;
74 char name[8];
75 unsigned int caf;
76 char reserved_2[16];
77 unsigned short cpus_dedicated;
78 unsigned short cpus_shared;
81 #define LPAR_CHAR_DEDICATED (1 << 7)
82 #define LPAR_CHAR_SHARED (1 << 6)
83 #define LPAR_CHAR_LIMITED (1 << 5)
85 struct sysinfo_3_2_2 {
86 char reserved_0[31];
87 unsigned char count;
88 struct {
89 char reserved_0[4];
90 unsigned short cpus_total;
91 unsigned short cpus_configured;
92 unsigned short cpus_standby;
93 unsigned short cpus_reserved;
94 char name[8];
95 unsigned int caf;
96 char cpi[16];
97 char reserved_1[24];
99 } vm[8];
102 static inline int stsi(void *sysinfo, int fc, int sel1, int sel2)
104 register int r0 asm("0") = (fc << 28) | sel1;
105 register int r1 asm("1") = sel2;
107 asm volatile(
108 " stsi 0(%2)\n"
109 "0: jz 2f\n"
110 "1: lhi %0,%3\n"
111 "2:\n"
112 EX_TABLE(0b, 1b)
113 : "+d" (r0) : "d" (r1), "a" (sysinfo), "K" (-ENOSYS)
114 : "cc", "memory");
115 return r0;