|
|
ce426f |
From 3ca2c50727b3e3e22eb3606135a18c6212f516d2 Mon Sep 17 00:00:00 2001
|
|
|
ce426f |
From: "Ryan S. Arnold" <rsa@linux.vnet.ibm.com>
|
|
|
ce426f |
Date: Fri, 28 Jun 2013 16:52:49 -0500
|
|
|
ce426f |
Subject: [PATCH 40/42] PowerPC: Define AT_HWCAP2 bits and AT_HWCAP2 handling
|
|
|
ce426f |
for POWER8. (cherry picked from commit
|
|
|
ce426f |
89cd956937f46e8f4a0374994965f991642dd408)
|
|
|
ce426f |
|
|
|
ce426f |
---
|
|
|
ce426f |
sysdeps/powerpc/Makefile | 2 +-
|
|
|
ce426f |
sysdeps/powerpc/bits/hwcap.h | 25 +++++++++++-----
|
|
|
ce426f |
sysdeps/powerpc/dl-procinfo.c | 10 ++++++-
|
|
|
ce426f |
sysdeps/powerpc/dl-procinfo.h | 53 ++++++++++++++++++++++++---------
|
|
|
ce426f |
sysdeps/powerpc/rtld-global-offsets.sym | 1 +
|
|
|
ce426f |
6 files changed, 86 insertions(+), 23 deletions(-)
|
|
|
ce426f |
|
|
|
ce426f |
diff --git glibc-2.17-c758a686/sysdeps/powerpc/Makefile glibc-2.17-c758a686/sysdeps/powerpc/Makefile
|
|
|
ce426f |
index 7442b67..f75e625 100644
|
|
|
ce426f |
--- glibc-2.17-c758a686/sysdeps/powerpc/Makefile
|
|
|
ce426f |
+++ glibc-2.17-c758a686/sysdeps/powerpc/Makefile
|
|
|
ce426f |
@@ -17,7 +17,7 @@ endif
|
|
|
ce426f |
endif
|
|
|
ce426f |
|
|
|
ce426f |
ifeq ($(subdir),csu)
|
|
|
ce426f |
-# get offset to rtld_global._dl_hwcap
|
|
|
ce426f |
+# get offset to rtld_global._dl_hwcap and rtld_global._dl_hwcap2
|
|
|
ce426f |
gen-as-const-headers += rtld-global-offsets.sym
|
|
|
ce426f |
# get offset to __locale_struct.__ctype_tolower
|
|
|
ce426f |
gen-as-const-headers += locale-defines.sym
|
|
|
ce426f |
diff --git glibc-2.17-c758a686/sysdeps/powerpc/bits/hwcap.h glibc-2.17-c758a686/sysdeps/powerpc/bits/hwcap.h
|
|
|
ce426f |
index 89e7d8b..0c02fc6 100644
|
|
|
ce426f |
--- glibc-2.17-c758a686/sysdeps/powerpc/bits/hwcap.h
|
|
|
ce426f |
+++ glibc-2.17-c758a686/sysdeps/powerpc/bits/hwcap.h
|
|
|
ce426f |
@@ -1,5 +1,5 @@
|
|
|
ce426f |
-/* Defines for bits in AT_HWCAP.
|
|
|
ce426f |
- Copyright (C) 2012 Free Software Foundation, Inc.
|
|
|
ce426f |
+/* Defines for bits in AT_HWCAP and AT_HWCAP2.
|
|
|
ce426f |
+ Copyright (C) 2012-2013 Free Software Foundation, Inc.
|
|
|
ce426f |
This file is part of the GNU C Library.
|
|
|
ce426f |
|
|
|
ce426f |
The GNU C Library is free software; you can redistribute it and/or
|
|
|
ce426f |
@@ -20,9 +20,9 @@
|
|
|
ce426f |
# error "Never include <bits/hwcap.h> directly; use <sys/auxv.h> instead."
|
|
|
ce426f |
#endif
|
|
|
ce426f |
|
|
|
ce426f |
-/*
|
|
|
ce426f |
- * The following must match the kernels asm/cputable.h.
|
|
|
ce426f |
- */
|
|
|
ce426f |
+/* The bit numbers must match those in the kernel's asm/cputable.h. */
|
|
|
ce426f |
+
|
|
|
ce426f |
+/* Feature definitions in AT_HWCAP. */
|
|
|
ce426f |
#define PPC_FEATURE_32 0x80000000 /* 32-bit mode. */
|
|
|
ce426f |
#define PPC_FEATURE_64 0x40000000 /* 64-bit mode. */
|
|
|
ce426f |
#define PPC_FEATURE_601_INSTR 0x20000000 /* 601 chip, Old POWER ISA. */
|
|
|
ce426f |
@@ -39,8 +39,9 @@
|
|
|
ce426f |
#define PPC_FEATURE_POWER5 0x00040000 /* POWER5 ISA 2.02 */
|
|
|
ce426f |
#define PPC_FEATURE_POWER5_PLUS 0x00020000 /* POWER5+ ISA 2.03 */
|
|
|
ce426f |
#define PPC_FEATURE_CELL_BE 0x00010000 /* CELL Broadband Engine */
|
|
|
ce426f |
-#define PPC_FEATURE_BOOKE 0x00008000
|
|
|
ce426f |
-#define PPC_FEATURE_SMT 0x00004000 /* Simultaneous Multi-Threading */
|
|
|
ce426f |
+#define PPC_FEATURE_BOOKE 0x00008000 /* ISA Category Embedded */
|
|
|
ce426f |
+#define PPC_FEATURE_SMT 0x00004000 /* Simultaneous
|
|
|
ce426f |
+ Multi-Threading */
|
|
|
ce426f |
#define PPC_FEATURE_ICACHE_SNOOP 0x00002000
|
|
|
ce426f |
#define PPC_FEATURE_ARCH_2_05 0x00001000 /* ISA 2.05 */
|
|
|
ce426f |
#define PPC_FEATURE_PA6T 0x00000800 /* PA Semi 6T Core */
|
|
|
ce426f |
@@ -51,3 +52,13 @@
|
|
|
ce426f |
#define PPC_FEATURE_PSERIES_PERFMON_COMPAT 0x00000040
|
|
|
ce426f |
#define PPC_FEATURE_TRUE_LE 0x00000002
|
|
|
ce426f |
#define PPC_FEATURE_PPC_LE 0x00000001
|
|
|
ce426f |
+
|
|
|
ce426f |
+/* Feature definitions in AT_HWCAP2. */
|
|
|
ce426f |
+#define PPC_FEATURE2_ARCH_2_07 0x80000000 /* ISA 2.07 */
|
|
|
ce426f |
+#define PPC_FEATURE2_HAS_HTM 0x40000000 /* Hardware Transactional
|
|
|
ce426f |
+ Memory */
|
|
|
ce426f |
+#define PPC_FEATURE2_HAS_DSCR 0x20000000 /* Data Stream Control
|
|
|
ce426f |
+ Register */
|
|
|
ce426f |
+#define PPC_FEATURE2_HAS_EBB 0x10000000 /* Event Base Branching */
|
|
|
ce426f |
+#define PPC_FEATURE2_HAS_ISEL 0x08000000 /* Integer Select */
|
|
|
ce426f |
+#define PPC_FEATURE2_HAS_TAR 0x04000000 /* Target Address Register */
|
|
|
ce426f |
diff --git glibc-2.17-c758a686/sysdeps/powerpc/dl-procinfo.c glibc-2.17-c758a686/sysdeps/powerpc/dl-procinfo.c
|
|
|
ce426f |
index efab165..6cebf99 100644
|
|
|
ce426f |
--- glibc-2.17-c758a686/sysdeps/powerpc/dl-procinfo.c
|
|
|
ce426f |
+++ glibc-2.17-c758a686/sysdeps/powerpc/dl-procinfo.c
|
|
|
ce426f |
@@ -45,7 +45,7 @@
|
|
|
ce426f |
#if !defined PROCINFO_DECL && defined SHARED
|
|
|
ce426f |
._dl_powerpc_cap_flags
|
|
|
ce426f |
#else
|
|
|
ce426f |
-PROCINFO_CLASS const char _dl_powerpc_cap_flags[25][10]
|
|
|
ce426f |
+PROCINFO_CLASS const char _dl_powerpc_cap_flags[57][10]
|
|
|
ce426f |
#endif
|
|
|
ce426f |
#ifndef PROCINFO_DECL
|
|
|
ce426f |
= {
|
|
|
ce426f |
@@ -56,6 +56,14 @@ PROCINFO_CLASS const char _dl_powerpc_cap_flags[25][10]
|
|
|
ce426f |
"notb", "efpdouble", "efpsingle", "spe",
|
|
|
ce426f |
"ucache", "4xxmac", "mmu", "fpu",
|
|
|
ce426f |
"altivec", "ppc601", "ppc64", "ppc32",
|
|
|
ce426f |
+ "", "", "", "",
|
|
|
ce426f |
+ "", "", "", "",
|
|
|
ce426f |
+ "", "", "", "",
|
|
|
ce426f |
+ "", "", "", "",
|
|
|
ce426f |
+ "", "", "", "",
|
|
|
ce426f |
+ "", "", "", "",
|
|
|
ce426f |
+ "", "", "tar", "isel",
|
|
|
ce426f |
+ "ebb", "dscr", "htm", "arch_2_07",
|
|
|
ce426f |
}
|
|
|
ce426f |
#endif
|
|
|
ce426f |
#if !defined SHARED || defined PROCINFO_DECL
|
|
|
ce426f |
diff --git glibc-2.17-c758a686/sysdeps/powerpc/dl-procinfo.h glibc-2.17-c758a686/sysdeps/powerpc/dl-procinfo.h
|
|
|
ce426f |
index 7732ed2..dc3b70e 100644
|
|
|
ce426f |
--- glibc-2.17-c758a686/sysdeps/powerpc/dl-procinfo.h
|
|
|
ce426f |
+++ glibc-2.17-c758a686/sysdeps/powerpc/dl-procinfo.h
|
|
|
ce426f |
@@ -20,11 +20,21 @@
|
|
|
ce426f |
#define _DL_PROCINFO_H 1
|
|
|
ce426f |
|
|
|
ce426f |
#include <ldsodefs.h>
|
|
|
ce426f |
-#include <sysdep.h> /* This defines the PPC_FEATURE_* macros. */
|
|
|
ce426f |
+#include <sysdep.h> /* This defines the PPC_FEATURE[2]_* macros. */
|
|
|
ce426f |
|
|
|
ce426f |
/* There are 25 bits used, but they are bits 7..31. */
|
|
|
ce426f |
#define _DL_HWCAP_FIRST 7
|
|
|
ce426f |
-#define _DL_HWCAP_COUNT 32
|
|
|
ce426f |
+
|
|
|
ce426f |
+/* The total number of available bits (including those prior to
|
|
|
ce426f |
+ _DL_HWCAP_FIRST). Some of these bits might not be used. */
|
|
|
ce426f |
+#define _DL_HWCAP_COUNT 64
|
|
|
ce426f |
+
|
|
|
ce426f |
+/* Features started at bit 31 and decremented as new features were added. */
|
|
|
ce426f |
+#define _DL_HWCAP_LAST 31
|
|
|
ce426f |
+
|
|
|
ce426f |
+/* AT_HWCAP2 features started at bit 31 and decremented as new features were
|
|
|
ce426f |
+ added. HWCAP2 feature bits start at bit 0. */
|
|
|
ce426f |
+#define _DL_HWCAP2_LAST 31
|
|
|
ce426f |
|
|
|
ce426f |
/* These bits influence library search. */
|
|
|
ce426f |
#define HWCAP_IMPORTANT (PPC_FEATURE_HAS_ALTIVEC \
|
|
|
ce426f |
@@ -161,18 +171,33 @@ static inline int
|
|
|
ce426f |
__attribute__ ((unused))
|
|
|
ce426f |
_dl_procinfo (unsigned int type, unsigned long int word)
|
|
|
ce426f |
{
|
|
|
ce426f |
- /* Fallback to unknown output mechanism. */
|
|
|
ce426f |
- if (type == AT_HWCAP2)
|
|
|
ce426f |
- return -1;
|
|
|
ce426f |
-
|
|
|
ce426f |
- _dl_printf ("AT_HWCAP: ");
|
|
|
ce426f |
-
|
|
|
ce426f |
- for (int i = _DL_HWCAP_FIRST; i < _DL_HWCAP_COUNT; ++i)
|
|
|
ce426f |
- if (word & (1 << i))
|
|
|
ce426f |
- _dl_printf (" %s", _dl_hwcap_string (i));
|
|
|
ce426f |
-
|
|
|
ce426f |
- _dl_printf ("\n");
|
|
|
ce426f |
-
|
|
|
ce426f |
+ switch(type)
|
|
|
ce426f |
+ {
|
|
|
ce426f |
+ case AT_HWCAP:
|
|
|
ce426f |
+ _dl_printf ("AT_HWCAP: ");
|
|
|
ce426f |
+
|
|
|
ce426f |
+ for (int i = _DL_HWCAP_FIRST; i <= _DL_HWCAP_LAST; ++i)
|
|
|
ce426f |
+ if (word & (1 << i))
|
|
|
ce426f |
+ _dl_printf (" %s", _dl_hwcap_string (i));
|
|
|
ce426f |
+ break;
|
|
|
ce426f |
+ case AT_HWCAP2:
|
|
|
ce426f |
+ {
|
|
|
ce426f |
+ unsigned int offset = _DL_HWCAP_LAST + 1;
|
|
|
ce426f |
+
|
|
|
ce426f |
+ _dl_printf ("AT_HWCAP2: ");
|
|
|
ce426f |
+
|
|
|
ce426f |
+ /* We have to go through them all because the kernel added the
|
|
|
ce426f |
+ AT_HWCAP2 features starting with the high bits. */
|
|
|
ce426f |
+ for (int i = 0; i <= _DL_HWCAP2_LAST; ++i)
|
|
|
ce426f |
+ if (word & (1 << i))
|
|
|
ce426f |
+ _dl_printf (" %s", _dl_hwcap_string (offset + i));
|
|
|
ce426f |
+ break;
|
|
|
ce426f |
+ }
|
|
|
ce426f |
+ default:
|
|
|
ce426f |
+ /* This should not happen. */
|
|
|
ce426f |
+ return -1;
|
|
|
ce426f |
+ }
|
|
|
ce426f |
+ _dl_printf ("\n");
|
|
|
ce426f |
return 0;
|
|
|
ce426f |
}
|
|
|
ce426f |
#endif
|
|
|
ce426f |
diff --git glibc-2.17-c758a686/sysdeps/powerpc/rtld-global-offsets.sym glibc-2.17-c758a686/sysdeps/powerpc/rtld-global-offsets.sym
|
|
|
ce426f |
index ff4e97f..f5ea5a1 100644
|
|
|
ce426f |
--- glibc-2.17-c758a686/sysdeps/powerpc/rtld-global-offsets.sym
|
|
|
ce426f |
+++ glibc-2.17-c758a686/sysdeps/powerpc/rtld-global-offsets.sym
|
|
|
ce426f |
@@ -5,3 +5,4 @@
|
|
|
ce426f |
#define rtld_global_ro_offsetof(mem) offsetof (struct rtld_global_ro, mem)
|
|
|
ce426f |
|
|
|
ce426f |
RTLD_GLOBAL_RO_DL_HWCAP_OFFSET rtld_global_ro_offsetof (_dl_hwcap)
|
|
|
ce426f |
+RTLD_GLOBAL_RO_DL_HWCAP2_OFFSET rtld_global_ro_offsetof (_dl_hwcap2)
|
|
|
ce426f |
--
|
|
|
ce426f |
1.7.11.7
|
|
|
ce426f |
|