[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[commits] r8622 - in /fsf/trunk/libc: ./ sysdeps/x86_64/elf/ sysdeps/x86_64/multiarch/



Author: eglibc
Date: Tue Jun 30 13:14:13 2009
New Revision: 8622

Log:
Import glibc-mainline for 2009-06-30

Modified:
    fsf/trunk/libc/ChangeLog
    fsf/trunk/libc/sysdeps/x86_64/elf/configure
    fsf/trunk/libc/sysdeps/x86_64/multiarch/ifunc-defines.sym
    fsf/trunk/libc/sysdeps/x86_64/multiarch/init-arch.c
    fsf/trunk/libc/sysdeps/x86_64/multiarch/init-arch.h

Modified: fsf/trunk/libc/ChangeLog
==============================================================================
--- fsf/trunk/libc/ChangeLog (original)
+++ fsf/trunk/libc/ChangeLog Tue Jun 30 13:14:13 2009
@@ -1,3 +1,13 @@
+2009-06-26  H.J. Lu  <hongjiu.lu@xxxxxxxxx>
+
+	* sysdeps/x86_64/multiarch/ifunc-defines.sym (FAMILIY_OFFSET): Define.
+	(MODEL_OFFSET): Define.
+	* sysdeps/x86_64/multiarch/init-arch.h (cpu_features): Add
+	family and model.
+	* sysdeps/x86_64/multiarch/init-arch.c (__init_cpu_features): Break
+	out common code into new function get_common_indeces. Determine
+	extended family and model for Intel processors.
+
 2009-06-26  Ulrich Drepper  <drepper@xxxxxxxxxx>
 
 	* resolv/resolv.h: Define RES_SNGLKUPREOP.

Modified: fsf/trunk/libc/sysdeps/x86_64/elf/configure
==============================================================================
--- fsf/trunk/libc/sysdeps/x86_64/elf/configure (original)
+++ fsf/trunk/libc/sysdeps/x86_64/elf/configure Tue Jun 30 13:14:13 2009
@@ -1,12 +1,44 @@
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='printf %s\n'
+  as_echo_n='printf %s'
+else
+  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+    as_echo_n='/usr/ucb/echo -n'
+  else
+    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+    as_echo_n_body='eval
+      arg=$1;
+      case $arg in
+      *"$as_nl"*)
+	expr "X$arg" : "X\\(.*\\)$as_nl";
+	arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+      esac;
+      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+    '
+    export as_echo_n_body
+    as_echo_n='sh -c $as_echo_n_body as_echo'
+  fi
+  export as_echo_body
+  as_echo='sh -c $as_echo_body as_echo'
+fi
+
 # This file is generated from configure.in by Autoconf.  DO NOT EDIT!
  # Local configure fragment for sysdeps/x86_64/elf.
 
 if test "$usetls" != no; then
 # Check for support of thread-local storage handling in assembler and linker.
-{ echo "$as_me:$LINENO: checking for x86-64 TLS support" >&5
-echo $ECHO_N "checking for x86-64 TLS support... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for x86-64 TLS support" >&5
+$as_echo_n "checking for x86-64 TLS support... " >&6; }
 if test "${libc_cv_x86_64_tls+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat > conftest.s <<\EOF
 	.section ".tdata", "awT", @progbits
@@ -25,7 +57,7 @@
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   libc_cv_x86_64_tls=yes
 else
@@ -33,8 +65,8 @@
 fi
 rm -f conftest*
 fi
-{ echo "$as_me:$LINENO: result: $libc_cv_x86_64_tls" >&5
-echo "${ECHO_T}$libc_cv_x86_64_tls" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $libc_cv_x86_64_tls" >&5
+$as_echo "$libc_cv_x86_64_tls" >&6; }
 if test $libc_cv_x86_64_tls = yes; then
   cat >>confdefs.h <<\_ACEOF
 #define HAVE_TLS_SUPPORT 1

