|
|
e354a5 |
commit fb4c32aef64500c65c7fc95ca06d7e17d467be45
|
|
|
e354a5 |
Author: H.J. Lu <hjl.tools@gmail.com>
|
|
|
e354a5 |
Date: Mon Aug 6 06:25:28 2018 -0700
|
|
|
e354a5 |
|
|
|
e354a5 |
x86: Move STATE_SAVE_OFFSET/STATE_SAVE_MASK to sysdep.h
|
|
|
e354a5 |
|
|
|
e354a5 |
Move STATE_SAVE_OFFSET and STATE_SAVE_MASK to sysdep.h to make
|
|
|
e354a5 |
sysdeps/x86/cpu-features.h a C header file.
|
|
|
e354a5 |
|
|
|
e354a5 |
* sysdeps/x86/cpu-features.h (STATE_SAVE_OFFSET): Removed.
|
|
|
e354a5 |
(STATE_SAVE_MASK): Likewise.
|
|
|
e354a5 |
Don't check __ASSEMBLER__ to include <cpu-features-offsets.h>.
|
|
|
e354a5 |
* sysdeps/x86/sysdep.h (STATE_SAVE_OFFSET): New.
|
|
|
e354a5 |
(STATE_SAVE_MASK): Likewise.
|
|
|
e354a5 |
* sysdeps/x86_64/dl-trampoline.S: Include <cpu-features-offsets.h>
|
|
|
e354a5 |
instead of <cpu-features.h>.
|
|
|
e354a5 |
|
|
|
e354a5 |
diff --git a/sysdeps/x86/cpu-features.h b/sysdeps/x86/cpu-features.h
|
|
|
e354a5 |
index 4c6d08c709eea204..d342664c64ab7aa1 100644
|
|
|
e354a5 |
--- a/sysdeps/x86/cpu-features.h
|
|
|
e354a5 |
+++ b/sysdeps/x86/cpu-features.h
|
|
|
e354a5 |
@@ -92,18 +92,6 @@
|
|
|
e354a5 |
/* The current maximum size of the feature integer bit array. */
|
|
|
e354a5 |
#define FEATURE_INDEX_MAX 1
|
|
|
e354a5 |
|
|
|
e354a5 |
-/* Offset for fxsave/xsave area used by _dl_runtime_resolve. Also need
|
|
|
e354a5 |
- space to preserve RCX, RDX, RSI, RDI, R8, R9 and RAX. It must be
|
|
|
e354a5 |
- aligned to 16 bytes for fxsave and 64 bytes for xsave. */
|
|
|
e354a5 |
-#define STATE_SAVE_OFFSET (8 * 7 + 8)
|
|
|
e354a5 |
-
|
|
|
e354a5 |
-/* Save SSE, AVX, AVX512, mask and bound registers. */
|
|
|
e354a5 |
-#define STATE_SAVE_MASK \
|
|
|
e354a5 |
- ((1 << 1) | (1 << 2) | (1 << 3) | (1 << 5) | (1 << 6) | (1 << 7))
|
|
|
e354a5 |
-
|
|
|
e354a5 |
-#ifdef __ASSEMBLER__
|
|
|
e354a5 |
-# include <cpu-features-offsets.h>
|
|
|
e354a5 |
-#else /* __ASSEMBLER__ */
|
|
|
e354a5 |
enum
|
|
|
e354a5 |
{
|
|
|
e354a5 |
COMMON_CPUID_INDEX_1 = 0,
|
|
|
e354a5 |
@@ -267,8 +255,6 @@ extern const struct cpu_features *__get_cpu_features (void)
|
|
|
e354a5 |
# define index_arch_XSAVEC_Usable FEATURE_INDEX_1
|
|
|
e354a5 |
# define index_arch_Prefer_FSRM FEATURE_INDEX_1
|
|
|
e354a5 |
|
|
|
e354a5 |
-#endif /* !__ASSEMBLER__ */
|
|
|
e354a5 |
-
|
|
|
e354a5 |
#ifdef __x86_64__
|
|
|
e354a5 |
# define HAS_CPUID 1
|
|
|
e354a5 |
#elif defined __i586__ || defined __pentium__
|
|
|
e354a5 |
diff --git a/sysdeps/x86/sysdep.h b/sysdeps/x86/sysdep.h
|
|
|
e354a5 |
index 8776ad8374e056d3..f41f4ebd425cfbaf 100644
|
|
|
e354a5 |
--- a/sysdeps/x86/sysdep.h
|
|
|
e354a5 |
+++ b/sysdeps/x86/sysdep.h
|
|
|
e354a5 |
@@ -48,6 +48,15 @@ enum cf_protection_level
|
|
|
e354a5 |
# define SHSTK_ENABLED 0
|
|
|
e354a5 |
#endif
|
|
|
e354a5 |
|
|
|
e354a5 |
+/* Offset for fxsave/xsave area used by _dl_runtime_resolve. Also need
|
|
|
e354a5 |
+ space to preserve RCX, RDX, RSI, RDI, R8, R9 and RAX. It must be
|
|
|
e354a5 |
+ aligned to 16 bytes for fxsave and 64 bytes for xsave. */
|
|
|
e354a5 |
+#define STATE_SAVE_OFFSET (8 * 7 + 8)
|
|
|
e354a5 |
+
|
|
|
e354a5 |
+/* Save SSE, AVX, AVX512, mask and bound registers. */
|
|
|
e354a5 |
+#define STATE_SAVE_MASK \
|
|
|
e354a5 |
+ ((1 << 1) | (1 << 2) | (1 << 3) | (1 << 5) | (1 << 6) | (1 << 7))
|
|
|
e354a5 |
+
|
|
|
e354a5 |
#ifdef __ASSEMBLER__
|
|
|
e354a5 |
|
|
|
e354a5 |
/* Syntactic details of assembler. */
|
|
|
e354a5 |
diff --git a/sysdeps/x86_64/dl-trampoline.S b/sysdeps/x86_64/dl-trampoline.S
|
|
|
e354a5 |
index ef1425cbb909529a..fd918510fe155733 100644
|
|
|
e354a5 |
--- a/sysdeps/x86_64/dl-trampoline.S
|
|
|
e354a5 |
+++ b/sysdeps/x86_64/dl-trampoline.S
|
|
|
e354a5 |
@@ -18,7 +18,7 @@
|
|
|
e354a5 |
|
|
|
e354a5 |
#include <config.h>
|
|
|
e354a5 |
#include <sysdep.h>
|
|
|
e354a5 |
-#include <cpu-features.h>
|
|
|
e354a5 |
+#include <cpu-features-offsets.h>
|
|
|
e354a5 |
#include <link-defines.h>
|
|
|
e354a5 |
|
|
|
e354a5 |
#ifndef DL_STACK_ALIGNMENT
|