ce426f
From 571d49008b0c44b4aabb66b2ac3ce690fd802466 Mon Sep 17 00:00:00 2001
ce426f
From: Stefan Liebler <stli@linux.vnet.ibm.com>
ce426f
Date: Thu, 8 Oct 2015 10:45:29 +0200
ce426f
Subject: [PATCH 06/30] S390: Add hwcaps value for vector facility.
ce426f
ce426f
upstream-commit-id: 4e28fa80886c71e6aaf85016b82ce981c0f12e6d
ce426f
https://www.sourceware.org/ml/libc-alpha/2015-07/msg00075.html
ce426f
ce426f
The HWCAP_S390_VX flag in hwcap field of auxiliary vector indicates
ce426f
if the vector facility is available and the kernel is aware of it.
ce426f
This can be tested with LD_SHOW_AUXV=1 <prog>.
ce426f
Currently it does not show te, because it was not incremented
ce426f
by commit "S/390: Add hwcap value for transactional execution.".
ce426f
Thus _DL_HWCAP_COUNT is incremented by two.
ce426f
ce426f
ChangeLog:
ce426f
ce426f
	* sysdeps/s390/dl-procinfo.c (_dl_s390_platforms): Add vector flag.
ce426f
	* sysdeps/s390/dl-procinfo.h: Add vector capability.
ce426f
	* sysdeps/unix/sysv/linux/s390/bits/hwcap.h (HWCAP_S390_VX): Define.
ce426f
---
ce426f
 sysdeps/s390/dl-procinfo.c                | 4 ++--
ce426f
 sysdeps/s390/dl-procinfo.h                | 3 ++-
ce426f
 sysdeps/unix/sysv/linux/s390/bits/hwcap.h | 1 +
ce426f
 3 files changed, 5 insertions(+), 3 deletions(-)
ce426f
ce426f
diff --git a/sysdeps/s390/dl-procinfo.c b/sysdeps/s390/dl-procinfo.c
ce426f
index 9590146..96d438a 100644
ce426f
--- a/sysdeps/s390/dl-procinfo.c
ce426f
+++ b/sysdeps/s390/dl-procinfo.c
ce426f
@@ -46,11 +46,11 @@
ce426f
 #if !defined PROCINFO_DECL && defined SHARED
ce426f
   ._dl_s390_cap_flags
ce426f
 #else
ce426f
-PROCINFO_CLASS const char _dl_s390_cap_flags[11][9]
ce426f
+PROCINFO_CLASS const char _dl_s390_cap_flags[12][9]
ce426f
 #endif
ce426f
 #ifndef PROCINFO_DECL
ce426f
 = {
ce426f
-     "esan3", "zarch", "stfle", "msa", "ldisp", "eimm", "dfp", "edat", "etf3eh", "highgprs", "te"
ce426f
+     "esan3", "zarch", "stfle", "msa", "ldisp", "eimm", "dfp", "edat", "etf3eh", "highgprs", "te", "vx"
ce426f
   }
ce426f
 #endif
ce426f
 #if !defined SHARED || defined PROCINFO_DECL
ce426f
diff --git a/sysdeps/s390/dl-procinfo.h b/sysdeps/s390/dl-procinfo.h
ce426f
index 26de043..89766e0 100644
ce426f
--- a/sysdeps/s390/dl-procinfo.h
ce426f
+++ b/sysdeps/s390/dl-procinfo.h
ce426f
@@ -21,7 +21,7 @@
ce426f
 #define _DL_PROCINFO_H	1
ce426f
 #include <ldsodefs.h>
ce426f
 
ce426f
-#define _DL_HWCAP_COUNT 10
ce426f
+#define _DL_HWCAP_COUNT 12
ce426f
 
ce426f
 #define _DL_PLATFORMS_COUNT	5
ce426f
 
ce426f
@@ -50,6 +50,7 @@ enum
ce426f
   HWCAP_S390_ETF3EH = 1 << 8,
ce426f
   HWCAP_S390_HIGH_GPRS = 1 << 9,
ce426f
   HWCAP_S390_TE = 1 << 10,
ce426f
+  HWCAP_S390_VX = 1 << 11,
ce426f
 };
ce426f
 
ce426f
 #define HWCAP_IMPORTANT (HWCAP_S390_ZARCH | HWCAP_S390_LDISP \
ce426f
diff --git a/sysdeps/unix/sysv/linux/s390/bits/hwcap.h b/sysdeps/unix/sysv/linux/s390/bits/hwcap.h
ce426f
index 59d68b0..bd2ce3a 100644
ce426f
--- a/sysdeps/unix/sysv/linux/s390/bits/hwcap.h
ce426f
+++ b/sysdeps/unix/sysv/linux/s390/bits/hwcap.h
ce426f
@@ -35,3 +35,4 @@
ce426f
 #define HWCAP_S390_ETF3EH       256
ce426f
 #define HWCAP_S390_HIGH_GPRS    512
ce426f
 #define HWCAP_S390_TE           1024
ce426f
+#define HWCAP_S390_VX           2048
ce426f
-- 
ce426f
2.3.0
ce426f