1 /* s390 version of processor capability information handling macros.
2 Copyright (C) 2006, 2009 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
4 Contributed by Martin Schwidefsky <schwidefsky@de.ibm.com>, 2006.
6 The GNU C Library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Lesser General Public
8 License as published by the Free Software Foundation; either
9 version 2.1 of the License, or (at your option) any later version.
11 The GNU C Library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Lesser General Public License for more details.
16 You should have received a copy of the GNU Lesser General Public
17 License along with the GNU C Library; if not, see
18 <http://www.gnu.org/licenses/>. */
20 #ifndef _DL_PROCINFO_H
21 #define _DL_PROCINFO_H 1
24 #define _DL_HWCAP_COUNT 10
26 #define _DL_PLATFORMS_COUNT 5
28 /* The kernel provides up to 32 capability bits with elf_hwcap. */
29 #define _DL_FIRST_PLATFORM 32
30 /* Mask to filter out platforms. */
31 #define _DL_HWCAP_PLATFORM (((1ULL << _DL_PLATFORMS_COUNT) - 1) \
32 << _DL_FIRST_PLATFORM)
34 /* Hardware capablity bit numbers are derived directly from the
35 facility indications as stored by the "store facility list" (STFL)
40 HWCAP_S390_ESAN3
= 1 << 0,
41 HWCAP_S390_ZARCH
= 1 << 1,
42 HWCAP_S390_STFLE
= 1 << 2,
43 HWCAP_S390_MSA
= 1 << 3,
44 HWCAP_S390_LDISP
= 1 << 4,
45 HWCAP_S390_EIMM
= 1 << 5,
46 HWCAP_S390_DFP
= 1 << 6,
47 HWCAP_S390_HPAGE
= 1 << 7,
48 HWCAP_S390_ETF3EH
= 1 << 8,
49 HWCAP_S390_HIGH_GPRS
= 1 << 9,
52 #define HWCAP_IMPORTANT (HWCAP_S390_ZARCH | HWCAP_S390_LDISP \
53 | HWCAP_S390_EIMM | HWCAP_S390_DFP)
55 /* We cannot provide a general printing function. */
56 #define _dl_procinfo(word) -1
58 static inline const char *
59 __attribute__ ((unused
))
60 _dl_hwcap_string (int idx
)
62 return GLRO(dl_s390_cap_flags
)[idx
];
65 static inline const char *
66 __attribute__ ((unused
))
67 _dl_platform_string (int idx
)
69 return GLRO(dl_s390_platforms
)[idx
- _DL_FIRST_PLATFORM
];
73 __attribute__ ((unused
, always_inline
))
74 _dl_string_hwcap (const char *str
)
78 for (i
= 0; i
< _DL_HWCAP_COUNT
; i
++)
80 if (strcmp (str
, GLRO(dl_s390_cap_flags
)[i
]) == 0)
87 __attribute__ ((unused
, always_inline
))
88 _dl_string_platform (const char *str
)
93 for (i
= 0; i
< _DL_PLATFORMS_COUNT
; ++i
)
95 if (strcmp (str
, GLRO(dl_s390_platforms
)[i
]) == 0)
96 return _DL_FIRST_PLATFORM
+ i
;
101 #endif /* dl-procinfo.h */