summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Schwab <aschwab@redhat.com>2009-07-02 12:02:12 +0200
committerAndreas Schwab <aschwab@redhat.com>2009-07-02 12:02:12 +0200
commit8c9533e18f842a79512d38b11662a1ed2355c6a8 (patch)
treeb34e8c0b58e27bba8a276ff76e5c846d53c20bf9
parentffd515a6e7a265a63dd40037db66e80c1f243099 (diff)
parent2fd0cd8b5257e7ae0c0df0651ee62a6ef7c37cc2 (diff)
Merge commit 'origin/master' into fedora/master
Conflicts: ChangeLog
-rw-r--r--ChangeLog23
-rw-r--r--nis/nss_nis/nis-network.c2
-rw-r--r--nis/nss_nisplus/nisplus-network.c2
-rw-r--r--nss/getent.c2
-rw-r--r--nss/nss_files/files-network.c5
-rwxr-xr-xsysdeps/x86_64/elf/configure44
-rw-r--r--sysdeps/x86_64/multiarch/ifunc-defines.sym2
-rw-r--r--sysdeps/x86_64/multiarch/init-arch.c37
-rw-r--r--sysdeps/x86_64/multiarch/init-arch.h2
9 files changed, 100 insertions, 19 deletions
diff --git a/ChangeLog b/ChangeLog
index 14fbf51104..69edfd237e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,26 @@
+2009-07-01 Ulrich Drepper <drepper@redhat.com>
+
+ * nis/nss_nis/nis-network.c (_nss_nis_getnetbyaddr_r): Don't use
+ inet_makeaddr. This worked only with class-based networks.
+ * nis/nss_nisplus/nisplus-network.c (_nss_nisplus_getnetbyaddr_r):
+ Likewise.
+
+ * nss/nss_files/files-network.c (netbyaddr): If type is AF_UNSPEC,
+ recognize all types.
+ * nss/getent.c (networks_keys): Pass AF_UNSPEC instead of AF_UNIX
+ to getnetbyaddr. Fix network parameter to getnetbyaddr. It must
+ be in host byte order.
+
+2009-06-26 H.J. Lu <hongjiu.lu@intel.com>
+
+ * 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 Andreas Schwab <aschwab@redhat.com>
* timezone/zic.c (stringzone): Don't try to generate a POSIX TZ
diff --git a/nis/nss_nis/nis-network.c b/nis/nss_nis/nis-network.c
index 9b02302e0b..22a898bb21 100644
--- a/nis/nss_nis/nis-network.c
+++ b/nis/nss_nis/nis-network.c
@@ -241,7 +241,7 @@ _nss_nis_getnetbyaddr_r (uint32_t addr, int type, struct netent *net,
if (__builtin_expect (yp_get_default_domain (&domain), 0))
return NSS_STATUS_UNAVAIL;
- struct in_addr in = inet_makeaddr (addr, 0);
+ struct in_addr in = { .s_addr = htonl (addr) };
char *buf = inet_ntoa (in);
size_t blen = strlen (buf);
diff --git a/nis/nss_nisplus/nisplus-network.c b/nis/nss_nisplus/nisplus-network.c
index 1cf652f071..902826b62a 100644
--- a/nis/nss_nisplus/nisplus-network.c
+++ b/nis/nss_nisplus/nisplus-network.c
@@ -433,7 +433,7 @@ _nss_nisplus_getnetbyaddr_r (uint32_t addr, const int type,
char buf2[18];
int olderr = errno;
- struct in_addr in = inet_makeaddr (addr, 0);
+ struct in_addr in = { .s_addr = htonl (addr) };
strcpy (buf2, inet_ntoa (in));
size_t b2len = strlen (buf2);
diff --git a/nss/getent.c b/nss/getent.c
index 3a9430fd66..d70a8da0f4 100644
--- a/nss/getent.c
+++ b/nss/getent.c
@@ -534,7 +534,7 @@ networks_keys (int number, char *key[])
for (i = 0; i < number; ++i)
{
if (isdigit (key[i][0]))
- net = getnetbyaddr (inet_addr (key[i]), AF_UNIX);
+ net = getnetbyaddr (ntohl (inet_addr (key[i])), AF_UNSPEC);
else
net = getnetbyname (key[i]);
diff --git a/nss/nss_files/files-network.c b/nss/nss_files/files-network.c
index 9f4a3e0324..92aea75d9e 100644
--- a/nss/nss_files/files-network.c
+++ b/nss/nss_files/files-network.c
@@ -1,5 +1,5 @@
/* Networks file parser in nss_files module.
- Copyright (C) 1996, 1997, 1998, 2000, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1996-1998, 2000, 2001, 2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -81,7 +81,8 @@ DB_LOOKUP (netbyname, ,,
DB_LOOKUP (netbyaddr, ,,
{
- if (result->n_addrtype == type && result->n_net == net)
+ if ((type == AF_UNSPEC || result->n_addrtype == type)
+ && result->n_net == net)
/* Bingo! */
break;
}, uint32_t net, int type)
diff --git a/sysdeps/x86_64/elf/configure b/sysdeps/x86_64/elf/configure
index 7a2e3004a5..774654997d 100755
--- a/sysdeps/x86_64/elf/configure
+++ b/sysdeps/x86_64/elf/configure
@@ -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 @@ if { ac_try='${CC-cc} -c $CFLAGS conftest.s 1>&5'
{ (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 @@ else
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
diff --git a/sysdeps/x86_64/multiarch/ifunc-defines.sym b/sysdeps/x86_64/multiarch/ifunc-defines.sym
index 48d1287246..e2021cdf87 100644
--- a/sysdeps/x86_64/multiarch/ifunc-defines.sym
+++ b/sysdeps/x86_64/multiarch/ifunc-defines.sym
@@ -11,5 +11,7 @@ CPUID_EAX_OFFSET offsetof (struct cpuid_registers, eax)
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
diff --git a/sysdeps/x86_64/multiarch/init-arch.c b/sysdeps/x86_64/multiarch/init-arch.c
index ec0eb29faf..29e687344d 100644
--- a/sysdeps/x86_64/multiarch/init-arch.c
+++ b/sysdeps/x86_64/multiarch/init-arch.c
@@ -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 @@ __init_cpu_features (void)
{
__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;
diff --git a/sysdeps/x86_64/multiarch/init-arch.h b/sysdeps/x86_64/multiarch/init-arch.h
index 5c4892de38..48a2127418 100644
--- a/sysdeps/x86_64/multiarch/init-arch.h
+++ b/sysdeps/x86_64/multiarch/init-arch.h
@@ -42,6 +42,8 @@ extern struct cpu_features
unsigned int ecx;
unsigned int edx;
} cpuid[COMMON_CPUID_INDEX_MAX];
+ unsigned int family;
+ unsigned int model;
} __cpu_features attribute_hidden;