This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch master updated. glibc-2.25-365-g7c1d722


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  7c1d722554dc3422295a36da631e03503b676935 (commit)
      from  666c0c5efa6db73632a6894bf028fef9f3b60d71 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=7c1d722554dc3422295a36da631e03503b676935

commit 7c1d722554dc3422295a36da631e03503b676935
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Wed May 24 06:28:37 2017 -0700

    x86: Use __get_cpu_features to get cpu_features
    
    Remove is_intel, is_amd and max_cpuid macros.  Use __get_cpu_features
    to get cpu_features instead.
    
    	* sysdeps/x86/cacheinfo.c (is_intel): Removed.
    	(is_amd): Likewise.
    	(max_cpuid): Likewise.
    	(__cache_sysconf): Use __get_cpu_features to get cpu_features.
    	(init_cacheinfo): Likewise.

diff --git a/ChangeLog b/ChangeLog
index 865c7e9..80a6c3e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2017-05-24  H.J. Lu  <hongjiu.lu@intel.com>
+
+	* sysdeps/x86/cacheinfo.c (is_intel): Removed.
+	(is_amd): Likewise.
+	(max_cpuid): Likewise.
+	(__cache_sysconf): Use __get_cpu_features to get cpu_features.
+	(init_cacheinfo): Likewise.
+
 2017-05-23  Joseph Myers  <joseph@codesourcery.com>
 
 	[BZ #21511]
diff --git a/sysdeps/x86/cacheinfo.c b/sysdeps/x86/cacheinfo.c
index 1ccbe41..4594a2f 100644
--- a/sysdeps/x86/cacheinfo.c
+++ b/sysdeps/x86/cacheinfo.c
@@ -23,10 +23,6 @@
 #include <cpuid.h>
 #include <init-arch.h>
 
-#define is_intel GLRO(dl_x86_cpu_features).kind == arch_kind_intel
-#define is_amd GLRO(dl_x86_cpu_features).kind == arch_kind_amd
-#define max_cpuid GLRO(dl_x86_cpu_features).max_cpuid
-
 static const struct intel_02_cache_info
 {
   unsigned char idx;
@@ -436,10 +432,12 @@ long int
 attribute_hidden
 __cache_sysconf (int name)
 {
-  if (is_intel)
-    return handle_intel (name, max_cpuid);
+  const struct cpu_features *cpu_features = __get_cpu_features ();
+
+  if (cpu_features->kind == arch_kind_intel)
+    return handle_intel (name, cpu_features->max_cpuid);
 
-  if (is_amd)
+  if (cpu_features->kind == arch_kind_amd)
     return handle_amd (name);
 
   // XXX Fill in more vendors.
@@ -489,8 +487,10 @@ init_cacheinfo (void)
   long int shared = -1;
   unsigned int level;
   unsigned int threads = 0;
+  const struct cpu_features *cpu_features = __get_cpu_features ();
+  int max_cpuid = cpu_features->max_cpuid;
 
-  if (is_intel)
+  if (cpu_features->kind == arch_kind_intel)
     {
       data = handle_intel (_SC_LEVEL1_DCACHE_SIZE, max_cpuid);
 
@@ -691,8 +691,7 @@ intel_bug_no_cache_info:
 	  shared += core;
 	}
     }
-  /* This spells out "AuthenticAMD".  */
-  else if (is_amd)
+  else if (cpu_features->kind == arch_kind_amd)
     {
       data   = handle_amd (_SC_LEVEL1_DCACHE_SIZE);
       long int core = handle_amd (_SC_LEVEL2_CACHE_SIZE);

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog               |    8 ++++++++
 sysdeps/x86/cacheinfo.c |   19 +++++++++----------
 2 files changed, 17 insertions(+), 10 deletions(-)


hooks/post-receive
-- 
GNU C Library master sources


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]