Christian Borntraeger | aa24f7f | 2008-04-17 07:46:09 +0200 | [diff] [blame] | 1 | /* |
| 2 | * definition for store system information stsi |
| 3 | * |
Heiko Carstens | a53c8fa | 2012-07-20 11:15:04 +0200 | [diff] [blame] | 4 | * Copyright IBM Corp. 2001, 2008 |
Christian Borntraeger | aa24f7f | 2008-04-17 07:46:09 +0200 | [diff] [blame] | 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 Carstens | f291e17 | 2008-04-30 13:38:35 +0200 | [diff] [blame] | 14 | #ifndef __ASM_S390_SYSINFO_H |
| 15 | #define __ASM_S390_SYSINFO_H |
| 16 | |
Heiko Carstens | c30f91b | 2010-10-25 16:10:53 +0200 | [diff] [blame] | 17 | #include <asm/bitsperlong.h> |
| 18 | |
Christian Borntraeger | aa24f7f | 2008-04-17 07:46:09 +0200 | [diff] [blame] | 19 | struct sysinfo_1_1_1 { |
Heiko Carstens | 25502f0 | 2012-09-03 14:05:05 +0200 | [diff] [blame] | 20 | unsigned char p:1; |
| 21 | unsigned char :6; |
| 22 | unsigned char t:1; |
| 23 | unsigned char :8; |
Heiko Carstens | 7aca2ed | 2010-10-25 16:10:16 +0200 | [diff] [blame] | 24 | unsigned char ccr; |
| 25 | unsigned char cai; |
| 26 | char reserved_0[28]; |
Christian Borntraeger | aa24f7f | 2008-04-17 07:46:09 +0200 | [diff] [blame] | 27 | 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 Schwidefsky | cbce70e | 2008-04-17 07:46:10 +0200 | [diff] [blame] | 34 | char model_perm_cap[16]; |
| 35 | char model_temp_cap[16]; |
Heiko Carstens | 25502f0 | 2012-09-03 14:05:05 +0200 | [diff] [blame] | 36 | 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 Borntraeger | aa24f7f | 2008-04-17 07:46:09 +0200 | [diff] [blame] | 44 | }; |
| 45 | |
| 46 | struct 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 | |
| 54 | struct sysinfo_1_2_2 { |
| 55 | char format; |
| 56 | char reserved_0[1]; |
| 57 | unsigned short acc_offset; |
Heiko Carstens | 25502f0 | 2012-09-03 14:05:05 +0200 | [diff] [blame] | 58 | char reserved_1[20]; |
| 59 | unsigned int nominal_cap; |
| 60 | unsigned int secondary_cap; |
Christian Borntraeger | aa24f7f | 2008-04-17 07:46:09 +0200 | [diff] [blame] | 61 | 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 | |
| 69 | struct sysinfo_1_2_2_extension { |
| 70 | unsigned int alt_capability; |
| 71 | unsigned short alt_adjustment[0]; |
| 72 | }; |
| 73 | |
| 74 | struct 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 | |
| 82 | struct 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 | |
| 102 | struct sysinfo_3_2_2 { |
| 103 | char reserved_0[31]; |
Heiko Carstens | 8387c73 | 2010-02-26 22:37:39 +0100 | [diff] [blame] | 104 | unsigned char :4; |
| 105 | unsigned char count:4; |
Christian Borntraeger | aa24f7f | 2008-04-17 07:46:09 +0200 | [diff] [blame] | 106 | 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 Borntraeger | 92e6ecf | 2009-03-26 15:23:58 +0100 | [diff] [blame] | 118 | char reserved_544[3552]; |
Christian Borntraeger | aa24f7f | 2008-04-17 07:46:09 +0200 | [diff] [blame] | 119 | }; |
| 120 | |
Heiko Carstens | fade4dc | 2012-09-04 14:26:03 +0200 | [diff] [blame] | 121 | extern int topology_max_mnest; |
| 122 | |
Heiko Carstens | c30f91b | 2010-10-25 16:10:53 +0200 | [diff] [blame] | 123 | #define TOPOLOGY_CPU_BITS 64 |
| 124 | #define TOPOLOGY_NR_MAG 6 |
| 125 | |
| 126 | struct 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 | |
| 135 | struct topology_container { |
| 136 | unsigned char reserved[7]; |
| 137 | unsigned char id; |
| 138 | }; |
| 139 | |
| 140 | union topology_entry { |
| 141 | unsigned char nl; |
| 142 | struct topology_cpu cpu; |
| 143 | struct topology_container container; |
| 144 | }; |
| 145 | |
| 146 | struct 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 | |
Heiko Carstens | caf757c | 2012-09-06 14:42:13 +0200 | [diff] [blame] | 156 | int stsi(void *sysinfo, int fc, int sel1, int sel2); |
Heiko Carstens | f291e17 | 2008-04-30 13:38:35 +0200 | [diff] [blame] | 157 | |
Martin Schwidefsky | 6bcac50 | 2008-12-25 13:38:49 +0100 | [diff] [blame] | 158 | /* |
| 159 | * Service level reporting interface. |
| 160 | */ |
| 161 | struct service_level { |
| 162 | struct list_head list; |
| 163 | void (*seq_print)(struct seq_file *, struct service_level *); |
| 164 | }; |
| 165 | |
| 166 | int register_service_level(struct service_level *); |
| 167 | int unregister_service_level(struct service_level *); |
| 168 | |
Heiko Carstens | f291e17 | 2008-04-30 13:38:35 +0200 | [diff] [blame] | 169 | #endif /* __ASM_S390_SYSINFO_H */ |