Modified: fsf/trunk/libc/sysdeps/x86_64/multiarch/ifunc-defines.sym
==============================================================================
--- fsf/trunk/libc/sysdeps/x86_64/multiarch/ifunc-defines.sym (original)
+++ fsf/trunk/libc/sysdeps/x86_64/multiarch/ifunc-defines.sym Tue Jun 30 13:14:13 2009
@@ -11,5 +11,7 @@
 CPUID_EBX_OFFSET	offsetof (struct cpuid_registers, ebx)
 CPUID_ECX_OFFSET	offsetof (struct cpuid_registers, ecx)
 CPUID_EDX_OFFSET	offsetof (struct cpuid_registers, edx)
+FAMILY_OFFSET		offsetof (struct cpu_features, family)
+MODEL_OFFSET		offsetof (struct cpu_features, model)
 
 COMMON_CPUID_INDEX_1

Modified: fsf/trunk/libc/sysdeps/x86_64/multiarch/init-arch.c
==============================================================================
--- fsf/trunk/libc/sysdeps/x86_64/multiarch/init-arch.c (original)
+++ fsf/trunk/libc/sysdeps/x86_64/multiarch/init-arch.c Tue Jun 30 13:14:13 2009
@@ -24,6 +24,22 @@
 struct cpu_features __cpu_features attribute_hidden;
 
 
+static void
+get_common_indeces (void)
+{
+  asm volatile ("cpuid"
+		: "=a" (__cpu_features.cpuid[COMMON_CPUID_INDEX_1].eax),
+		  "=b" (__cpu_features.cpuid[COMMON_CPUID_INDEX_1].ebx),
+		  "=c" (__cpu_features.cpuid[COMMON_CPUID_INDEX_1].ecx),
+		  "=d" (__cpu_features.cpuid[COMMON_CPUID_INDEX_1].edx)
+		: "0" (1));
+
+  unsigned int eax = __cpu_features.cpuid[COMMON_CPUID_INDEX_1].eax;
+  __cpu_features.family = (eax >> 8) & 0x0f;
+  __cpu_features.model = (eax >> 4) & 0x0f;
+}
+
+
 void
 __init_cpu_features (void)
 {
@@ -41,20 +57,25 @@
     {
       __cpu_features.kind = arch_kind_intel;
 
-    get_common_cpuid:
-      asm volatile ("cpuid"
-		    : "=a" (__cpu_features.cpuid[COMMON_CPUID_INDEX_1].eax),
-		      "=b" (__cpu_features.cpuid[COMMON_CPUID_INDEX_1].ebx),
-		      "=c" (__cpu_features.cpuid[COMMON_CPUID_INDEX_1].ecx),
-		      "=d" (__cpu_features.cpuid[COMMON_CPUID_INDEX_1].edx)
-		    : "0" (1));
+      get_common_indeces ();
+
+      unsigned int eax = __cpu_features.cpuid[COMMON_CPUID_INDEX_1].eax;
+      unsigned int extended_family = (eax >> 20) & 0xff;
+      unsigned int extended_model = (eax >> 12) & 0xf0;
+      if (__cpu_features.family == 0x0f)
+	{
+	  __cpu_features.family += extended_family;
+	  __cpu_features.model += extended_model;
+	}
+      else if (__cpu_features.family == 0x06)
+	__cpu_features.model += extended_model;
     }
   /* This spells out "AuthenticAMD".  */
   else if (ebx == 0x68747541 && ecx == 0x444d4163 && edx == 0x69746e65)
     {
       __cpu_features.kind = arch_kind_amd;
 
-      goto get_common_cpuid;
+      get_common_indeces ();
     }
   else
     __cpu_features.kind = arch_kind_other;

Modified: fsf/trunk/libc/sysdeps/x86_64/multiarch/init-arch.h
==============================================================================
--- fsf/trunk/libc/sysdeps/x86_64/multiarch/init-arch.h (original)
+++ fsf/trunk/libc/sysdeps/x86_64/multiarch/init-arch.h Tue Jun 30 13:14:13 2009
@@ -42,6 +42,8 @@
     unsigned int ecx;
     unsigned int edx;
   } cpuid[COMMON_CPUID_INDEX_MAX];
+  unsigned int family;
+  unsigned int model;
 } __cpu_features attribute_hidden;