Warning: This file is not a C or C++ file. It does not have highlighting.
| 1 | /* s390 version of processor capability information handling macros. |
|---|---|
| 2 | Copyright (C) 2006-2024 Free Software Foundation, Inc. |
| 3 | This file is part of the GNU C Library. |
| 4 | |
| 5 | The GNU C Library is free software; you can redistribute it and/or |
| 6 | modify it under the terms of the GNU Lesser General Public |
| 7 | License as published by the Free Software Foundation; either |
| 8 | version 2.1 of the License, or (at your option) any later version. |
| 9 | |
| 10 | The GNU C Library is distributed in the hope that it will be useful, |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 13 | Lesser General Public License for more details. |
| 14 | |
| 15 | You should have received a copy of the GNU Lesser General Public |
| 16 | License along with the GNU C Library; if not, see |
| 17 | <https://www.gnu.org/licenses/>. */ |
| 18 | |
| 19 | #ifndef _DL_PROCINFO_H |
| 20 | #define _DL_PROCINFO_H 1 |
| 21 | #include <ldsodefs.h> |
| 22 | |
| 23 | #define _DL_HWCAP_COUNT 23 |
| 24 | extern const char _dl_s390_cap_flags[_DL_HWCAP_COUNT][9] attribute_hidden; |
| 25 | |
| 26 | #define _DL_PLATFORMS_COUNT 11 |
| 27 | extern const char _dl_s390_platforms[_DL_PLATFORMS_COUNT][7] attribute_hidden; |
| 28 | |
| 29 | /* The kernel provides up to 32 capability bits with elf_hwcap. */ |
| 30 | #define _DL_FIRST_PLATFORM 32 |
| 31 | /* Mask to filter out platforms. */ |
| 32 | #define _DL_HWCAP_PLATFORM (((1ULL << _DL_PLATFORMS_COUNT) - 1) \ |
| 33 | << _DL_FIRST_PLATFORM) |
| 34 | |
| 35 | /* Hardware capability bit numbers are derived directly from the |
| 36 | facility indications as stored by the "store facility list" (STFL) |
| 37 | instruction. |
| 38 | highgprs is an alien in that list. It describes a *kernel* |
| 39 | capability. */ |
| 40 | |
| 41 | enum |
| 42 | { |
| 43 | HWCAP_S390_ESAN3 = 1 << 0, |
| 44 | HWCAP_S390_ZARCH = 1 << 1, |
| 45 | HWCAP_S390_STFLE = 1 << 2, |
| 46 | HWCAP_S390_MSA = 1 << 3, |
| 47 | HWCAP_S390_LDISP = 1 << 4, |
| 48 | HWCAP_S390_EIMM = 1 << 5, |
| 49 | HWCAP_S390_DFP = 1 << 6, |
| 50 | HWCAP_S390_HPAGE = 1 << 7, |
| 51 | HWCAP_S390_ETF3EH = 1 << 8, |
| 52 | HWCAP_S390_HIGH_GPRS = 1 << 9, |
| 53 | HWCAP_S390_TE = 1 << 10, |
| 54 | HWCAP_S390_VX = 1 << 11, |
| 55 | HWCAP_S390_VXRS = HWCAP_S390_VX, |
| 56 | HWCAP_S390_VXD = 1 << 12, |
| 57 | HWCAP_S390_VXRS_BCD = HWCAP_S390_VXD, |
| 58 | HWCAP_S390_VXE = 1 << 13, |
| 59 | HWCAP_S390_VXRS_EXT = HWCAP_S390_VXE, |
| 60 | HWCAP_S390_GS = 1 << 14, |
| 61 | HWCAP_S390_VXRS_EXT2 = 1 << 15, |
| 62 | HWCAP_S390_VXRS_PDE = 1 << 16, |
| 63 | HWCAP_S390_SORT = 1 << 17, |
| 64 | HWCAP_S390_DFLT = 1 << 18, |
| 65 | HWCAP_S390_VXRS_PDE2 = 1 << 19, |
| 66 | HWCAP_S390_NNPA = 1 << 20, |
| 67 | HWCAP_S390_PCI_MIO = 1 << 21, |
| 68 | HWCAP_S390_SIE = 1 << 22, |
| 69 | }; |
| 70 | |
| 71 | #define HWCAP_IMPORTANT (HWCAP_S390_ZARCH | HWCAP_S390_LDISP \ |
| 72 | | HWCAP_S390_EIMM | HWCAP_S390_DFP \ |
| 73 | | HWCAP_S390_VX | HWCAP_S390_VXE \ |
| 74 | | HWCAP_S390_VXRS_EXT2) |
| 75 | |
| 76 | /* We cannot provide a general printing function. */ |
| 77 | #define _dl_procinfo(type, word) -1 |
| 78 | |
| 79 | static inline const char * |
| 80 | __attribute__ ((unused)) |
| 81 | _dl_hwcap_string (int idx) |
| 82 | { |
| 83 | return _dl_s390_cap_flags[idx]; |
| 84 | }; |
| 85 | |
| 86 | static inline int |
| 87 | __attribute__ ((unused, always_inline)) |
| 88 | _dl_string_platform (const char *str) |
| 89 | { |
| 90 | int i; |
| 91 | |
| 92 | if (str != NULL) |
| 93 | for (i = 0; i < _DL_PLATFORMS_COUNT; ++i) |
| 94 | { |
| 95 | if (strcmp (str, _dl_s390_platforms[i]) == 0) |
| 96 | return _DL_FIRST_PLATFORM + i; |
| 97 | } |
| 98 | return -1; |
| 99 | }; |
| 100 | |
| 101 | #endif /* dl-procinfo.h */ |
| 102 |
Warning: This file is not a C or C++ file. It does not have highlighting.
