aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/unix/sysv/linux/s390/sysconf.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/unix/sysv/linux/s390/sysconf.c')
-rw-r--r--sysdeps/unix/sysv/linux/s390/sysconf.c29
1 files changed, 7 insertions, 22 deletions
diff --git a/sysdeps/unix/sysv/linux/s390/sysconf.c b/sysdeps/unix/sysv/linux/s390/sysconf.c
index 69969f78e4..45bd8bf4a1 100644
--- a/sysdeps/unix/sysv/linux/s390/sysconf.c
+++ b/sysdeps/unix/sysv/linux/s390/sysconf.c
@@ -18,6 +18,7 @@
#include <unistd.h>
#include <dl-procinfo.h>
+#include <cpu-features.h>
static long int linux_sysconf (int name);
@@ -44,12 +45,14 @@ get_cache_info (int level, int attr, int type)
|| type < CACHE_TYPE_DATA || type > CACHE_TYPE_INSTRUCTION)
return 0L;
+ const struct cpu_features *features = &GLRO(dl_s390_cpu_features);
+
/* Check if ecag-instruction is available.
ecag - extract CPU attribute (only in zarch; arch >= z10; in as 2.24) */
- if (!(GLRO (dl_hwcap) & HWCAP_S390_STFLE)
+ if (!(features->hwcap & HWCAP_S390_STFLE)
#if !defined __s390x__
- || !(GLRO (dl_hwcap) & HWCAP_S390_ZARCH)
- || !(GLRO (dl_hwcap) & HWCAP_S390_HIGH_GPRS)
+ || !(features->hwcap & HWCAP_S390_ZARCH)
+ || !(features->hwcap & HWCAP_S390_HIGH_GPRS)
#endif /* !__s390x__ */
)
{
@@ -62,25 +65,7 @@ get_cache_info (int level, int attr, int type)
return 0L;
}
- /* Store facility list and check for z10.
- (see ifunc-resolver for details) */
- register unsigned long reg0 __asm__("0") = 0;
-#ifdef __s390x__
- unsigned long stfle_bits;
-# define STFLE_Z10_MASK (1UL << (63 - 34))
-#else
- unsigned long long stfle_bits;
-# define STFLE_Z10_MASK (1ULL << (63 - 34))
-#endif /* !__s390x__ */
- __asm__ __volatile__(".machine push" "\n\t"
- ".machinemode \"zarch_nohighgprs\"\n\t"
- ".machine \"z9-109\"" "\n\t"
- "stfle %0" "\n\t"
- ".machine pop" "\n"
- : "=QS" (stfle_bits), "+d" (reg0)
- : : "cc");
-
- if (!(stfle_bits & STFLE_Z10_MASK))
+ if (!S390_IS_Z10 (features->stfle_bits))
{
/* We are at least on a z9 machine.
Return 256byte for LINESIZE for L1 d/i-cache,