diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/elf.h | 2 | ||||
-rw-r--r-- | include/features.h | 6 | ||||
-rw-r--r-- | include/libc-internal.h | 2 | ||||
-rw-r--r-- | include/math.h | 76 | ||||
-rw-r--r-- | include/printf.h | 1 | ||||
-rw-r--r-- | include/stdio.h | 7 | ||||
-rw-r--r-- | include/stdlib.h | 6 | ||||
-rw-r--r-- | include/string.h | 4 | ||||
-rw-r--r-- | include/strings.h | 4 | ||||
-rw-r--r-- | include/sys/mman.h | 12 | ||||
-rw-r--r-- | include/sys/syscall.h | 14 |
11 files changed, 113 insertions, 21 deletions
diff --git a/include/elf.h b/include/elf.h index 8ee65267a..19805d7c9 100644 --- a/include/elf.h +++ b/include/elf.h @@ -1292,6 +1292,8 @@ typedef struct #define EF_BFIN_PIC 0x00000001 /* -fpic */ #define EF_BFIN_FDPIC 0x00000002 /* -mfdpic */ +#define EF_BFIN_CODE_IN_L1 0x00000010 /* --code-in-l1 */ +#define EF_BFIN_DATA_IN_L1 0x00000020 /* --data-in-l1 */ /* FR-V specific definitions. */ #define R_FRV_NONE 0 /* No reloc. */ diff --git a/include/features.h b/include/features.h index c94d531e8..46a94f7f4 100644 --- a/include/features.h +++ b/include/features.h @@ -176,8 +176,10 @@ # define _XOPEN_SOURCE 600 # undef _XOPEN_SOURCE_EXTENDED # define _XOPEN_SOURCE_EXTENDED 1 -# undef _LARGEFILE64_SOURCE -# define _LARGEFILE64_SOURCE 1 +# ifdef __UCLIBC_HAS_LFS__ +# undef _LARGEFILE64_SOURCE +# define _LARGEFILE64_SOURCE 1 +# endif /* __UCLIBC_HAS_LFS__ */ # undef _BSD_SOURCE # define _BSD_SOURCE 1 # undef _SVID_SOURCE diff --git a/include/libc-internal.h b/include/libc-internal.h index 80bac2362..2f4f7fae3 100644 --- a/include/libc-internal.h +++ b/include/libc-internal.h @@ -56,6 +56,8 @@ extern char *__glibc_strerror_r (int __errnum, char *__buf, size_t __buflen); # define __pthread_mutex_lock(mutex) ((void)0) # define __pthread_mutex_trylock(mutex) ((void)0) # define __pthread_mutex_unlock(mutex) ((void)0) +# define _pthread_cleanup_push_defer(mutex) ((void)0) +# define _pthread_cleanup_pop_restore(mutex) ((void)0) # endif /* internal access to program name */ diff --git a/include/math.h b/include/math.h index 8c11b5a76..c50b2e7b0 100644 --- a/include/math.h +++ b/include/math.h @@ -1,5 +1,6 @@ /* Declarations for math functions. - Copyright (C) 1991,92,93,95,96,97,98,99,2001 Free Software Foundation, Inc. + Copyright (C) 1991-1993, 1995-1999, 2001, 2002, 2004, 2006 + 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 @@ -31,15 +32,20 @@ __BEGIN_DECLS /* Get machine-dependent HUGE_VAL value (returned on overflow). On all IEEE754 machines, this is +Infinity. */ #include <bits/huge_val.h> +#ifdef __USE_ISOC99 +# include <bits/huge_valf.h> +# include <bits/huge_vall.h> + +/* Get machine-dependent INFINITY value. */ +# include <bits/inf.h> -#ifdef __USE_ISOC99 /* Get machine-dependent NAN value (returned for some domain errors). */ # include <bits/nan.h> -#endif +#endif /* __USE_ISOC99 */ + /* Get general and ISO C99 specific information. */ #include <bits/mathdef.h> - /* The file <bits/mathcalls.h> contains the prototypes for all the actual math functions. These macros are used for those prototypes, so we can easily declare each function as both `name' and `__name', @@ -60,8 +66,12 @@ __BEGIN_DECLS #define _Mdouble_ double #define __MATH_PRECNAME(name,r) __CONCAT(name,r) +# define _Mdouble_BEGIN_NAMESPACE __BEGIN_NAMESPACE_STD +# define _Mdouble_END_NAMESPACE __END_NAMESPACE_STD #include <bits/mathcalls.h> #undef _Mdouble_ +#undef _Mdouble_BEGIN_NAMESPACE +#undef _Mdouble_END_NAMESPACE #undef __MATH_PRECNAME #if defined __USE_MISC || defined __USE_ISOC99 @@ -79,14 +89,44 @@ __BEGIN_DECLS # else # define __MATH_PRECNAME(name,r) name/**/f/**/r # endif +# define _Mdouble_BEGIN_NAMESPACE __BEGIN_NAMESPACE_C99 +# define _Mdouble_END_NAMESPACE __END_NAMESPACE_C99 # include <bits/mathcalls.h> # undef _Mdouble_ +# undef _Mdouble_BEGIN_NAMESPACE +# undef _Mdouble_END_NAMESPACE # undef __MATH_PRECNAME -# if (__STDC__ - 0 || __GNUC__ - 0) && !defined __NO_LONG_DOUBLE_MATH +# if (__STDC__ - 0 || __GNUC__ - 0) \ + && (!defined __NO_LONG_DOUBLE_MATH || defined __LDBL_COMPAT) +# ifdef __LDBL_COMPAT + +# ifdef __USE_ISOC99 +extern float __nldbl_nexttowardf (float __x, long double __y) + __THROW __attribute__ ((__const__)); +# ifdef __REDIRECT_NTH +extern float __REDIRECT_NTH (nexttowardf, (float __x, long double __y), + __nldbl_nexttowardf) + __attribute__ ((__const__)); +extern double __REDIRECT_NTH (nexttoward, (double __x, long double __y), + nextafter) __attribute__ ((__const__)); +extern long double __REDIRECT_NTH (nexttowardl, + (long double __x, long double __y), + nextafter) __attribute__ ((__const__)); +# endif +# endif + /* Include the file of declarations again, this time using `long double' instead of `double' and appending l to each function name. */ +# undef __MATHDECL_1 +# define __MATHDECL_2(type, function,suffix, args, alias) \ + extern type __REDIRECT_NTH(__MATH_PRECNAME(function,suffix), \ + args, alias) +# define __MATHDECL_1(type, function,suffix, args) \ + __MATHDECL_2(type, function,suffix, args, __CONCAT(function,suffix)) +# endif + # ifndef _Mlong_double_ # define _Mlong_double_ long double # endif @@ -96,8 +136,12 @@ __BEGIN_DECLS # else # define __MATH_PRECNAME(name,r) name/**/l/**/r # endif +# define _Mdouble_BEGIN_NAMESPACE __BEGIN_NAMESPACE_C99 +# define _Mdouble_END_NAMESPACE __END_NAMESPACE_C99 # include <bits/mathcalls.h> # undef _Mdouble_ +# undef _Mdouble_BEGIN_NAMESPACE +# undef _Mdouble_END_NAMESPACE # undef __MATH_PRECNAME # endif /* __STDC__ || __GNUC__ */ @@ -345,18 +389,28 @@ extern int matherr (struct exception *__exc); # define __NO_MATH_INLINES 1 #endif +#if defined __USE_ISOC99 && __GNUC_PREREQ(2,97) +/* ISO C99 defines some macros to compare number while taking care for + unordered numbers. Many FPUs provide special instructions to support + these operations. Generic support in GCC for these as builtins went + in before 3.0.0, but not all cpus added their patterns. We define + versions that use the builtins here, and <bits/mathinline.h> will + undef/redefine as appropriate for the specific GCC version in use. */ +# define isgreater(x, y) __builtin_isgreater(x, y) +# define isgreaterequal(x, y) __builtin_isgreaterequal(x, y) +# define isless(x, y) __builtin_isless(x, y) +# define islessequal(x, y) __builtin_islessequal(x, y) +# define islessgreater(x, y) __builtin_islessgreater(x, y) +# define isunordered(u, v) __builtin_isunordered(u, v) +#endif + /* Get machine-dependent inline versions (if there are any). */ #ifdef __USE_EXTERN_INLINES # include <bits/mathinline.h> #endif - #ifdef __USE_ISOC99 -/* ISO C99 defines some macros to compare number while taking care for - unordered numbers. Many FPUs provide special instructions to support - these operations and these tests are defined in <bits/mathinline.h>, - we define the generic macros at this late point and only if they are - not defined yet. */ +/* If we've still got undefined comparison macros, provide defaults. */ /* Return nonzero value if X is greater than Y. */ # ifndef isgreater diff --git a/include/printf.h b/include/printf.h index 569397cd2..a68c6daad 100644 --- a/include/printf.h +++ b/include/printf.h @@ -75,6 +75,7 @@ struct printf_info unsigned int is_short:1; /* h flag. */ unsigned int is_long:1; /* l flag. */ unsigned int is_long_double:1;/* L flag. */ + unsigned int __padding:20;/* non-gnu -- total of 32 bits on 32bit arch */ #elif __BYTE_ORDER == __BIG_ENDIAN diff --git a/include/stdio.h b/include/stdio.h index 787a6aa52..fd2a73842 100644 --- a/include/stdio.h +++ b/include/stdio.h @@ -840,7 +840,14 @@ extern void funlockfile (FILE *__stream) __THROW; #define fputc_unlocked(_ch, _fp) __FPUTC_UNLOCKED(_ch, _fp) #endif +#ifndef __STDIO_GETC_MACRO +#define __stdin stdin +#endif #define getchar() __GETC(__stdin) + +#ifndef __STDIO_PUTC_MACRO +#define __stdout stdout +#endif #define putchar(_ch) __PUTC((_ch), __stdout) #if defined __USE_POSIX || defined __USE_MISC diff --git a/include/stdlib.h b/include/stdlib.h index 3ed029c07..982bac72f 100644 --- a/include/stdlib.h +++ b/include/stdlib.h @@ -693,10 +693,12 @@ __END_NAMESPACE_C99 #endif -#if defined __USE_SVID || defined __USE_XOPEN_EXTENDED +#if defined __USE_SVID || defined __USE_XOPEN_EXTENDED || defined __USE_BSD /* Convert floating point numbers to strings. The returned values are valid only until another call to the same function. */ +# ifdef __UCLIBC_SUSV3_LEGACY__ + #if 0 /* Convert VALUE to a string with NDIGIT digits and return a pointer to this. Set *DECPT with the position of the decimal character and *SIGN @@ -716,7 +718,7 @@ extern char *fcvt (double __value, int __ndigit, int *__restrict __decpt, be written to BUF. */ extern char *gcvt (double __value, int __ndigit, char *__buf) __THROW __nonnull ((3)) __wur; - +# endif /* __UCLIBC_SUSV3_LEGACY__ */ # if 0 /*def __USE_MISC*/ /* Long double versions of above functions. */ diff --git a/include/string.h b/include/string.h index dd5f23f2b..87d953449 100644 --- a/include/string.h +++ b/include/string.h @@ -321,8 +321,9 @@ extern char *index (__const char *__s, int __c) extern char *rindex (__const char *__s, int __c) __THROW __attribute_pure__ __nonnull ((1)); # else +# ifdef __UCLIBC_SUSV3_LEGACY_MACROS__ /* bcopy/bzero/bcmp/index/rindex are marked LEGACY in SuSv3. - * They are replaced as proposed by SuSv3. Don't sync this part + * They are replaced as proposed by SuSv3. Don't sync this part * with glibc and keep it in sync with strings.h. */ # define bcopy(src,dest,n) (memmove((dest), (src), (n)), (void) 0) @@ -330,6 +331,7 @@ extern char *rindex (__const char *__s, int __c) # define bcmp(s1,s2,n) memcmp((s1), (s2), (size_t)(n)) # define index(s,c) strchr((s), (c)) # define rindex(s,c) strrchr((s), (c)) +# endif # endif /* Return the position of the first bit set in I, or 0 if none are set. diff --git a/include/strings.h b/include/strings.h index fe089d960..107c53a4f 100644 --- a/include/strings.h +++ b/include/strings.h @@ -53,8 +53,9 @@ extern char *index (__const char *__s, int __c) extern char *rindex (__const char *__s, int __c) __THROW __attribute_pure__ __nonnull ((1)); # else +# ifdef __UCLIBC_SUSV3_LEGACY_MACROS__ /* bcopy/bzero/bcmp/index/rindex are marked LEGACY in SuSv3. - * They are replaced as proposed by SuSv3. Don't sync this part + * They are replaced as proposed by SuSv3. Don't sync this part * with glibc and keep it in sync with string.h. */ # define bcopy(src,dest,n) (memmove((dest), (src), (n)), (void) 0) @@ -62,6 +63,7 @@ extern char *rindex (__const char *__s, int __c) # define bcmp(s1,s2,n) memcmp((s1), (s2), (size_t)(n)) # define index(s,c) strchr((s), (c)) # define rindex(s,c) strrchr((s), (c)) +# endif # endif /* Return the position of the first bit set in I, or 0 if none are set. diff --git a/include/sys/mman.h b/include/sys/mman.h index aeeea7d0e..10f4afe24 100644 --- a/include/sys/mman.h +++ b/include/sys/mman.h @@ -100,6 +100,7 @@ extern int posix_madvise (void *__addr, size_t __len, int __advice) __THROW; #endif #ifdef __ARCH_USE_MMU__ + /* Guarantee all whole pages mapped by the range [ADDR,ADDR+LEN) to be memory resident. */ extern int mlock (__const void *__addr, size_t __len) __THROW; @@ -115,6 +116,17 @@ extern int mlockall (int __flags) __THROW; /* All currently mapped pages of the process' address space become unlocked. */ extern int munlockall (void) __THROW; + +#else + +/* On no-mmu systems, memory cannot be swapped out, so + * these functions will always succeed. + */ +static inline int mlock (__const void *__addr, size_t __len) { return 0; } +static inline int munlock (__const void *__addr, size_t __len) { return 0; } +static inline int mlockall (int __flags) { return 0; } +static inline int munlockall (void) { return 0; } + #endif #ifdef __USE_MISC diff --git a/include/sys/syscall.h b/include/sys/syscall.h index aef1f998f..4c8ede843 100644 --- a/include/sys/syscall.h +++ b/include/sys/syscall.h @@ -19,13 +19,19 @@ #ifndef _SYSCALL_H #define _SYSCALL_H 1 -/* This file provides us with the nicely useful _syscall[0-5] macros. */ +/* The _syscall#() macros are for uClibc internal use only. + * User application code should use syscall() instead. + * + * The kernel provided _syscall[0-6] macros from asm/unistd.h are not suitable + * for use in uClibc as they lack PIC support etc, so for uClibc we use our own + * local _syscall# macros to be certain all such variations are handled + * properly. + */ + #include <features.h> +#include <bits/sysnum.h> #if defined _LIBC && (defined IS_IN_libc || defined NOT_IN_libc) # include <bits/syscalls.h> -#else -# include <asm/unistd.h> -# include <bits/sysnum.h> #endif #endif |