Christian Borntraeger | aa24f7f | 2008-04-17 07:46:09 +0200 | [diff] [blame] | 1 | /* |
| 2 | * definition for store system information stsi |
| 3 | * |
| 4 | * Copyright IBM Corp. 2001,2008 |
| 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 | |
| 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]; |
Martin Schwidefsky | cbce70e | 2008-04-17 07:46:10 +0200 | [diff] [blame^] | 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]; |
Christian Borntraeger | aa24f7f | 2008-04-17 07:46:09 +0200 | [diff] [blame] | 28 | }; |
| 29 | |
| 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; |
| 36 | }; |
| 37 | |
| 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]; |
| 50 | }; |
| 51 | |
| 52 | struct sysinfo_1_2_2_extension { |
| 53 | unsigned int alt_capability; |
| 54 | unsigned short alt_adjustment[0]; |
| 55 | }; |
| 56 | |
| 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; |
| 63 | }; |
| 64 | |
| 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; |
| 79 | }; |
| 80 | |
| 81 | #define LPAR_CHAR_DEDICATED (1 << 7) |
| 82 | #define LPAR_CHAR_SHARED (1 << 6) |
| 83 | #define LPAR_CHAR_LIMITED (1 << 5) |
| 84 | |
| 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]; |
| 98 | |
| 99 | } vm[8]; |
| 100 | }; |
| 101 | |
| 102 | static inline int stsi(void *sysinfo, int fc, int sel1, int sel2) |
| 103 | { |
| 104 | register int r0 asm("0") = (fc << 28) | sel1; |
| 105 | register int r1 asm("1") = sel2; |
| 106 | |
| 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; |
| 116 | } |