Skip to content

Commit

Permalink
Merge commit 'origin/master' into fedora/master
Browse files Browse the repository at this point in the history
Conflicts:
	ChangeLog
  • Loading branch information
Andreas Schwab committed Jul 2, 2009
2 parents ffd515a + 2fd0cd8 commit 8c9533e
Show file tree
Hide file tree
Showing 9 changed files with 100 additions and 19 deletions.
23 changes: 23 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion nis/nss_nis/nis-network.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion nis/nss_nisplus/nisplus-network.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion nss/getent.c
Original file line number Diff line number Diff line change
Expand Up @@ -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]);

Expand Down
5 changes: 3 additions & 2 deletions nss/nss_files/files-network.c
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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)
44 changes: 38 additions & 6 deletions sysdeps/x86_64/elf/configure
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -25,16 +57,16 @@ 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
libc_cv_x86_64_tls=no
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
Expand Down
2 changes: 2 additions & 0 deletions sysdeps/x86_64/multiarch/ifunc-defines.sym
Original file line number Diff line number Diff line change
Expand Up @@ -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
37 changes: 29 additions & 8 deletions sysdeps/x86_64/multiarch/init-arch.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand All @@ -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;
Expand Down
2 changes: 2 additions & 0 deletions sysdeps/x86_64/multiarch/init-arch.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;


Expand Down

0 comments on commit 8c9533e

Please sign in to comment.