source: rtems/contrib/crossrpms/patches/newlib-1.17.0-rtems4.10-20091030.diff @ 1ec894f8

4.104.115
Last change on this file since 1ec894f8 was 1ec894f8, checked in by Ralf Corsepius <ralf.corsepius@…>, on 10/30/09 at 10:37:33

New.

  • Property mode set to 100644
File size: 53.8 KB
  • newlib/ChangeLog.rtems

    diff -Naur newlib-1.17.0.orig/newlib/ChangeLog.rtems newlib-1.17.0-rtems4.10-20091030/newlib/ChangeLog.rtems
    old new  
     12009-10-29      Ralf Corsépius <ralf.corsepius@rtems.org>
     2
     3        * libc/sys/rtems/machine/_types.h: Rework.
     4        * libc/sys/rtems/machine/stdint.h: Remove.
     5        * libc/include/inttypes.h:
     6        Rework logic to determine PRI*PTR.
     7        Prefer long64 over longlong64.
     8        * libc/include/machine/_default_types.h:
     9        Sync logic for __int32 with stdint.h (Prefer long over int).
     10        * libc/include/stdint.h:
     11        Remove __SPU__ hack.
     12        Prefer int for int16_t (sync with _default_types.h).
     13        Rework intptr_t determination.
     14
     152009-10-28      Ralf Corsépius <ralf.corsepius@rtems.org>
     16
     17        * libc/sys/rtems/machine/_types.h: New.
     18        Add custom time for _ssize_t.
     19        * libc/stdlib/assert.c: Sync with newlib-CVS.
     20        * configure.host: Add -DHAVE_ASSERT_FUNC to newlib_cflags.
     21
     222009-10-27      Ralf Corsépius <ralf.corsepius@rtems.org>
     23
     24        * libc/include/sys/pthread.h:
     25        Add pthread_atfork (Mandated by IEEE Std 1003.1-2008).
     26        Add pthread_rwlock_unlock (Formerly missing)
     27
     282009-10-26      Ralf Corsépius <ralf.corsepius@rtems.org>
     29
     30        * libc/include/sys/signal.h: Sync with newlib-CVS.
     31
     322009-10-09      Ralf Corsépius <ralf.corsepius@rtems.org>
     33
     34        * libc/include/sys/signal.h: Use pid_t as 1st arg to kill()
     35        (mandated by POSIX).
     36
     372009-09-22      Ralf Corsépius <ralf.corsepius@rtems.org>
     38
     39        * libc/sys/rtems/sys/queue.h: Update copyright (from FreeBSD).
     40        Remove CIRCLEQ_*.
     41        * libc/search/hcreate.c: Don't include sys/queue.h.
     42
     432009-09-18  Christopher Faylor  <me+cygwin@cgf.cx>
     44
     45        * libc/include/sys/unistd.h: Declare getpagesize as returning
     46        POSIX-mandated int.
     47
     482009-09-16      Ralf Corsépius <ralf.corsepius@rtems.org>
     49
     50        * libc/sys/rtems/crt0.c: Use while(1) in _exit stub to silence GCC "noreturn"
     51        warning.
     52
     532009-09-15      Ralf Corsépius <ralf.corsepius@rtems.org>
     54
     55        * libc/include/stdlib.h: Add posix_memalign.
     56
     572009-09-11      Ralf Corsépius <ralf.corsepius@rtems.org>
     58
     59        * configure.host (m32c): Remove -D_ABORT_PROVIDED.
     60
     612009-09-10      Ralf Corsépius <ralf.corsepius@rtems.org>
     62
     63        * configure.host: Add -D_NO_POPEN.
     64        * libc/sys/rtems/crt0.c: Don't provide waitpid unless used.
     65
     662009-09-09      Ralf Corsépius <ralf.corsepius@rtems.org>
     67
     68        * configure.host: Add -D_NO_WORDEXP.
     69
     702009-09-06      Ralf Corsépius <ralf.corsepius@rtems.org>
     71
     72        * libc/sys/rtems/crt0.c: Add issetugid.
     73
     742009-09-02      Ralf Corsépius <ralf.corsepius@rtems.org>
     75
     76        * libc/sys/rtems/crt0.c: Rework. Introduce macro RTEMS_STUB.
     77
     782009-07-27      Ralf Corsépius <ralf.corsepius@rtems.org>
     79
     80        * libc/sys/rtems/crt0.c: Add _isatty_r.
     81
     822009-07-06      Joel Sherrill <joel.sherrill@oarcorp.com>
     83
     84        * libc/include/sys/features.h: Define _UNIX98_THREAD_MUTEX_ATTRIBUTES.
     85
     862009-05-05      Ralf Corsépius <ralf.corsepius@rtems.org>
     87
     88        * configure.host: Remove -DMISSING_SYSCALL_NAMES.
     89
     902009-03-11      Ralf Corsépius <ralf.corsepius@rtems.org>
     91
     92        * libc/stdlib/assert.c: Don't build __assert_func.
     93        * libc/sys/rtems/crt0.c: Add __assert_func.
     94
     952009-03-09      Ralf Corsépius <ralf.corsepius@rtems.org>
     96
     97        * libc/machine/powerpc/times.c: Remove.
     98        * libc/machine/powerpc/Makefile.am: Remove times.c.
     99        * libc/machine/powerpc/Makefile.in: Regenerate.
     100
     1012009-02-24      Ralf Corsépius <ralf.corsepius@rtems.org>
     102
     103        * libc/unix/ttyname.c: Sync with newlib-cvs.
     104        * configure.host: Add -DHAVE_BLKSIZE to newlib_cflags.
     105
     1062009-02-22      Ralf Corsépius <ralf.corsepius@rtems.org>
     107
     108        * libc/sys/rtems/machine/stdint.h: Add __lm32__.
     109        * libc/machine/lm32/configure.in: Set AC_CONFIG_SRC to setjmp.S.
     110        * libc/machine/lm32/configure: Regenerate.
     111
     1122009-02-20      Ralf Corsépius <ralf.corsepius@rtems.org>
     113
     114        * libc/unix/Makefile.in: Regenerate.
     115
     1162009-02-20  Craig Howland <howland@LGSInnovations.com> on behalf of
     117        Sebastian Huber <sebastian.huber@embedded-brains.de>
     118
     119        * libc/unix/ttyname.c:  Remove ttyname_r() (to a new file to avoid
     120        coupling ttyname_r() and ttyname() due to the latter's large buffer).
     121        * libc/unix/ttyname_r.c:  New file to hold ttyname_r(), previously in
     122        ttyname.c.
     123        * libc/unix/ttyname.h:  New file (common size definition for the 2
     124        ttyname*c files that are now split).
     125        * libc/unix/Makefile.am (ELIX_2_SOURCES):  Add ttyname_r.c.
     126
     1272009-02-16      Ralf Corsépius <ralf.corsepius@rtems.org>
     128
     129        * libc/sys/rtems/sys/param.h:
     130        Update copyright notice from FreeBSD.
     131        Remove HZ.
     132        Add #include <sys/priority.h>
     133        Remove priority handling (moved to sys/priority.h).
     134        Remove CLBYTES (Unused, abandoned in BSD).
     135
     1362009-02-06      Ralf Corsépius <ralf.corsepius@rtems.org>
     137
     138        * libc/include/sched.h:
     139        Remove (collides with RTEMS's schedul.h).
     140
  • newlib/configure.host

    diff -Naur newlib-1.17.0.orig/newlib/configure.host newlib-1.17.0-rtems4.10-20091030/newlib/configure.host
    old new  
    166166        ;;
    167167  m32c)
    168168        machine_dir=m32c
    169         newlib_cflags="${newlib_cflags} -DPREFER_SIZE_OVER_SPEED -DABORT_PROVIDED -DSMALL_MEMORY"
     169        newlib_cflags="${newlib_cflags} -DPREFER_SIZE_OVER_SPEED -DSMALL_MEMORY"
    170170        ;;
    171171
    172172  m32r*)
     
    537537  *-*-rtems*)
    538538        default_newlib_io_long_long="yes"
    539539        default_newlib_io_c99_formats="yes"
    540         newlib_cflags="${newlib_cflags} -DMALLOC_PROVIDED -DEXIT_PROVIDED -DMISSING_SYSCALL_NAMES -DSIGNAL_PROVIDED -DREENTRANT_SYSCALLS_PROVIDED -DHAVE_NANOSLEEP -DHAVE_FCNTL"
     540        newlib_cflags="${newlib_cflags} -DMALLOC_PROVIDED -DEXIT_PROVIDED -DSIGNAL_PROVIDED -DREENTRANT_SYSCALLS_PROVIDED -DHAVE_NANOSLEEP -DHAVE_BLKSIZE -DHAVE_FCNTL"
     541        newlib_cflags="${newlib_cflags} -DHAVE_ASSERT_FUNC"
    541542        # turn off unsupported items in posix directory
    542         newlib_cflags="${newlib_cflags} -D_NO_GETLOGIN -D_NO_GETPWENT -D_NO_GETUT -D_NO_GETPASS -D_NO_SIGSET"
     543        newlib_cflags="${newlib_cflags} -D_NO_GETLOGIN -D_NO_GETPWENT -D_NO_GETUT -D_NO_GETPASS -D_NO_SIGSET -D_NO_WORDEXP -D_NO_POPEN"
    543544        ;;
    544545# VxWorks supplies its own version of malloc, and the newlib one
    545546# doesn't work because VxWorks does not have sbrk.
  • newlib/libc/include/inttypes.h

    diff -Naur newlib-1.17.0.orig/newlib/libc/include/inttypes.h newlib-1.17.0-rtems4.10-20091030/newlib/libc/include/inttypes.h
    old new  
    163163
    164164
    165165/* 64-bit types */
    166 #if __have_longlong64
    167 #define __PRI64(x) __STRINGIFY(ll##x)
    168 #define __SCN64(x) __STRINGIFY(ll##x)
    169 #elif __have_long64
     166#if __have_long64
    170167#define __PRI64(x) __STRINGIFY(l##x)
    171168#define __SCN64(x) __STRINGIFY(l##x)
     169#elif __have_longlong64
     170#define __PRI64(x) __STRINGIFY(ll##x)
     171#define __SCN64(x) __STRINGIFY(ll##x)
    172172#else
    173173#define __PRI64(x) __STRINGIFY(x)
    174174#define __SCN64(x) __STRINGIFY(x)
     
    217217#endif
    218218
    219219/* max-bit types */
    220 #if __have_longlong64
    221 #define __PRIMAX(x) __STRINGIFY(ll##x)
    222 #define __SCNMAX(x) __STRINGIFY(ll##x)
    223 #elif __have_long64
     220#if __have_long64
    224221#define __PRIMAX(x) __STRINGIFY(l##x)
    225222#define __SCNMAX(x) __STRINGIFY(l##x)
     223#elif __have_longlong64
     224#define __PRIMAX(x) __STRINGIFY(ll##x)
     225#define __SCNMAX(x) __STRINGIFY(ll##x)
    226226#else
    227227#define __PRIMAX(x) __STRINGIFY(x)
    228228#define __SCNMAX(x) __STRINGIFY(x)
     
    242242#define SCNxMAX         __SCNMAX(x)
    243243
    244244/* ptr types */
    245 #if __have_longlong64
    246 #define __PRIPTR(x) __STRINGIFY(ll##x)
    247 #define __SCNPTR(x) __STRINGIFY(ll##x)
    248 #elif __have_long64
     245#if INTPTR_MAX == INT64_MAX
     246#define __PRIPTR(x) __PRI64(x)
     247#define __SCNPTR(x) __SCN64(x)
     248#elif INTPTR_MAX == INT32_MAX
     249#define __PRIPTR(x) __PRI32(x)
     250#define __SCNPTR(x) __SCN32(x)
     251#elif INTPTR_MAX == INT16_MAX
     252#define __PRIPTR(x) __PRI16(x)
     253#define __SCNPTR(x) __SCN16(x)
     254#else
     255#error cannot determine PRI*PTR
     256#endif
     257
     258#if 0
     259#if __have_long64
    249260#define __PRIPTR(x) __STRINGIFY(l##x)
    250261#define __SCNPTR(x) __STRINGIFY(l##x)
     262#elif __have_longlong64
     263#define __PRIPTR(x) __STRINGIFY(ll##x)
     264#define __SCNPTR(x) __STRINGIFY(ll##x)
    251265#else
    252266#define __PRIPTR(x) __STRINGIFY(x)
    253267#define __SCNPTR(x) __STRINGIFY(x)
    254268#endif
     269#endif
    255270
    256271#define PRIdPTR         __PRIPTR(d)
    257272#define PRIiPTR         __PRIPTR(i)
  • newlib/libc/include/machine/_default_types.h

    diff -Naur newlib-1.17.0.orig/newlib/libc/include/machine/_default_types.h newlib-1.17.0-rtems4.10-20091030/newlib/libc/include/machine/_default_types.h
    old new  
    5454#endif
    5555#endif
    5656
    57 #if __EXP(INT_MAX) == 0x7fffffffL
    58 typedef signed int __int32_t;
    59 typedef unsigned int __uint32_t;
    60 #define ___int32_t_defined 1
    61 #elif __EXP(LONG_MAX) == 0x7fffffffL
     57#if __EXP(LONG_MAX) == 0x7fffffffL
    6258typedef signed long __int32_t;
    6359typedef unsigned long __uint32_t;
    6460#define ___int32_t_defined 1
     61#elif __EXP(INT_MAX) == 0x7fffffffL
     62typedef signed int __int32_t;
     63typedef unsigned int __uint32_t;
     64#define ___int32_t_defined 1
    6565#elif __EXP(SHRT_MAX) == 0x7fffffffL
    6666typedef signed short __int32_t;
    6767typedef unsigned short __uint32_t;
  • newlib/libc/include/machine/ieeefp.h

    diff -Naur newlib-1.17.0.orig/newlib/libc/include/machine/ieeefp.h newlib-1.17.0-rtems4.10-20091030/newlib/libc/include/machine/ieeefp.h
    old new  
    6262#  define __IEEE_BIG_ENDIAN
    6363# endif
    6464#else
    65 # define __IEEE_BIG_ENDIAN
    6665# ifdef __ARMEL__
     66#  define __IEEE_LITTLE_ENDIAN
     67# else
     68#  define __IEEE_BIG_ENDIAN
     69# endif
     70# ifdef __ARMWEL__
    6771#  define __IEEE_BYTES_LITTLE_ENDIAN
    6872# endif
    6973#endif
  • newlib/libc/include/machine/setjmp.h

    diff -Naur newlib-1.17.0.orig/newlib/libc/include/machine/setjmp.h newlib-1.17.0-rtems4.10-20091030/newlib/libc/include/machine/setjmp.h
    old new  
    2727
    2828/* necv70 was 9 as well. */
    2929
    30 #ifdef __mc68000__
     30#if defined(__m68k__) || defined(__mc68000__)
    3131/*
    3232 * onsstack,sigmask,sp,pc,psl,d2-d7,a2-a6,
    3333 * fp2-fp7      for 68881.
  • newlib/libc/include/pthread.h

    diff -Naur newlib-1.17.0.orig/newlib/libc/include/pthread.h newlib-1.17.0-rtems4.10-20091030/newlib/libc/include/pthread.h
    old new  
    3333#include <time.h>
    3434#include <sys/sched.h>
    3535
    36 /* Register Fork Handlers, P1003.1c/Draft 10, P1003.1c/Draft 10, p. 27
    37  
    38     If an OS does not support processes, then it falls under this provision
    39     and may not provide pthread_atfork():
    40  
    41     "Either the implementation shall support the pthread_atfork() function
    42      as described above or the pthread_atfork() funciton shall not be
    43      provided."
    44  
    45     NOTE: RTEMS does not provide pthread_atfork().  */
    46 
    47 #if !defined(__rtems__)
    48 #warning "Add pthread_atfork() prototype"
    49 #endif
    50 
     36/* Register Fork Handlers */
     37int     _EXFUN(pthread_atfork,(void (*prepare)(void), void (*parent)(void),
     38                   void (*child)(void)));
     39         
    5140/* Mutex Initialization Attributes, P1003.1c/Draft 10, p. 81 */
    5241
    5342int     _EXFUN(pthread_mutexattr_init, (pthread_mutexattr_t *__attr));
     
    345334int     _EXFUN(pthread_rwlock_tryrdlock,(pthread_rwlock_t *__rwlock));
    346335int     _EXFUN(pthread_rwlock_timedrdlock,
    347336        (pthread_rwlock_t *__rwlock, _CONST struct timespec *__abstime));
     337int     _EXFUN(pthread_rwlock_unlock,(pthread_rwlock_t *__rwlock));
    348338int     _EXFUN(pthread_rwlock_wrlock,(pthread_rwlock_t *__rwlock));
    349339int     _EXFUN(pthread_rwlock_trywrlock,(pthread_rwlock_t *__rwlock));
    350340int     _EXFUN(pthread_rwlock_timedwrlock,
  • newlib/libc/include/sched.h

    diff -Naur newlib-1.17.0.orig/newlib/libc/include/sched.h newlib-1.17.0-rtems4.10-20091030/newlib/libc/include/sched.h
    old new  
    1 #ifndef _SCHED_H_
    2 #define _SCHED_H_
    3 
    4 #ifdef __cplusplus
    5 extern "C" {
    6 #endif
    7 
    8 #include <sys/sched.h>
    9 
    10 #ifdef __cplusplus
    11 }
    12 #endif
    13 
    14 #endif /* _SCHED_H_ */
  • newlib/libc/include/stdint.h

    diff -Naur newlib-1.17.0.orig/newlib/libc/include/stdint.h newlib-1.17.0-rtems4.10-20091030/newlib/libc/include/stdint.h
    old new  
    3333/* Check if "long" is 64bit or 32bit wide */
    3434#if __STDINT_EXP(LONG_MAX) > 0x7fffffff
    3535#define __have_long64 1
    36 #elif __STDINT_EXP(LONG_MAX) == 0x7fffffff && !defined(__SPU__)
     36#elif __STDINT_EXP(LONG_MAX) == 0x7fffffff
    3737#define __have_long32 1
    3838#endif
    3939
     
    4949#define __int_least8_t_defined 1
    5050#endif
    5151
    52 #if __STDINT_EXP(SHRT_MAX) == 0x7fff
    53 typedef signed short int16_t;
    54 typedef unsigned short uint16_t;
    55 #define __int16_t_defined 1
    56 #elif __STDINT_EXP(INT_MAX) == 0x7fff
     52#if __STDINT_EXP(INT_MAX) == 0x7fff
    5753typedef signed int int16_t;
    5854typedef unsigned int uint16_t;
    5955#define __int16_t_defined 1
     56#elif __STDINT_EXP(SHRT_MAX) == 0x7fff
     57typedef signed short int16_t;
     58typedef unsigned short uint16_t;
     59#define __int16_t_defined 1
    6060#elif __STDINT_EXP(SCHAR_MAX) == 0x7fff
    6161typedef signed char int16_t;
    6262typedef unsigned char uint16_t;
     
    239239 * GCC doesn't provide an appropriate macro for [u]intptr_t
    240240 * For now, use __PTRDIFF_TYPE__
    241241 */
     242#if defined(__SIZEOF_POINTER__)
     243#if __SIZEOF_POINTER__ == 8
     244  typedef int64_t intptr_t;
     245  typedef uint64_t uintptr_t;
     246#define INTPTR_MAX INT64_MAX
     247#define INTPTR_MIN INT64_MIN
     248#define UINTPTR_MAX UINT64_MAX
     249#elif __SIZEOF_POINTER__ == 4
     250  typedef int32_t intptr_t;
     251  typedef uint32_t uintptr_t;
     252#define INTPTR_MAX INT32_MAX
     253#define INTPTR_MIN INT32_MIN
     254#define UINTPTR_MAX UINT32_MAX
     255#elif __SIZEOF_POINTER__ == 2
     256  typedef int16_t intptr_t;
     257  typedef uint16_t uintptr_t;
     258#define INTPTR_MAX INT16_MAX
     259#define INTPTR_MIN INT16_MIN
     260#define UINTPTR_MAX UINT16_MAX
     261#else
     262#error cannot determine intptr_t
     263#endif
     264#else
    242265#if defined(__PTRDIFF_TYPE__)
    243266typedef signed __PTRDIFF_TYPE__ intptr_t;
    244267typedef unsigned __PTRDIFF_TYPE__ uintptr_t;
     268#define INTPTR_MAX PTRDIFF_MAX
     269#define INTPTR_MIN PTRDIFF_MIN
     270#ifdef __UINTPTR_MAX__
     271#define UINTPTR_MAX __UINTPTR_MAX__
     272#else
     273#define UINTPTR_MAX (2UL * PTRDIFF_MAX + 1)
     274#endif
    245275#else
    246276/*
    247277 * Fallback to hardcoded values,
     
    249279 */
    250280typedef signed long intptr_t;
    251281typedef unsigned long uintptr_t;
     282#define INTPTR_MAX __STDINT_EXP(LONG_MAX)
     283#define INTPTR_MIN (-__STDINT_EXP(LONG_MAX) - 1)
     284#define UINTPTR_MAX (__STDINT_EXP(LONG_MAX) * 2UL + 1)
     285#endif
    252286#endif
    253287
    254288/* Limits of Specified-Width Integer Types */
     
    457491#endif
    458492
    459493#if __int64_t_defined
    460 #if __have_longlong64
    461 #define INT64_C(x)      x##LL
    462 #define UINT64_C(x)     x##ULL
    463 #else
     494#if __have_long64
    464495#define INT64_C(x)      x##L
    465496#define UINT64_C(x)     x##UL
     497#else
     498#define INT64_C(x)      x##LL
     499#define UINT64_C(x)     x##ULL
    466500#endif
    467501#endif
    468502
    469503/** Macros for greatest-width integer constant expression */
    470 #if __have_longlong64
    471 #define INTMAX_C(x)     x##LL
    472 #define UINTMAX_C(x)    x##ULL
    473 #else
     504#if __have_long64
    474505#define INTMAX_C(x)     x##L
    475506#define UINTMAX_C(x)    x##UL
     507#else
     508#define INTMAX_C(x)     x##LL
     509#define UINTMAX_C(x)    x##ULL
    476510#endif
    477511
    478512
  • newlib/libc/include/stdlib.h

    diff -Naur newlib-1.17.0.orig/newlib/libc/include/stdlib.h newlib-1.17.0-rtems4.10-20091030/newlib/libc/include/stdlib.h
    old new  
    182182int     _EXFUN(_unsetenv_r,(struct _reent *, const char *__string));
    183183#endif
    184184
     185#ifdef __rtems__
     186int _EXFUN(posix_memalign,(void **, size_t, size_t));
     187#endif
     188
    185189#endif /* ! __STRICT_ANSI__ */
    186190
    187191char *  _EXFUN(_dtoa_r,(struct _reent *, double, int, int, int *, int*, char**));
  • newlib/libc/include/sys/features.h

    diff -Naur newlib-1.17.0.orig/newlib/libc/include/sys/features.h newlib-1.17.0-rtems4.10-20091030/newlib/libc/include/sys/features.h
    old new  
    7373#define _POSIX_INTERRUPT_CONTROL                1
    7474#define _POSIX_ADVISORY_INFO                    1
    7575
     76/* UNIX98 added some new pthread mutex attributes */
     77#define _UNIX98_THREAD_MUTEX_ATTRIBUTES         1
     78
    7679#endif
    7780
    7881#ifdef __svr4__
  • newlib/libc/include/sys/signal.h

    diff -Naur newlib-1.17.0.orig/newlib/libc/include/sys/signal.h newlib-1.17.0-rtems4.10-20091030/newlib/libc/include/sys/signal.h
    old new  
    88
    99#include "_ansi.h"
    1010#include <sys/features.h>
     11#include <sys/types.h>
    1112
    1213/* #ifndef __STRICT_ANSI__*/
    1314
    14 #if defined(_POSIX_THREADS)
    15 #include <sys/types.h>   /* for pthread data types */
    16 #endif
    17 
    1815typedef unsigned long sigset_t;
    1916
    2017#if defined(__rtems__)
     
    144141#undef sigemptyset
    145142#undef sigfillset
    146143#undef sigismember
    147 /* The first argument to kill should be pid_t.  Right now
    148    <sys/types.h> always defines pid_t to be int.  If that ever
    149    changes, then we will need to do something else, perhaps along the
    150    lines of <machine/types.h>.  */
    151 int _EXFUN(kill, (int, int));
     144
     145int _EXFUN(kill, (pid_t, int));
    152146int _EXFUN(killpg, (pid_t, int));
    153147int _EXFUN(sigaction, (int, const struct sigaction *, struct sigaction *));
    154148int _EXFUN(sigaddset, (sigset_t *, const int));
  • newlib/libc/include/sys/unistd.h

    diff -Naur newlib-1.17.0.orig/newlib/libc/include/sys/unistd.h newlib-1.17.0-rtems4.10-20091030/newlib/libc/include/sys/unistd.h
    old new  
    8181int _EXFUN(getlogin_r, (char *name, size_t namesize) );
    8282#endif
    8383char    _EXFUN(*getpass, (const char *__prompt));
    84 size_t  _EXFUN(getpagesize, (void));
     84int     _EXFUN(getpagesize, (void));
    8585#if defined(__CYGWIN__)
    8686int    _EXFUN(getpeereid, (int, uid_t *, gid_t *));
    8787#endif
  • newlib/libc/machine/arm/machine/endian.h

    diff -Naur newlib-1.17.0.orig/newlib/libc/machine/arm/machine/endian.h newlib-1.17.0-rtems4.10-20091030/newlib/libc/machine/arm/machine/endian.h
    old new  
    1 /* ARM configuration file */
    2 
    3 #ifndef _MACHINE_ENDIAN_H
    4 # define _MACHINE_ENDIAN_H
    5 
    6 #ifdef __ARMEB__
    7 #define BYTE_ORDER BIG_ENDIAN
    8 #else
    9 #define BYTE_ORDER LITTLE_ENDIAN
    10 #endif
    11 
    12 #endif
  • newlib/libc/machine/lm32/configure

    diff -Naur newlib-1.17.0.orig/newlib/libc/machine/lm32/configure newlib-1.17.0-rtems4.10-20091030/newlib/libc/machine/lm32/configure
    old new  
    271271PACKAGE_STRING='newlib 1.17.0'
    272272PACKAGE_BUGREPORT=''
    273273
    274 ac_unique_file="setjmp.s"
     274ac_unique_file="setjmp.S"
    275275ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS MAY_SUPPLY_SYSCALLS_TRUE MAY_SUPPLY_SYSCALLS_FALSE newlib_basedir build build_cpu build_vendor build_os host host_cpu host_vendor host_os INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar CC DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE AS ac_ct_AS AR ac_ct_AR RANLIB ac_ct_RANLIB READELF ac_ct_READELF MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT CCAS CCASFLAGS NEWLIB_CFLAGS LDFLAGS ELIX_LEVEL_0_TRUE ELIX_LEVEL_0_FALSE ELIX_LEVEL_1_TRUE ELIX_LEVEL_1_FALSE ELIX_LEVEL_2_TRUE ELIX_LEVEL_2_FALSE ELIX_LEVEL_3_TRUE ELIX_LEVEL_3_FALSE ELIX_LEVEL_4_TRUE ELIX_LEVEL_4_FALSE USE_LIBTOOL_TRUE USE_LIBTOOL_FALSE OBJEXT oext aext lpfx libm_machine_dir machine_dir sys_dir LIBOBJS LTLIBOBJS'
    276276ac_subst_files=''
    277277
  • newlib/libc/machine/lm32/configure.in

    diff -Naur newlib-1.17.0.orig/newlib/libc/machine/lm32/configure.in newlib-1.17.0-rtems4.10-20091030/newlib/libc/machine/lm32/configure.in
    old new  
    33
    44AC_PREREQ(2.59)
    55AC_INIT([newlib],[NEWLIB_VERSION])
    6 AC_CONFIG_SRCDIR([setjmp.s])
     6AC_CONFIG_SRCDIR([setjmp.S])
    77
    88dnl Can't be done in NEWLIB_CONFIGURE because that confuses automake.
    99AC_CONFIG_AUX_DIR(../../../..)
  • newlib/libc/machine/powerpc/Makefile.am

    diff -Naur newlib-1.17.0.orig/newlib/libc/machine/powerpc/Makefile.am newlib-1.17.0-rtems4.10-20091030/newlib/libc/machine/powerpc/Makefile.am
    old new  
    1010
    1111AM_CFLAGS = -I $(srcdir)/../../stdio -I $(srcdir)/../../stdlib
    1212
    13 lib_a_SOURCES = setjmp.S times.c
     13lib_a_SOURCES = setjmp.S
    1414lib_a_CCASFLAGS=$(AM_CCASFLAGS)
    1515lib_a_CFLAGS=$(AM_CFLAGS)
    1616lib_a_LIBADD = @extra_objs@
  • newlib/libc/machine/powerpc/Makefile.in

    diff -Naur newlib-1.17.0.orig/newlib/libc/machine/powerpc/Makefile.in newlib-1.17.0-rtems4.10-20091030/newlib/libc/machine/powerpc/Makefile.in
    old new  
    3939DIST_COMMON = $(srcdir)/../../../../config.guess \
    4040        $(srcdir)/../../../../config.sub $(srcdir)/Makefile.in \
    4141        $(srcdir)/Makefile.am $(top_srcdir)/configure \
    42         $(am__configure_deps) $(srcdir)/../../../../mkinstalldirs \
    43         $(srcdir)/../../../../compile
     42        $(am__configure_deps) $(srcdir)/../../../../mkinstalldirs
    4443subdir = .
    4544ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
    4645am__aclocal_m4_deps = $(top_srcdir)/../../../acinclude.m4 \
     
    5453LIBRARIES = $(noinst_LIBRARIES)
    5554ARFLAGS = cru
    5655lib_a_AR = $(AR) $(ARFLAGS)
    57 am_lib_a_OBJECTS = lib_a-setjmp.$(OBJEXT) lib_a-times.$(OBJEXT)
     56am_lib_a_OBJECTS = lib_a-setjmp.$(OBJEXT)
    5857lib_a_OBJECTS = $(am_lib_a_OBJECTS)
    5958DEFAULT_INCLUDES = -I. -I$(srcdir)
    6059depcomp =
     
    128127USE_LIBTOOL_FALSE = @USE_LIBTOOL_FALSE@
    129128USE_LIBTOOL_TRUE = @USE_LIBTOOL_TRUE@
    130129VERSION = @VERSION@
    131 ac_ct_AR = @ac_ct_AR@
    132 ac_ct_AS = @ac_ct_AS@
    133 ac_ct_RANLIB = @ac_ct_RANLIB@
    134 ac_ct_READELF = @ac_ct_READELF@
    135 ac_ct_STRIP = @ac_ct_STRIP@
    136130aext = @aext@
    137131am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
    138132am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
     
    148142build_os = @build_os@
    149143build_vendor = @build_vendor@
    150144datadir = @datadir@
     145datarootdir = @datarootdir@
     146docdir = @docdir@
     147dvidir = @dvidir@
    151148exec_prefix = @exec_prefix@
    152149extra_objs = @extra_objs@
    153150extra_sources = @extra_sources@
     
    156153host_cpu = @host_cpu@
    157154host_os = @host_os@
    158155host_vendor = @host_vendor@
     156htmldir = @htmldir@
    159157includedir = @includedir@
    160158infodir = @infodir@
    161159install_sh = @install_sh@
    162160libdir = @libdir@
    163161libexecdir = @libexecdir@
    164162libm_machine_dir = @libm_machine_dir@
     163localedir = @localedir@
    165164localstatedir = @localstatedir@
    166165lpfx = @lpfx@
    167166machine_dir = @machine_dir@
     
    170169newlib_basedir = @newlib_basedir@
    171170oext = @oext@
    172171oldincludedir = @oldincludedir@
     172pdfdir = @pdfdir@
    173173prefix = @prefix@
    174174program_transform_name = @program_transform_name@
     175psdir = @psdir@
    175176sbindir = @sbindir@
    176177sharedstatedir = @sharedstatedir@
    177178sys_dir = @sys_dir@
     
    182183AM_CCASFLAGS = $(INCLUDES)
    183184noinst_LIBRARIES = lib.a
    184185AM_CFLAGS = -I $(srcdir)/../../stdio -I $(srcdir)/../../stdlib
    185 lib_a_SOURCES = setjmp.S times.c
     186lib_a_SOURCES = setjmp.S
    186187lib_a_CCASFLAGS = $(AM_CCASFLAGS)
    187188lib_a_CFLAGS = $(AM_CFLAGS)
    188189lib_a_LIBADD = @extra_objs@
     
    193194all: all-am
    194195
    195196.SUFFIXES:
    196 .SUFFIXES: .S .c .o .obj
     197.SUFFIXES: .S .o .obj
    197198am--refresh:
    198199        @:
    199200$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
     
    252253
    253254lib_a-setjmp.obj: setjmp.S
    254255        $(CCAS) $(lib_a_CCASFLAGS) $(CCASFLAGS) -c -o lib_a-setjmp.obj `if test -f 'setjmp.S'; then $(CYGPATH_W) 'setjmp.S'; else $(CYGPATH_W) '$(srcdir)/setjmp.S'; fi`
    255 
    256 .c.o:
    257         $(COMPILE) -c $<
    258 
    259 .c.obj:
    260         $(COMPILE) -c `$(CYGPATH_W) '$<'`
    261 
    262 lib_a-times.o: times.c
    263         $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-times.o `test -f 'times.c' || echo '$(srcdir)/'`times.c
    264 
    265 lib_a-times.obj: times.c
    266         $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-times.obj `if test -f 'times.c'; then $(CYGPATH_W) 'times.c'; else $(CYGPATH_W) '$(srcdir)/times.c'; fi`
    267256uninstall-info-am:
    268257
    269258ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
  • newlib/libc/machine/powerpc/times.c

    diff -Naur newlib-1.17.0.orig/newlib/libc/machine/powerpc/times.c newlib-1.17.0-rtems4.10-20091030/newlib/libc/machine/powerpc/times.c
    old new  
    1 /* Time support routines for PowerPC.
    2  *
    3  * Written by Aldy Hernandez.
    4  */
    5 
    6 #include <_ansi.h>
    7 #include <reent.h>
    8 #include <sys/time.h>
    9 #include <sys/times.h>
    10 #include <sys/resource.h>
    11 
    12 clock_t
    13 times (struct tms *tp)
    14 {
    15   struct rusage usage;
    16   union {
    17     struct rusage r;
    18     /* Newlib's rusage has only 2 fields.  We need to make room for
    19        when we call the system's rusage.  This should be enough.  */
    20     int filler[32];
    21   } host_ru;
    22 
    23   getrusage (RUSAGE_SELF, (void *)&host_ru);
    24 
    25   if (tp)
    26     {
    27       tp->tms_utime = host_ru.r.ru_utime.tv_sec * 1000
    28         + host_ru.r.ru_utime.tv_usec;
    29       tp->tms_stime = host_ru.r.ru_stime.tv_sec * 1000
    30         + host_ru.r.ru_stime.tv_usec;
    31       tp->tms_cutime = 0;       /* user time, children */
    32       tp->tms_cstime = 0;       /* system time, children */
    33     }
    34 
    35   return tp->tms_utime;
    36 }
  • newlib/libc/search/hcreate.c

    diff -Naur newlib-1.17.0.orig/newlib/libc/search/hcreate.c newlib-1.17.0-rtems4.10-20091030/newlib/libc/search/hcreate.c
    old new  
    4949#endif
    5050
    5151#include <sys/types.h>
    52 #include <sys/queue.h>
    5352#include <errno.h>
    5453#include <search.h>
    5554#include <stdlib.h>
  • newlib/libc/stdlib/assert.c

    diff -Naur newlib-1.17.0.orig/newlib/libc/stdlib/assert.c newlib-1.17.0-rtems4.10-20091030/newlib/libc/stdlib/assert.c
    old new  
    4747#include <stdlib.h>
    4848#include <stdio.h>
    4949
     50#ifndef HAVE_ASSERT_FUNC
    5051/* func can be NULL, in which case no function information is given.  */
    5152void
    5253_DEFUN (__assert_func, (file, line, func, failedexpr),
     
    6263  abort();
    6364  /* NOTREACHED */
    6465}
     66#endif /* HAVE_ASSERT_FUNC */
    6567
    6668void
    6769_DEFUN (__assert, (file, line, failedexpr),
  • newlib/libc/sys/rtems/crt0.c

    diff -Naur newlib-1.17.0.orig/newlib/libc/sys/rtems/crt0.c newlib-1.17.0-rtems4.10-20091030/newlib/libc/sys/rtems/crt0.c
    old new  
    1212
    1313#include <reent.h>
    1414
     15#include <signal.h> // sigset_t
     16#include <time.h> // struct timespec
     17
    1518void rtems_provides_crt0( void ) {}  /* dummy symbol so file always has one */
    1619
    17 /* RTEMS provides some of its own routines including a Malloc family */
     20#define RTEMS_STUB(ret, func) \
     21ret rtems_stub_##func {}; \
     22ret func
    1823
    19 void *malloc() { return 0; }
    20 void *realloc() { return 0; }
    21 void free() { ; }
    22 void abort() { ; }
    23 int raise() { return -1; }
     24/* RTEMS provides some of its own routines including a Malloc family */
     25RTEMS_STUB(void *,malloc(size_t s)) { return 0; }
     26RTEMS_STUB(void *,realloc(void* p, size_t s)) { return 0; }
     27RTEMS_STUB(void, free(void)) { ; }
     28RTEMS_STUB(_PTR, calloc(struct _reent *r, size_t s1, size_t s2)) {}
    2429
    2530#if defined(__GNUC__)
    2631/*
     
    4348int rtems_gxx_recursive_mutex_unlock() { return -1; }
    4449#endif
    4550
     51/* stubs for functions RTEMS provides */
     52RTEMS_STUB(int, close (int fd)) { return -1; }
     53RTEMS_STUB(int, dup2(int oldfd, int newfd)) { return -1; }
     54RTEMS_STUB(int, fcntl( int fd, int cmd, ... /* arg */ )) { return -1; }
     55RTEMS_STUB(pid_t, fork(void)) { return -1; }
     56RTEMS_STUB(int, fstat(int fd, struct stat *buf)) { return -1; }
     57RTEMS_STUB(int, getdents(int fd, void *dp, int count)) { return -1; }
     58RTEMS_STUB(char *, getlogin(void)) { return 0; }
     59RTEMS_STUB(struct passwd *, getpwnam(const char *name)) { return 0; }
     60RTEMS_STUB(struct passwd *, getpwuid(uid_t uid)) { return 0; }
     61RTEMS_STUB(uid_t, getuid(void)) { return 0; }
     62RTEMS_STUB(int, nanosleep(const struct timespec *req, struct timespec *rem)) { return -1; }
     63RTEMS_STUB(_off_t, lseek(int fd, _off_t offset, int whence)) { return -1; }
     64RTEMS_STUB(int, lstat(const char *path, struct stat *buf)) { return -1; }
     65RTEMS_STUB(int, open(const char *pathname, int flags, int mode)) { return -1; }
     66RTEMS_STUB(int, pipe(int pipefd[2])) { return -1; }
     67RTEMS_STUB(_ssize_t, read(int fd, void *buf, size_t count)) { return -1; }
     68RTEMS_STUB(int, sigfillset(sigset_t *set)) { return -1; }
     69RTEMS_STUB(int, sigprocmask(int how, const sigset_t *set, sigset_t *oldset)) { return -1; }
     70RTEMS_STUB(int, stat(const char *path, struct stat *buf)) { return -1; }
     71RTEMS_STUB(int, unlink(const char *pathname)) { return -1; }
     72RTEMS_STUB(pid_t, vfork(void)) { return -1; }
     73#if !defined(_NO_POPEN) && !defined(_NO_WORDEXP)
     74/* pulled in by libc/sys/posix/popen.c and libc/sys/posix/word*.c */
     75RTEMS_STUB(int, waitpid (pid_t pid, int *status, int options)) { return -1; }
     76#endif
     77RTEMS_STUB(_ssize_t, write (int fd, const void *buf, size_t nbytes)) { return -1; }
     78
    4679/* stubs for functions from reent.h */
    47 int _close_r (struct _reent *r, int fd) { return -1; }
    48 #if NOT_USED_BY_RTEMS
    49 int _execve_r (struct _reent *r, char *, char **, char **) { return -1; }
    50 #endif
    51 int _fcntl_r (  struct _reent *ptr, int fd, int cmd, int arg ) { return -1;}
    52 #if NOT_USED_BY_RTEMS
    53 int _fork_r (struct _reent *r) { return -1; }
    54 #endif
    55 int _fstat_r (struct _reent *r, int fd, struct stat *buf) { return -1; }
    56 int _getpid_r (struct _reent *r) { return -1; }
    57 int _kill_r ( struct _reent *r, int pid, int sig ) { return -1; }
    58 int _link_r ( struct _reent *ptr, const char *existing, const char *new) { return -1; }
    59 _off_t _lseek_r ( struct _reent *ptr, int fd, _off_t offset, int whence ) { return -1; }
    60 int _open_r (struct _reent *r, const char *buf, int flags, int mode) { return -1; }
    61 _ssize_t _read_r (struct _reent *r, int fd, void *buf, size_t nbytes) { return -1; }
    62 #if NOT_USED_BY_RTEMS
    63 void *_sbrk_r (struct _reent *r, ptrdiff_t) { return -1; }
    64 #endif
    65 int _stat_r (struct _reent *r, const char *path, struct stat *buf) { return -1; }
    66 _CLOCK_T_ _times_r (struct _reent *r, struct tms *ptms) { return -1; }
    67 int _unlink_r (struct _reent *r, const char *path) { return -1; }
    68 #if NOT_USED_BY_RTEMS
    69 int _wait_r (struct _reent *r, int *) { return -1; }
    70 #endif
    71 _ssize_t _write_r (struct _reent *r, int fd, const void *buf, size_t nbytes) { return -1; }
    72 
    73 int isatty( int fd ) { return -1; }
    74 
    75 _realloc_r() {}
    76 _calloc_r() {}
    77 _malloc_r() {}
    78 _free_r() {}
    79 
    80 /* stubs for functions required by libc/posix */
    81 int getdents(int fd, void *dp, int count) { return -1; }
    82 struct timespec;
    83 int nanosleep(const struct timespec *req, struct timespec *rem) { return -1; }
    84 int _execve(const char *path, char * const *argv, char * const *envp) { return -1; }
    85 int _exit(int status) { return -1; }
    86 
    87 /* gcc can implicitly generate references to these */
    88 /* strcmp() {} */
    89 /* strcpy() {} */
    90 /* strlen() {} */
    91 /* memcmp() {} */
    92 /* memcpy() {} */
    93 /* memset() {} */
     80RTEMS_STUB(int, _close_r (struct _reent *r, int fd)) { return -1; }
     81#if defined(_NO_EXECVE)
     82RTEMS_STUB(int, _execve_r (struct _reent *r, char *, char **, char **)) { return -1; }
     83#endif
     84RTEMS_STUB(int, _fcntl_r (struct _reent *ptr, int fd, int cmd, int arg )) { return -1; }
     85#if !(defined (REENTRANT_SYSCALLS_PROVIDED) || defined (NO_EXEC))
     86#ifndef NO_FORK
     87/* cf. newlib/libc/reent/execr.c */
     88RTEMS_STUB(int, _fork_r (struct _reent *r)) { return -1; }
     89#endif
     90#endif
     91RTEMS_STUB(int, _fstat_r (struct _reent *r, int fd, struct stat *buf)) { return -1; }
     92RTEMS_STUB(int, _getpid_r (struct _reent *r)) { return -1; }
     93RTEMS_STUB(int, _gettimeofday_r(struct _reent *r, struct timeval *tp, void *tzp)) { return 0; }
     94RTEMS_STUB(int, _isatty_r (struct _reent *r, int fd)) { return isatty( fd ); }
     95RTEMS_STUB(int, _kill_r (struct _reent *r, int pid, int sig )) { return -1; }
     96#if !defined(REENTRANT_SYSCALLS_PROVIDED)
     97/* cf. newlib/libc/reent/linkr.c */
     98RTEMS_STUB(int, _link_r (struct _reent *, const char *, const char *)) { return -1; }
     99#endif
     100RTEMS_STUB(_off_t, _lseek_r ( struct _reent *ptr, int fd, _off_t offset, int whence )) { return -1; }
     101RTEMS_STUB(int, _open_r (struct _reent *r, const char *buf, int flags, int mode)) { return -1; }
     102RTEMS_STUB(_ssize_t, _read_r (struct _reent *r, int fd, void *buf, size_t nbytes)) { return -1; }
     103RTEMS_STUB(int, _rename_r (struct _reent *r, const char *a, const char *b)){ return -1; }
     104#if !(defined (REENTRANT_SYSCALLS_PROVIDED) || defined (MALLOC_PROVIDED))
     105/* cf. newlib/libc/reent/sbrkr.c */
     106RTEMS_STUB(void *,_sbrk_r (struct _reent *r, ptrdiff_t)) { return -1; }
     107#endif
     108RTEMS_STUB(int, _stat_r (struct _reent *r, const char *path, struct stat *buf)) { return -1; }
     109RTEMS_STUB(_CLOCK_T_, _times_r (struct _reent *r, struct tms *ptms)) { return -1; }
     110RTEMS_STUB(int, _unlink_r (struct _reent *r, const char *path)) { return -1; }
     111#if !(defined (REENTRANT_SYSCALLS_PROVIDED) || defined (NO_EXEC))
     112/* cf. newlib/libc/reent/execr.c */
     113RTEMS_STUB(int, _wait_r (struct _reent *r, int *)) { return -1; }
     114#endif
     115RTEMS_STUB(_ssize_t, _write_r (struct _reent *r, int fd, const void *buf, size_t nbytes)) { return -1; }
     116
     117
     118RTEMS_STUB(int, _execve(const char *path, char * const *argv, char * const *envp)) { return -1; }
     119RTEMS_STUB(void, _exit(int status)) { while(1); }
     120
     121/* Pulled in by newlib/libc/posix/glob.c */
     122#ifndef _NO_GLOB
     123#ifndef __NETBSD_SYSCALLS
     124RTEMS_STUB(int, issetugid (void)) { return 0; }
     125#endif
     126#endif
     127
     128/* stdlib.h */
     129RTEMS_STUB(_PTR, _realloc_r(struct _reent *r, _PTR p, size_t s)) {}
     130RTEMS_STUB(_PTR, _calloc_r(struct _reent *r, size_t s1, size_t s2)) {}
     131RTEMS_STUB(_PTR, _malloc_r(struct _reent *r, size_t s)) {}
     132RTEMS_STUB(_VOID, _free_r(struct _reent *r, _PTR p)) {}
     133
     134/* stubs for functions required by libc/stdlib */
     135RTEMS_STUB(void, __assert_func(const char *file, int line, const char *failedexpr)) {}
    94136
    95137/* The PowerPC expects certain symbols to be defined in the linker script. */
    96138
  • newlib/libc/sys/rtems/machine/_types.h

    diff -Naur newlib-1.17.0.orig/newlib/libc/sys/rtems/machine/_types.h newlib-1.17.0-rtems4.10-20091030/newlib/libc/sys/rtems/machine/_types.h
    old new  
     1/*
     2 *  $Id$
     3 */
     4
     5#ifndef _MACHINE__TYPES_H
     6#define _MACHINE__TYPES_H
     7
     8/*
     9 * GCC wants type symmetry between size_t and ssize_t.
     10 * It supplies __SIZE_TYPE__, doesn't supply a corresponding __SSIZE_TYPE__,
     11 * so we have to guess on which type GCC wants ssize_t to be.
     12 * FIXME: GCC > 4.3.x supplies internal defines __SIZEOF_SIZE_T__ etc. which
     13 * could be applied here.
     14 */
     15
     16#if defined(__i386__) || defined(__m32r__) || defined(__h8300__) || defined(__arm__) || defined(__bfin__) || defined(__m68k__)
     17#if defined(__H8300__)
     18typedef signed int _ssize_t;
     19#else
     20typedef long signed int _ssize_t;
     21#endif
     22#define __ssize_t_defined 1
     23#elif defined(__AVR__) || defined(__lm32__) || defined(__m32c__) || defined(__mips__) || defined(__PPC__) || defined(__sparc__) || defined(__sh__)
     24typedef signed int _ssize_t;
     25#define __ssize_t_defined 1
     26#else
     27# error unsupported target
     28#endif
     29
     30#include <machine/_default_types.h>
     31#endif
  • newlib/libc/sys/rtems/sys/param.h

    diff -Naur newlib-1.17.0.orig/newlib/libc/sys/rtems/sys/param.h newlib-1.17.0-rtems4.10-20091030/newlib/libc/sys/rtems/sys/param.h
    old new  
    1515 * 2. Redistributions in binary form must reproduce the above copyright
    1616 *    notice, this list of conditions and the following disclaimer in the
    1717 *    documentation and/or other materials provided with the distribution.
    18  * 3. All advertising materials mentioning features or use of this software
    19  *    must display the following acknowledgement:
    20  *      This product includes software developed by the University of
    21  *      California, Berkeley and its contributors.
    2218 * 4. Neither the name of the University nor the names of its contributors
    2319 *    may be used to endorse or promote products derived from this software
    2420 *    without specific prior written permission.
     
    4743#include <sys/config.h>
    4844#include <machine/endian.h>
    4945
    50 # define HZ (60)
    5146# define PATHSIZE (1024)
    5247
    5348/* end of from newlib's <sys/param.h> */
     
    8681#define MAXHOSTNAMELEN  256             /* max hostname size */
    8782
    8883/* More types and definitions used throughout the kernel. */
    89 #ifdef KERNEL
     84#if defined(KERNEL) || defined(_KERNEL)
    9085#include <sys/cdefs.h>
    9186#include <sys/errno.h>
    9287#include <sys/time.h>
    9388#include <sys/resource.h>
    94 #include <sys/ucred.h>
    9589#include <sys/uio.h>
     90#include <sys/priority.h>
    9691
    9792#ifndef FALSE
    9893#define FALSE   0
     
    109104#include <machine/param.h>
    110105#include <machine/limits.h>
    111106
    112 /*
    113  * Priorities.  Note that with 32 run queues, differences less than 4 are
    114  * insignificant.
    115  */
    116 #define PSWP    0
    117 #define PVM     4
    118 #define PINOD   8
    119 #define PRIBIO  16
    120 #define PVFS    20
    121 #define PZERO   22              /* No longer magic, shouldn't be here.  XXX */
    122 #define PSOCK   24
    123 #define PWAIT   32
    124 #define PLOCK   36
    125 #define PPAUSE  40
    126 #define PUSER   50
    127 #define MAXPRI  127             /* Priorities range from 0 through MAXPRI. */
    128 
    129107#define PRIMASK 0x0ff
    130108#define PCATCH  0x100           /* OR'd with pri for tsleep to check signals */
    131109
     
    136114#define CMASK   022             /* default file mask: S_IWGRP|S_IWOTH */
    137115#define NODEV   (dev_t)(-1)     /* non-existent device */
    138116
    139 /*
    140  * Clustering of hardware pages on machines with ridiculously small
    141  * page sizes is done here.  The paging subsystem deals with units of
    142  * CLSIZE pte's describing PAGE_SIZE (from machine/machparam.h) pages each.
    143  */
    144 #if 0
    145 #define CLBYTES         (CLSIZE*PAGE_SIZE)
    146 #endif
    147 
    148117#define CBLOCK  128             /* Clist block size, must be a power of 2. */
    149118#define CBQSIZE (CBLOCK/NBBY)   /* Quote bytes/cblock - can do better. */
    150119                                /* Data chars/clist. */
     
    200169#define powerof2(x)     ((((x)-1)&(x))==0)
    201170
    202171/* Macros for min/max. */
    203 #ifndef KERNEL
     172#if !(defined(KERNEL) || defined(_KERNEL))
    204173#define MIN(a,b) (((a)<(b))?(a):(b))
    205174#define MAX(a,b) (((a)>(b))?(a):(b))
    206175#endif
  • newlib/libc/sys/rtems/sys/queue.h

    diff -Naur newlib-1.17.0.orig/newlib/libc/sys/rtems/sys/queue.h newlib-1.17.0-rtems4.10-20091030/newlib/libc/sys/rtems/sys/queue.h
    old new  
    1010 * 2. Redistributions in binary form must reproduce the above copyright
    1111 *    notice, this list of conditions and the following disclaimer in the
    1212 *    documentation and/or other materials provided with the distribution.
    13  * 3. All advertising materials mentioning features or use of this software
    14  *    must display the following acknowledgement:
    15  *      This product includes software developed by the University of
    16  *      California, Berkeley and its contributors.
    1713 * 4. Neither the name of the University nor the names of its contributors
    1814 *    may be used to endorse or promote products derived from this software
    1915 *    without specific prior written permission.
     
    480476        QMD_TRACE_ELEM(&(elm)->field);                                  \
    481477} while (0)
    482478
    483 
    484 /*
    485  * Circular queue definitions.
    486  */
    487 #define CIRCLEQ_HEAD(name, type)                                        \
    488 struct name {                                                           \
    489         struct type *cqh_first;         /* first element */             \
    490         struct type *cqh_last;          /* last element */              \
    491 }
    492 
    493 #define CIRCLEQ_ENTRY(type)                                             \
    494 struct {                                                                \
    495         struct type *cqe_next;          /* next element */              \
    496         struct type *cqe_prev;          /* previous element */          \
    497 }
    498 
    499 /*
    500  * Circular queue functions.
    501  */
    502 #define CIRCLEQ_INIT(head) {                                            \
    503         (head)->cqh_first = (void *)(head);                             \
    504         (head)->cqh_last = (void *)(head);                              \
    505 }
    506 
    507 #define CIRCLEQ_INSERT_AFTER(head, listelm, elm, field) {               \
    508         (elm)->field.cqe_next = (listelm)->field.cqe_next;              \
    509         (elm)->field.cqe_prev = (listelm);                              \
    510         if ((listelm)->field.cqe_next == (void *)(head))                \
    511                 (head)->cqh_last = (elm);                               \
    512         else                                                            \
    513                 (listelm)->field.cqe_next->field.cqe_prev = (elm);      \
    514         (listelm)->field.cqe_next = (elm);                              \
    515 }
    516 
    517 #define CIRCLEQ_INSERT_BEFORE(head, listelm, elm, field) {              \
    518         (elm)->field.cqe_next = (listelm);                              \
    519         (elm)->field.cqe_prev = (listelm)->field.cqe_prev;              \
    520         if ((listelm)->field.cqe_prev == (void *)(head))                \
    521                 (head)->cqh_first = (elm);                              \
    522         else                                                            \
    523                 (listelm)->field.cqe_prev->field.cqe_next = (elm);      \
    524         (listelm)->field.cqe_prev = (elm);                              \
    525 }
    526 
    527 #define CIRCLEQ_INSERT_HEAD(head, elm, field) {                         \
    528         (elm)->field.cqe_next = (head)->cqh_first;                      \
    529         (elm)->field.cqe_prev = (void *)(head);                         \
    530         if ((head)->cqh_last == (void *)(head))                         \
    531                 (head)->cqh_last = (elm);                               \
    532         else                                                            \
    533                 (head)->cqh_first->field.cqe_prev = (elm);              \
    534         (head)->cqh_first = (elm);                                      \
    535 }
    536 
    537 #define CIRCLEQ_INSERT_TAIL(head, elm, field) {                         \
    538         (elm)->field.cqe_next = (void *)(head);                         \
    539         (elm)->field.cqe_prev = (head)->cqh_last;                       \
    540         if ((head)->cqh_first == (void *)(head))                        \
    541                 (head)->cqh_first = (elm);                              \
    542         else                                                            \
    543                 (head)->cqh_last->field.cqe_next = (elm);               \
    544         (head)->cqh_last = (elm);                                       \
    545 }
    546 
    547 #define CIRCLEQ_REMOVE(head, elm, field) {                              \
    548         if ((elm)->field.cqe_next == (void *)(head))                    \
    549                 (head)->cqh_last = (elm)->field.cqe_prev;               \
    550         else                                                            \
    551                 (elm)->field.cqe_next->field.cqe_prev =                 \
    552                     (elm)->field.cqe_prev;                              \
    553         if ((elm)->field.cqe_prev == (void *)(head))                    \
    554                 (head)->cqh_first = (elm)->field.cqe_next;              \
    555         else                                                            \
    556                 (elm)->field.cqe_prev->field.cqe_next =                 \
    557                     (elm)->field.cqe_next;                              \
    558 }
    559 
    560 #ifdef KERNEL
     479#if defined(KERNEL) || defined(_KERNEL)
    561480
    562481/*
    563482 * XXX insque() and remque() are an old way of handling certain queues.
  • newlib/libc/unix/Makefile.am

    diff -Naur newlib-1.17.0.orig/newlib/libc/unix/Makefile.am newlib-1.17.0-rtems4.10-20091030/newlib/libc/unix/Makefile.am
    old new  
    1212
    1313## Distinguish different EL/IX level interfaces
    1414ELIX_2_SOURCES = \
    15         ttyname.c
     15        ttyname.c \
     16        ttyname_r.c
    1617
    1718ELIX_4_SOURCES = \
    1819        basename.c      \
  • newlib/libc/unix/Makefile.in

    diff -Naur newlib-1.17.0.orig/newlib/libc/unix/Makefile.in newlib-1.17.0-rtems4.10-20091030/newlib/libc/unix/Makefile.in
    old new  
    5959lib_a_LIBADD =
    6060am__objects_1 = lib_a-getcwd.$(OBJEXT) lib_a-pread.$(OBJEXT) \
    6161        lib_a-pwrite.$(OBJEXT) lib_a-sigset.$(OBJEXT)
    62 am__objects_2 = lib_a-ttyname.$(OBJEXT)
     62am__objects_2 = lib_a-ttyname.$(OBJEXT) lib_a-ttyname_r.$(OBJEXT)
    6363am__objects_3 = lib_a-basename.$(OBJEXT) lib_a-dirname.$(OBJEXT) \
    6464        lib_a-getlogin.$(OBJEXT) lib_a-getpass.$(OBJEXT) \
    6565        lib_a-getpwent.$(OBJEXT) lib_a-getut.$(OBJEXT)
     
    7474LTLIBRARIES = $(noinst_LTLIBRARIES)
    7575libunix_la_LIBADD =
    7676am__objects_5 = getcwd.lo pread.lo pwrite.lo sigset.lo
    77 am__objects_6 = ttyname.lo
     77am__objects_6 = ttyname.lo ttyname_r.lo
    7878am__objects_7 = basename.lo dirname.lo getlogin.lo getpass.lo \
    7979        getpwent.lo getut.lo
    8080@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@am__objects_8 = $(am__objects_6) \
     
    278278        sigset.c
    279279
    280280ELIX_2_SOURCES = \
    281         ttyname.c
     281        ttyname.c \
     282        ttyname_r.c
    282283
    283284ELIX_4_SOURCES = \
    284285        basename.c      \
     
    402403lib_a-ttyname.obj: ttyname.c
    403404        $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-ttyname.obj `if test -f 'ttyname.c'; then $(CYGPATH_W) 'ttyname.c'; else $(CYGPATH_W) '$(srcdir)/ttyname.c'; fi`
    404405
     406lib_a-ttyname_r.o: ttyname_r.c
     407        $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-ttyname_r.o `test -f 'ttyname_r.c' || echo '$(srcdir)/'`ttyname_r.c
     408
     409lib_a-ttyname_r.obj: ttyname_r.c
     410        $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-ttyname_r.obj `if test -f 'ttyname_r.c'; then $(CYGPATH_W) 'ttyname_r.c'; else $(CYGPATH_W) '$(srcdir)/ttyname_r.c'; fi`
     411
    405412lib_a-basename.o: basename.c
    406413        $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-basename.o `test -f 'basename.c' || echo '$(srcdir)/'`basename.c
    407414
  • newlib/libc/unix/ttyname.c

    diff -Naur newlib-1.17.0.orig/newlib/libc/unix/ttyname.c newlib-1.17.0-rtems4.10-20091030/newlib/libc/unix/ttyname.c
    old new  
    2828 * SUCH DAMAGE.
    2929 */
    3030
    31 #include <sys/types.h>
    32 #include <sys/stat.h>
    33 #include <fcntl.h>
     31#include "ttyname.h"
     32
    3433#include <dirent.h>
    3534#include <unistd.h>
    36 #include <string.h>
    3735#include <paths.h>
    38 #include <_syslist.h>
    3936#include <errno.h>
    4037
    41 static char ttyname_buf[sizeof (_PATH_DEV) + MAXNAMLEN] = _PATH_DEV;
    42 
    43 /*
    44  *  ttyname_r() - POSIX 1003.1b 4.7.2 - Determine Terminal Device Name
    45  */
    46 int
    47 _DEFUN( ttyname_r,(fd, name, namesize),
    48         int fd _AND
    49         char   *name _AND
    50         size_t  namesize)
    51 {
    52   struct stat sb;
    53   struct dirent *dirp;
    54   DIR *dp;
    55   struct stat dsb;
    56   char buf[sizeof(ttyname_buf)];
    57 
    58   /* Must be a terminal. */
    59   if (!isatty(fd))
    60     return ENOTTY;
    61 
    62   /* Must be a character device. */
    63   if (fstat (fd, &sb) || !S_ISCHR (sb.st_mode))
    64     return ENOTTY;
    65 
    66   if ((dp = opendir (_PATH_DEV)) == NULL)
    67     return EBADF;
    68 
    69   strcpy(buf, _PATH_DEV);
    70   while ((dirp = readdir (dp)) != NULL)
    71     {
    72       if (dirp->d_ino != sb.st_ino)
    73         continue;
    74       strcpy (buf + sizeof (_PATH_DEV) - 1, dirp->d_name);
    75       if (stat (buf, &dsb) || sb.st_dev != dsb.st_dev ||
    76           sb.st_ino != dsb.st_ino)
    77         continue;
    78       (void) closedir (dp);
    79       if(strlen(buf) < namesize)  /* < to account for terminating null */
    80         {
    81         strcpy(name, buf);
    82         return 0;
    83         }
    84       else
    85         {
    86         return ERANGE;
    87         }
    88     }
    89   (void) closedir (dp);
    90   return EBADF;
    91 }
     38static char ttyname_buf[TTYNAME_BUFSIZE] = _PATH_DEV;
    9239
    9340/*
    9441 *  ttyname() - POSIX 1003.1b 4.7.2 - Determine Terminal Device Name
  • newlib/libc/unix/ttyname.h

    diff -Naur newlib-1.17.0.orig/newlib/libc/unix/ttyname.h newlib-1.17.0-rtems4.10-20091030/newlib/libc/unix/ttyname.h
    old new  
     1/* Common defines for ttyname.c and ttyname_r.c */
     2 
     3#include <dirent.h>     /* For MAXNAMLEN */
     4#include <paths.h>      /* For _PATH_DEV */
     5
     6#define TTYNAME_BUFSIZE (sizeof (_PATH_DEV) + MAXNAMLEN)
  • newlib/libc/unix/ttyname_r.c

    diff -Naur newlib-1.17.0.orig/newlib/libc/unix/ttyname_r.c newlib-1.17.0-rtems4.10-20091030/newlib/libc/unix/ttyname_r.c
    old new  
     1#ifndef _NO_TTYNAME
     2/*
     3 * Copyright (c) 1988 The Regents of the University of California.
     4 * All rights reserved.
     5 *
     6 * Redistribution and use in source and binary forms, with or without
     7 * modification, are permitted provided that the following conditions
     8 * are met:
     9 * 1. Redistributions of source code must retain the above copyright
     10 *    notice, this list of conditions and the following disclaimer.
     11 * 2. Redistributions in binary form must reproduce the above copyright
     12 *    notice, this list of conditions and the following disclaimer in the
     13 *    documentation and/or other materials provided with the distribution.
     14 * 4. Neither the name of the University nor the names of its contributors
     15 *    may be used to endorse or promote products derived from this software
     16 *    without specific prior written permission.
     17 *
     18 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
     19 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     20 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     21 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
     22 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     23 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     24 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     25 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     26 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     27 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     28 * SUCH DAMAGE.
     29 */
     30
     31#include "ttyname.h"
     32
     33#include <sys/types.h>
     34#include <sys/stat.h>
     35#include <fcntl.h>
     36#include <dirent.h>
     37#include <unistd.h>
     38#include <string.h>
     39#include <paths.h>
     40#include <_syslist.h>
     41#include <errno.h>
     42
     43/*
     44 *  ttyname_r() - POSIX 1003.1b 4.7.2 - Determine Terminal Device Name
     45 */
     46int
     47_DEFUN( ttyname_r,(fd, name, namesize),
     48        int fd _AND
     49        char   *name _AND
     50        size_t  namesize)
     51{
     52  struct stat sb;
     53  struct dirent *dirp;
     54  DIR *dp;
     55  struct stat dsb;
     56  char buf[TTYNAME_BUFSIZE];
     57
     58  /* Must be a terminal. */
     59  if (!isatty(fd))
     60    return ENOTTY;
     61
     62  /* Must be a character device. */
     63  if (fstat (fd, &sb) || !S_ISCHR (sb.st_mode))
     64    return ENOTTY;
     65
     66  if ((dp = opendir (_PATH_DEV)) == NULL)
     67    return EBADF;
     68
     69  strcpy(buf, _PATH_DEV);
     70  while ((dirp = readdir (dp)) != NULL)
     71    {
     72      if (dirp->d_ino != sb.st_ino)
     73        continue;
     74      strcpy (buf + sizeof (_PATH_DEV) - 1, dirp->d_name);
     75      if (stat (buf, &dsb) || sb.st_dev != dsb.st_dev ||
     76          sb.st_ino != dsb.st_ino)
     77        continue;
     78      (void) closedir (dp);
     79      if(strlen(buf) < namesize)  /* < to account for terminating null */
     80        {
     81        strcpy(name, buf);
     82        return 0;
     83        }
     84      else
     85        {
     86        return ERANGE;
     87        }
     88    }
     89  (void) closedir (dp);
     90  return EBADF;
     91}
     92
     93#endif /* !_NO_TTYNAME  */
  • newlib/Makefile.am

    diff -Naur newlib-1.17.0.orig/newlib/Makefile.am newlib-1.17.0-rtems4.10-20091030/newlib/Makefile.am
    old new  
    8181        libc.a
    8282endif
    8383
    84 noinst_DATA = stmp-targ-include
     84BUILT_SOURCES = stmp-targ-include
    8585
    8686toollib_DATA = $(CRT0) $(CRT1)
    8787
     
    186186
    187187$(CRT1_DIR)$(CRT1): ; @true
    188188
    189 
    190 all-recursive: stmp-targ-include
    191 
    192189# The targ-include directory just holds the includes files for the
    193190# particular system and machine we have been configured for.  It is
    194191# used while building.
  • newlib/Makefile.in

    diff -Naur newlib-1.17.0.orig/newlib/Makefile.in newlib-1.17.0-rtems4.10-20091030/newlib/Makefile.in
    old new  
    106106        pdf-recursive ps-recursive uninstall-info-recursive \
    107107        uninstall-recursive
    108108toollibDATA_INSTALL = $(INSTALL_DATA)
    109 DATA = $(noinst_DATA) $(toollib_DATA)
     109DATA = $(toollib_DATA)
    110110ETAGS = etags
    111111CTAGS = ctags
    112112DEJATOOL = $(PACKAGE)
     
    350350@USE_LIBTOOL_FALSE@toollib_LIBRARIES = libm.a \
    351351@USE_LIBTOOL_FALSE@     libc.a
    352352
    353 noinst_DATA = stmp-targ-include
     353BUILT_SOURCES = stmp-targ-include
    354354toollib_DATA = $(CRT0) $(CRT1)
    355355
    356356# The functions ldexp, frexp and modf are traditionally supplied in
     
    409409
    410410# dejagnu support
    411411RUNTESTFLAGS =
    412 all: newlib.h
     412all: $(BUILT_SOURCES) newlib.h
    413413        $(MAKE) $(AM_MAKEFLAGS) all-recursive
    414414
    415415.SUFFIXES:
     
    714714        done
    715715check-am:
    716716        $(MAKE) $(AM_MAKEFLAGS) check-DEJAGNU
    717 check: check-recursive
     717check: $(BUILT_SOURCES)
     718        $(MAKE) $(AM_MAKEFLAGS) check-recursive
    718719all-am: Makefile $(LIBRARIES) $(LTLIBRARIES) $(DATA) newlib.h
    719720installdirs: installdirs-recursive
    720721installdirs-am:
    721722        for dir in "$(DESTDIR)$(toollibdir)" "$(DESTDIR)$(toollibdir)" "$(DESTDIR)$(toollibdir)"; do \
    722723          test -z "$$dir" || $(mkdir_p) "$$dir"; \
    723724        done
    724 install: install-recursive
     725install: $(BUILT_SOURCES)
     726        $(MAKE) $(AM_MAKEFLAGS) install-recursive
    725727install-exec: install-exec-recursive
    726728install-data: install-data-recursive
    727729uninstall: uninstall-recursive
     
    746748maintainer-clean-generic:
    747749        @echo "This command is intended for maintainers to use"
    748750        @echo "it deletes files that may require special tools to rebuild."
     751        -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
    749752clean: clean-recursive
    750753
    751754clean-am: clean-generic clean-libtool clean-toollibLIBRARIES \
     
    864867
    865868$(CRT1_DIR)$(CRT1): ; @true
    866869
    867 all-recursive: stmp-targ-include
    868 
    869870# The targ-include directory just holds the includes files for the
    870871# particular system and machine we have been configured for.  It is
    871872# used while building.
Note: See TracBrowser for help on using the repository browser.