summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorThomas Schwinge <thomas@codesourcery.com>2013-09-01 19:26:53 +0200
committerThomas Schwinge <thomas@codesourcery.com>2013-09-01 19:26:53 +0200
commit5a92339ad317991475c5628c073a3411447775d5 (patch)
treef6f8fc8f28093445c97db2ddf54bc74bbedf8349 /include
parent12ccc71de7e6f111cb57ddb635847d704689ae4e (diff)
parentd5860b5273bc00632c65b43cb931d3238db0ab57 (diff)
Merge commit 'refs/top-bases/t/tls' into t/tls
Conflicts: sysdeps/mach/hurd/i386/init-first.c
Diffstat (limited to 'include')
-rw-r--r--include/features.h2
-rw-r--r--include/fenv.h10
-rw-r--r--include/libc-internal.h20
-rw-r--r--include/libc-symbols.h10
-rw-r--r--include/netdb.h15
-rw-r--r--include/resolv.h18
-rw-r--r--include/rpc/auth_des.h8
-rw-r--r--include/shlib-compat.h2
-rw-r--r--include/sys/time.h25
-rw-r--r--include/time.h1
10 files changed, 78 insertions, 33 deletions
diff --git a/include/features.h b/include/features.h
index ca83da05eb..c9be10a63e 100644
--- a/include/features.h
+++ b/include/features.h
@@ -353,7 +353,7 @@
/* Major and minor version number of the GNU C library package. Use
these macros to test for features in specific releases. */
#define __GLIBC__ 2
-#define __GLIBC_MINOR__ 17
+#define __GLIBC_MINOR__ 18
#define __GLIBC_PREREQ(maj, min) \
((__GLIBC__ << 16) + __GLIBC_MINOR__ >= ((maj) << 16) + (min))
diff --git a/include/fenv.h b/include/fenv.h
index ed6d1394ba..9f90d17090 100644
--- a/include/fenv.h
+++ b/include/fenv.h
@@ -1,5 +1,6 @@
#ifndef _FENV_H
#include <math/fenv.h>
+#include <stdbool.h>
#ifndef _ISOMAC
/* Now define the internal interfaces. */
@@ -23,4 +24,13 @@ libm_hidden_proto (fetestexcept)
libm_hidden_proto (feclearexcept)
#endif
+/* Rounding mode context. This allows functions to set/restore rounding mode
+ only when the desired rounding mode is different from the current rounding
+ mode. */
+struct rm_ctx
+{
+ fenv_t env;
+ bool updated_status;
+};
+
#endif
diff --git a/include/libc-internal.h b/include/libc-internal.h
index 0c0fa024a7..78f82da58a 100644
--- a/include/libc-internal.h
+++ b/include/libc-internal.h
@@ -50,4 +50,24 @@ extern void __init_misc (int, char **, char **);
/* Cast an integer or a pointer VAL to integer with proper type. */
# define cast_to_integer(val) ((__integer_if_pointer_type (val)) (val))
+/* Align a value by rounding down to closest size.
+ e.g. Using size of 4096, we get this behavior:
+ {4095, 4096, 4097} = {0, 4096, 4096}. */
+#define ALIGN_DOWN(base, size) ((base) & -((__typeof__ (base)) (size)))
+
+/* Align a value by rounding up to closest size.
+ e.g. Using size of 4096, we get this behavior:
+ {4095, 4096, 4097} = {4096, 4096, 8192}.
+
+ Note: The size argument has side effects (expanded multiple times). */
+#define ALIGN_UP(base, size) ALIGN_DOWN ((base) + (size) - 1, (size))
+
+/* Same as ALIGN_DOWN(), but automatically casts when base is a pointer. */
+#define PTR_ALIGN_DOWN(base, size) \
+ ((__typeof__ (base)) ALIGN_DOWN ((uintptr_t) (base), (size)))
+
+/* Same as ALIGN_UP(), but automatically casts when base is a pointer. */
+#define PTR_ALIGN_UP(base, size) \
+ ((__typeof__ (base)) ALIGN_UP ((uintptr_t) (base), (size)))
+
#endif /* _LIBC_INTERNAL */
diff --git a/include/libc-symbols.h b/include/libc-symbols.h
index f043ce0850..a3b6274bad 100644
--- a/include/libc-symbols.h
+++ b/include/libc-symbols.h
@@ -782,4 +782,14 @@ for linking")
#define libc_ifunc_hidden_def(name) \
libc_ifunc_hidden_def1 (__GI_##name, name)
+/* Add the compiler optimization to inhibit loop transformation to library
+ calls. This is used to avoid recursive calls in memset and memmove
+ default implementations. */
+#ifdef HAVE_CC_INHIBIT_LOOP_TO_LIBCALL
+# define inhibit_loop_to_libcall \
+ __attribute__ ((__optimize__ ("-fno-tree-loop-distribute-patterns")))
+#else
+# define inhibit_loop_to_libcall
+#endif
+
#endif /* libc-symbols.h */
diff --git a/include/netdb.h b/include/netdb.h
index e97d1bff8e..a7960ebdf7 100644
--- a/include/netdb.h
+++ b/include/netdb.h
@@ -6,17 +6,12 @@
/* Macros for accessing h_errno from inside libc. */
# if !defined NOT_IN_libc || defined IN_LIB
# undef h_errno
-# ifdef _LIBC_REENTRANT
-# include <tls.h>
-# ifndef NOT_IN_libc
-# define h_errno __libc_h_errno
-# else
-# define h_errno h_errno /* For #ifndef h_errno tests. */
-# endif
-extern __thread int h_errno attribute_tls_model_ie;
+# ifndef NOT_IN_libc
+# define h_errno __libc_h_errno
# else
-extern int h_errno;
-# endif /* _LIBC_REENTRANT */
+# define h_errno h_errno /* For #ifndef h_errno tests. */
+# endif
+extern __thread int h_errno attribute_tls_model_ie;
# endif /* !NOT_IN_libc || IN_LIB */
# define __set_h_errno(x) (h_errno = (x))
diff --git a/include/resolv.h b/include/resolv.h
index 30ea8776b5..87b3598330 100644
--- a/include/resolv.h
+++ b/include/resolv.h
@@ -13,20 +13,12 @@
#ifdef _RESOLV_H_
-# ifdef _LIBC_REENTRANT
-# include <tls.h>
-# undef _res
-# ifndef NOT_IN_libc
-# define __resp __libc_resp
-# endif
-# define _res (*__resp)
-extern __thread struct __res_state *__resp attribute_tls_model_ie;
-# else
-# ifndef __BIND_NOSTATIC
-# undef _res
-extern struct __res_state _res;
-# endif
+# ifndef NOT_IN_libc
+# define __resp __libc_resp
# endif
+extern __thread struct __res_state *__resp attribute_tls_model_ie;
+# undef _res
+# define _res (*__resp)
/* Now define the internal interfaces. */
extern int __res_vinit (res_state, int);
diff --git a/include/rpc/auth_des.h b/include/rpc/auth_des.h
index c14f069668..0e9db1a226 100644
--- a/include/rpc/auth_des.h
+++ b/include/rpc/auth_des.h
@@ -7,12 +7,12 @@ libc_hidden_proto (getsecretkey)
libc_hidden_proto (rtime)
extern bool_t xdr_authdes_cred (XDR *xdrs, struct authdes_cred *cred);
-extern bool_t xdr_authdes_verf (register XDR *xdrs,
- register struct authdes_verf *verf);
+extern bool_t xdr_authdes_verf (XDR *xdrs,
+ struct authdes_verf *verf);
struct svc_req;
struct rpc_msg;
-extern enum auth_stat _svcauth_des (register struct svc_req *rqst,
- register struct rpc_msg *msg);
+extern enum auth_stat _svcauth_des (struct svc_req *rqst,
+ struct rpc_msg *msg);
#define DECLARE_NSS_PROTOTYPES(service) \
diff --git a/include/shlib-compat.h b/include/shlib-compat.h
index 43ef084d7d..979b5929e3 100644
--- a/include/shlib-compat.h
+++ b/include/shlib-compat.h
@@ -57,7 +57,7 @@
the version set name to use for e.g. symbols first introduced into
libm in the GLIBC_2.1 version. Definitions of symbols with explicit
versions should look like:
- versioned_symbol (libm, new_foo, foo, GLIBC_2_1);
+ versioned_symbol (libm, new_foo, foo, GLIBC_2_1);
This will define the symbol `foo' with the appropriate default version,
i.e. either GLIBC_2.1 or the "earliest version" specified in
shlib-versions if that is newer. */
diff --git a/include/sys/time.h b/include/sys/time.h
index 599e189bcd..b9af6d480f 100644
--- a/include/sys/time.h
+++ b/include/sys/time.h
@@ -1,8 +1,25 @@
+/* Time function internal interfaces.
+ Copyright (C) 1997-2013 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
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
#ifndef _SYS_TIME_H
-#include <time/sys/time.h>
+# include <time/sys/time.h>
-#ifndef _ISOMAC
-/* Now document the internal interfaces. */
+# ifndef _ISOMAC
extern int __gettimeofday (struct timeval *__tv,
struct timezone *__tz);
libc_hidden_proto (__gettimeofday)
@@ -22,5 +39,5 @@ extern int __utimes (const char *__file, const struct timeval __tvp[2])
attribute_hidden;
extern int __futimes (int fd, const struct timeval tvp[2]) attribute_hidden;
-#endif
+# endif
#endif
diff --git a/include/time.h b/include/time.h
index 9be15b9739..8dd10dcdd8 100644
--- a/include/time.h
+++ b/include/time.h
@@ -21,6 +21,7 @@ libc_hidden_proto (strptime)
extern __typeof (clock_getres) __clock_getres;
extern __typeof (clock_gettime) __clock_gettime;
+libc_hidden_proto (__clock_gettime)
extern __typeof (clock_settime) __clock_settime;
extern __typeof (clock_nanosleep) __clock_nanosleep;
extern __typeof (clock_getcpuclockid) __clock_getcpuclockid;