source: rtems-source-builder/patches/newlib-1.18.0-rtems4.10-20110518.diff @ 4fe2192

4.104.114.95
Last change on this file since 4fe2192 was 4fe2192, checked in by Chris Johns <chrisj@…>, on Nov 5, 2012 at 12:29:00 PM

Initial import.

  • Property mode set to 100644
File size: 102.6 KB
  • newlib/ChangeLog

    diff -Naur newlib-1.18.0.orig/newlib/ChangeLog newlib-1.18.0-rtems4.10-20110518/newlib/ChangeLog
    old new  
     12011-05-18  Ralf Corsépius <ralf.corsepius@rtems.org>
     2
     3        * libc/include/time.h: Add bugward-compatibile
     4        CLOCK_THREAD_CPUTIME, CLOCK_PROCESS_CPUTIME.
     5
     62011-05-16  Yaakov Selkowitz  <yselkowitz@users.sourceforge.net>
     7
     8        * libc/include/time.h (CLOCK_PROCESS_CPUTIME_ID): Rename from
     9        CLOCK_PROCESS_CPUTIME.
     10        (CLOCK_THREAD_CPUTIME_ID): Rename from CLOCK_THREAD_CPUTIME.
     11
     122011-05-16  Christian Bruel  <christian.bruel@st.com>
     13
     14        * libc/stdlib/strtod.c (_strtod_r): Fix nf/nd counts to not exceed
     15        DBL_DIG.
     16
     172011-04-19  Ralf Corsépius <ralf.corsepius@rtems.org>
     18
     19        * libc/include/stdint.h: Rework SIZE_MAX.
     20        * libc/sys/rtems/include/limits.h: Rework SSIZE_MAX.
     21
     222011-01-31      Ralf Corsépius  <ralf.corsepius@rtems.org>
     23
     24        * libc/sys/rtems/crt0.c: Add clock_gettime, gettimeofday,
     25        sched_yield.
     26
     272011-01-12  Ralf Corsépius  <ralf.corsepius@rtems.org>
     28
     29        * libm/math/w_tgamma.c: Only build ifndef _DOUBLE_IS_32BITS.
     30        * libm/math/wf_tgamma.c: Map tgamma to tgammaf, ifdef _DOUBLE_IS_32BITS.
     31
     322011-01-07  Ralf Corsépius  <ralf.corsepius@rtems.org>
     33
     34        * libc/sys/rtems/crt0.c: Adjust free() and calloc() to match their
     35        public decls.
     36
    1372009-12-17  Jeff Johnston  <jjohnstn@redhat.com>
    238
    339        * NEWS: Update with 1.18.0 info.
     
    4177        * libc/stdlib/atexit.c: Ditto.
    4278        * libc/stdlib/on_exit.c: Ditto.
    4379
    44 2009-12-17  Ralf Corsépius <ralf.corsepius@rtems.org>
     802009-12-17  Ralf Corsépius <ralf.corsepius@rtems.org>
    4581
    4682        * libc/include/machine/ieeefp.h: Rework __IEEE_*_ENDIAN handling.
    47         * libc/machine/arm/machine/endian.h: Remove (Conflicts with 
     83        * libc/machine/arm/machine/endian.h: Remove (Conflicts with
    4884        libc/include/machine/endian.h)
    4985
    50 2009-12-17  Ralf Corsépius <ralf.corsepius@rtems.org>
     862009-12-17  Ralf Corsépius <ralf.corsepius@rtems.org>
    5187
    5288        * libc/include/machine/setjmp.h: Set up _JBLEN #ifdef __m68k__.
    5389
    54 2009-12-17  Ralf Corsepius <ralf.corsepius@rtems.org>
     902009-12-17  Ralf Corsépius <ralf.corsepius@rtems.org>
    5591
    56         * libc/include/pthread.h: Add pthread_atfork, pthread_rwlock_unlock 
     92        * libc/include/pthread.h: Add pthread_atfork, pthread_rwlock_unlock
    5793        * libc/include/sys/stat.h: Use struct timespec st_*tim,
    5894        blksize_t st_blksize, blkcnt_t st_blocks.
    5995        Add st_*time compatibility macros.
     
    69105        and ETOOMANYREFS into general list as they are referenced
    70106        by OpenGroup and needed by RTEMS.
    71107
    72 2009-12-16  Ralf Corsépius <ralf.corsepius@rtems.org>
     1082009-12-16  Ralf Corsépius <ralf.corsepius@rtems.org>
    73109
    74110        * libc/search/hcreate.c: Don't include <sys/queue.h> (Unused).
    75111
    76 2009-12-16  Ralf Corsépius <ralf.corsepius@rtems.org>
     1122009-12-16  Ralf Corsépius <ralf.corsepius@rtems.org>
    77113
    78         * libc/sys/rtems/machine/_types.h: New (Derived from 
     114        * libc/sys/rtems/machine/_types.h: New (Derived from
    79115        machine/_default_types.h).
    80         * libc/sys/rtems/crt0.c: Rework. Introduce macro RTEMS_STUB.
     116        * libc/sys/rtems/crt0.c: Rework. Introduce macro RTEMS_STUB.
    81117        * libc/sys/rtems/sys/param.h:
    82         Update copyright notice from FreeBSD.
    83         Remove HZ.
    84         Add #include <sys/priority.h>
    85         Remove priority handling (moved to sys/priority.h).
    86         Remove CLBYTES (Unused, abandoned in BSD).
     118        Update copyright notice from FreeBSD.
     119        Remove HZ.
     120        Add #include <sys/priority.h>
     121        Remove priority handling (moved to sys/priority.h).
     122        Remove CLBYTES (Unused, abandoned in BSD).
    87123        * libc/sys/rtems/sys/queue.h: Update copyright (from FreeBSD).
    88         Remove CIRCLEQ_*.
     124        Remove CIRCLEQ_*.
    89125
    901262009-12-15  Conny Marco Menebrocker  <c-m-m@gmx.de>
    91127
     
    16661702
    16671703        * libc/machine/arm/strcpy.c: Add missing comma.
    16681704
    1669 2009-02-26  Ralf Corsepius  <ralf.corsepius@rtems.org>
     17052009-02-26  Ralf Corsépius  <ralf.corsepius@rtems.org>
    16701706
    16711707        * libc/machine/lm32/configure.in: Let
    16721708        AC_CONFIG_SRCDIR point to setjmp.S instead of setjmp.s
     
    18521888        * libc/string/wcstrings.tex: Ditto.
    18531889        * libc/string/Makefile.in: Regenerated.
    18541890
    1855 2008-12-12  Ralf Corsepius  <ralf.corsepius@rtems.org>
     18912008-12-12  Ralf Corsépius  <ralf.corsepius@rtems.org>
    18561892
    18571893        * libc/stdio/fputws.c: Fix documentation.
    18581894        * libc/stdio/getwchar.c: Ditto.
    18591895        * libc/stdio/putwchar.c: Ditto.
    18601896
    1861 2008-12-12  Ralf Corsepius  <ralf.corsepius@rtems.org>
     18972008-12-12  Ralf Corsépius  <ralf.corsepius@rtems.org>
    18621898
    18631899        * libc/include/sys/features.h: Set RTEMS's _POSIX_MONOTONIC_CLOCK to
    18641900        200112L (SUSv3 compliance).
    18651901        Comment out RTEMS's _POSIX_SHARED_MEMORY_OBJECTS (Unsupported).
    18661902
    1867 2008-12-12  Ralf Corsepius  <ralf.corsepius@rtems.org>
     19032008-12-12  Ralf Corsépius  <ralf.corsepius@rtems.org>
    18681904
    18691905        * libc/sys/rtems/crt0.c: Add stubs for getdents(), nanosleep(),
    18701906        _execve(), _exit().
    18711907
    1872 2008-12-12  Ralf Corsepius  <ralf.corsepius@rtems.org>
     19082008-12-12  Ralf Corsépius  <ralf.corsepius@rtems.org>
    18731909
    18741910        * configure.host: Let *rtems* default to c99-formats.
    18751911
     
    20192055        <linux/dirent.h>.
    20202056        * libc/sys/linux/io64.c: Add weak alias for _stat64.
    20212057
    2022 2008-11-27  Ralf Corsepius <ralf.corsepius@rtems.org>
     20582008-11-27  Ralf Corsépius <ralf.corsepius@rtems.org>
    20232059
    20242060        * libc/posix/telldir.c: Use #if !defined() instead of #ifndef
    20252061        to fix GCC warning.
     
    21912227        * libc/unix/collate.c (__collate_err): simplify to remove unnecessary
    21922228        strdup() and strlen() calls, also getting rid of a compiler warning.
    21932229
    2194 2008-11-19  Ralf Corsepius <ralf.corsepius@rtems.org>
     22302008-11-19  Ralf Corsépius <ralf.corsepius@rtems.org>
    21952231
    21962232        * libc/include/sys/config.h: Don't put
    21972233        __ATTRIBUTE_IMPURE_PTR__ into .sdata section for mips-rtems.
    21982234
    2199 2008-11-19  Ralf Corsepius  <ralf.corsepius@rtems.org>
     22352008-11-19  Ralf Corsépius  <ralf.corsepius@rtems.org>
    22002236
    22012237        * libc/posix/runetype.h: Add include of stddef.h and remove
    22022238        defining standard types: size_t and wchar_t.
    22032239
    2204 2008-11-19  Ralf Corsepius  <ralf.corsepius@rtems.org>
     22402008-11-19  Ralf Corsépius  <ralf.corsepius@rtems.org>
    22052241
    22062242        * libc/include/pthread.h: Remove prototypes for
    22072243        pthread_attr_getcputime and pthread_attr_setcputime which
     
    42564292        * libc/machine/spu/sprintf.c: Ditto.
    42574293        * libc/machine/spu/sscanf.c: Ditto.
    42584294
    4259 2007-08-03  Ralf Corsepius  <ralf.corsepius@rtems.org>
     42952007-08-03  Ralf Corsépius  <ralf.corsepius@rtems.org>
    42604296
    42614297        * libc/include/tar.h: New.
    42624298
     
    62416277        * libc/include/sys/signal.h (sigdelset, sigfillset, sigismember): New macros.
    62426278        (sigaddset, sigemptyset): Add return code.
    62436279
    6244 2006-04-13  Ralf Corsepius  <ralf.corsepius@rtems.org>
     62802006-04-13  Ralf Corsépius  <ralf.corsepius@rtems.org>
    62456281
    62466282        * acinclude.m4: New _NEWLIB_VERSION.
    62476283        * acinclude.m4(NEWLIB_CONFIGURE): AC_REQUIRE(_NEWLIB_VERSION).
     
    67306766        * libc/sys/linux/sys/stat.h: Change *stat64 prototypes to
    67316767        take a pointer to struct stat64 rather than struct stat.
    67326768
    6733 2005-12-16  Ralf Corsepius <ralf.corsepius@rtems.org>
     67692005-12-16  Ralf Corsépius <ralf.corsepius@rtems.org>
    67346770
    67356771        * libc/include/stdint.h: Prefer long over int for int32_t.
    67366772        Use __have_long32 to set up int32_t.
     
    67596795        * libc/include/sys/types.h: Remove the ifdef armour around
    67606796        standard POSIX types.
    67616797
    6762 2005-12-06  Ralf Corsepius <ralf.corsepius@rtems.org>
     67982005-12-06  Ralf Corsépius <ralf.corsepius@rtems.org>
    67636799
    67646800        * libc/sys/rtems/crt0.c: Add rtems_gxx_key_create,
    67656801        rtems_gxx_key_delete, rtems_gxx_getspecific,
     
    68386874        * libc/sys/linux/sys/unistd.h (readlink, symlink): New
    68396875        prototypes.
    68406876
    6841 2005-11-01  Ralf Corsepius <ralf.corsepius@rtems.org>
     68772005-11-01  Ralf Corsépius <ralf.corsepius@rtems.org>
    68426878
    68436879        * libc/include/stdint.h: Cleanup #if vs. #ifdef.
    68446880
     
    70627098        * libc/stdlib/mallocr.c (mALLOc, rEALLOCc, mEMALIGn): Set errno
    70637099        to ENOMEM on failure.
    70647100
    7065 2005-10-06  Ralf Corsepius <ralf.corsepius@rtems.org>
     71012005-10-06  Ralf Corsépius <ralf.corsepius@rtems.org>
    70667102
    70677103        * libc/include/stdint.h: Add [u]int_fast<N>_t types.
    70687104
    7069 2005-10-04  Ralf Corsepius <ralf.corsepius@rtems.org>
     71052005-10-04  Ralf Corsépius <ralf.corsepius@rtems.org>
    70707106
    70717107        * libc/include/stdint.h: Move magic to set __have_long* to the
    70727108        beginning.  Use #if __have* instead of #if defined(__have*).
     
    70827118        * libc/sys/linux/include/stdint.h: Include <sys/types.h> and
    70837119        incorporate Ralf's change below.
    70847120
    7085 2005-10-03  Ralf Corsepius <ralf.corsepius@rtems.org>
     71212005-10-03  Ralf Corsépius <ralf.corsepius@rtems.org>
    70867122
    70877123        * libc/include/stdint.h:
    70887124        Use __INTMAX_TYPE__ to derive intmax_t.
    70897125        Use __UINTMAX_TYPE__ to derive uintmax_t.
    70907126        Fix minor typo.
    70917127
    7092 2005-09-27  Ralf Corsepius <ralf.corsepius@rtems.org>
     71282005-09-27  Ralf Corsépius <ralf.corsepius@rtems.org>
    70937129
    70947130        * libc/include/stdint.h: Correct __STDINT_EXP macro incorrectly
    70957131        handling GCC >= 4.
     
    74257461        * configure.host (newlib_cflags) <cris-*-*, crisv32-*-*>: Add
    74267462        -DCOMPACT_CTYPE.
    74277463
    7428 2005-03-06  Ralf Corsepious  <ralf.corsepius@rtems.org>
     74642005-03-06  Ralf Corsépius  <ralf.corsepius@rtems.org>
    74297465
    74307466        * libc/sys/rtems/include/inttypes.h: New file.
    74317467        * libc/sys/rtems/include/stdint.h: Ditto.
    74327468
    7433 2005-03-06  Ralf Corsepious  <ralf.corsepius@rtems.org>
     74692005-03-06  Ralf Corsépius  <ralf.corsepius@rtems.org>
    74347470
    74357471        * libc/string/memcmp.c: Fix to avoid pointer signedness warning.
    74367472
    7437 2005-03-06  Ralf Corsepious  <ralf.corsepius@rtems.org>
     74732005-03-06  Ralf Corsépius  <ralf.corsepius@rtems.org>
    74387474
    74397475        * libc/include/machine/_types.h: New file.
    74407476        * libc/include/sys/types.h: Do not check for __rtems__
     
    74437479        * libc/sys/rtems/machine/_types.h: Removed.  Replaced with
    74447480        shared header file.
    74457481
    7446 2005-02-25  Ralf Corsepious  <ralf.corsepius@rtems.org>
     74822005-02-25  Ralf Corsépius  <ralf.corsepius@rtems.org>
    74477483
    74487484        * libm/common/fdlibm.h (FLT_UWORD_MAX, FLT_UWORD_HALF_MAX): Add
    74497485        L qualifier for these long constants.
     
    74597495        * libc/time/strftime.c (strftime): Fix '%x' to deal with negative
    74607496        years.  Fix '%z' to use long, not int.
    74617497
    7462 2005-02-24  Ralf Corsepious  <ralf.corsepius@rtems.org>
     74982005-02-24  Ralf Corsépius  <ralf.corsepius@rtems.org>
    74637499
    74647500        * libm/common/s_fpclassify.c: Use __uint32_t instead of int to
    74657501        manipulate float values in integer form.
    74667502        * libm/common/sf_round.c: Ditto.
    74677503
    7468 2005-02-24  Ralf Corsepious  <ralf.corsepius@rtems.org>
     75042005-02-24  Ralf Corsépius  <ralf.corsepius@rtems.org>
    74697505
    74707506        * libc/include/sys/types.h [__rtems__]: Include new
    74717507        header file machine/_types.h.
     
    78297865        * libc/stdio/fread.c (fread): Fix return value for unbuffered
    78307866        fread.
    78317867
    7832 2004-10-25  Ralf Corsepius <corsepiu@faw.uni-ulm.de>
     78682004-10-25  Ralf Corsépius <corsepiu@faw.uni-ulm.de>
    78337869
    78347870        * libc/include/machine/setjmp.h: Add AVR support.
    78357871        * libc/sys/rtems/crt0.S [__AVR__]: Add __stack.
     
    1406114097
    1406214098        * libc/include/sys/unistd.h: Prototype chroot() for RTEMS.
    1406314099
    14064 2001-08-29  Ralf Corsepius <corsepiu@faw.uni-ulm.de>
     141002001-08-29  Ralf Corsépius <corsepiu@faw.uni-ulm.de>
    1406514101
    1406614102        * libc/machine/i386/f_atan2.S, libc/machine/i386/f_atan2f.S,
    1406714103          libc/machine/i386/f_exp.c, libc/machine/i386/f_expf.c,
     
    1473814774        * libc/sys/linux/sys/utsname.h: Ditto.
    1473914775        * libc/sys/linux/sys/wait.h: Ditto.
    1474014776
    14741 2000-12-08  Ralf Corsepius <corsepiu@faw.uni-ulm.de>
     147772000-12-08  Ralf Corsépius <corsepiu@faw.uni-ulm.de>
    1474214778
    1474314779        * Makefile.am: $(INSTALL), $(INSTALL_DATA), and $(INSTALL_PROGRAM)
    1474414780        can be a relative path to $(top_srcdir)/install.sh so ensure the
     
    1564315679        * libc/include/stdlib.h: add ptsname, grantpt, unlockpt to cygwin
    1564415680        section
    1564515681
    15646 Sat Oct  2 02:02:00 MEST 1999  Ralf Corsepius <corsepiu@faw.uni-ulm.de>
     15682Sat Oct  2 02:02:00 MEST 1999  Ralf Corsépius <corsepiu@faw.uni-ulm.de>
    1564715683
    1564815684        * libc/machine/sh/asm.h: Added __SH4_SINGLE__ to DELAYED_BRANCHES
    1564915685        * libc/machine/sh/memcpy.S: Fix line wrapping in SL macro
  • newlib/ChangeLog.rtems

    diff -Naur newlib-1.18.0.orig/newlib/ChangeLog.rtems newlib-1.18.0-rtems4.10-20110518/newlib/ChangeLog.rtems
    old new  
     12011-01-14      Ralf Corsépius  <ralf.corsepius@rtems.org>
     2
     3        * libm/common/s_ilogb.c, libm/common/s_llround.c,
     4        libm/common/s_log2.c, libm/common/s_lrint.c,
     5        libm/common/s_lround.c, libm/common/s_rint.c,
     6        libm/common/sf_ilogb.c, libm/common/sf_log2.c,
     7        libm/common/sf_rint.c: Import from newlib-cvs.
     8
     92011-01-14      Ralf Corsépius  <ralf.corsepius@rtems.org>
     10
     11        * libm/common/fdlibm.h:
     12        Add SAFE_LEFT_SHIFT, SAFE_RIGHT_SHIFT from newlib-cvs.
     13
     142011-01-07      Ralf Corsépius  <ralf.corsepius@rtems.org>
     15
     16        * libc/stdio/open_memstream.c: Replace 64 * 1024 with 0x10000 to
     17        avoid integer overflow on h8300.
     18
     192011-01-05      Ralf Corsépius  <ralf.corsepius@rtems.org>
     20
     21        * libm/common/s_llrint.c: Back-port from newlib-cvs.
     22
     232011-01-05      Ralf Corsépius  <ralf.corsepius@rtems.org>
     24
     25        * libc/stdio/tmpnam.c: Include <stdint.h>.
     26        Use intptr_t instead of _POINTER_INT for improved portability.
     27        * libc/misc/__dprintf.c: Include <stdint.h>
     28        Use intptr_t instead of _POINTER_INT for improved portability.
     29
     302011-01-05      Ralf Corsépius  <ralf.corsepius@rtems.org>
     31
     32        * libm/common/s_round.c: Cast const int to __int32_t.
     33
     342011-01-04      Ralf Corsépius  <ralf.corsepius@rtems.org>
     35
     36        * doc/makedoc.c: Add cludge to make makedoc 64bit compliant.
     37
     382011-01-04      Ralf Corsépius  <ralf.corsepius@rtems.org>
     39
     40        * libm/math/e_scalb.c: Include <limits.h>.
     41        Don't rely on 65000 being a valid int.
     42
     432011-01-04      Ralf Corsépius  <ralf.corsepius@rtems.org>
     44
     45        * libc/posix/readdir.c: Include <stdint.h>.
     46        Cast to intptr_t instead of int.
     47
     482011-01-04      Ralf Corsépius  <ralf.corsepius@rtems.org>
     49
     50        * libc/string/memccpy.c, libc/string/memchr.c,
     51        libc/string/memcmp.c, libc/string/memcpy.c,
     52        libc/string/memmove.c, libc/string/mempcpy.c,
     53        libc/string/memset.c, libc/string/stpcpy.c,
     54        libc/string/stpncpy.c, libc/string/strcpy.c,
     55        libc/string/strlen.c, libc/string/strncat.c,
     56        libc/string/strncpy.c (UNALIGNED):
     57        Include <stdint.h>.
     58        Cast to intptr_t instead of long.
     59
     602011-01-04      Ralf Corsépius  <ralf.corsepius@rtems.org>
     61
     62        * libc/stdio/open_memstream.c (internal_open_memstream_r):
     63        Don't limit c->max to 64*1024 on targets with SIZE_MAX < 64*1024.
     64
     652010-10-05  Eric Blake  <eblake@redhat.com>
     66
     67        memmem, strstr, strcasestr: fix bug with long periodic needle
     68        * lib/str-two-way.h (two_way_long_needle): Avoid bug with long
     69        periodic needle having false positive.
     70
     712010-08-24  Sebastian Huber <sebastian.huber@embedded-brains.de>
     72
     73        * libc/posix/opendir.c: Added missing memory free.
     74
     752010-08-10      Ralf Corsépius <ralf.corsepius@rtems.org>
     76
     77        PR 1475/newlib:
     78        * libc/include/stdint.h: Fall back to compute SIZE_MAX based on
     79        __SIZEOF_SIZE_T__ and __CHAR_BIT__ if available.
     80
     812010-08-04      Ralf Corsépius <ralf.corsepius@rtems.org>
     82
     83        * libc/string/strcat.c:
     84        Include <stdint.h>. Use uintptr_t instead of long in ALIGNED.
     85        * libc/string/strchr.c, libc/string/strcmp.c, libc/string/strncmp.c:
     86        Include <stdint.h>. Use uintptr_t instead of long in UNALIGNED.
     87        * libc/include/sys/unistd.h: Activate decls for
     88        getsid, setegid, seteuid.
     89
     902010-07-08      Ralf Corsépius <ralf.corsepius@rtems.org>
     91
     92        * configure.host: Add -D_COMPILING_NEWLIB to newlib_cflags.
     93        * libc/string/index.c, libc/string/rindex.c: Include <string.h>.
     94        * libc/stdlib/putenv_r.c: Include <strings.h>
     95
     962010-07-06  Corinna Vinschen  <corinna@vinschen.de>
     97
     98        * libc/posix/rewinddir.c (rewinddir): Remove incorrect cast to off_t.
     99        * libc/sys/rtems/sys/dirent.h (_seekdir): Add prototype.
     100
     1012010-06-17      Ralf Corsépius <ralf.corsepius@rtems.org>
     102
     103        * libc/sys/rtems/machine/_types.h: Special case for sparc64.
     104
     1052010-04-23      Ralf Corsépius <ralf.corsepius@rtems.org>
     106
     107        * libc/sys/rtems/machine/_types.h: Add _mode_t.
     108        * libc/include/sys/types.h: Derive mode_t from  _mode_t.
     109
     1102010-04-02      Ralf Corsépius <ralf.corsepius@rtems.org>
     111
     112        * libc/include/sched.h, libc/include/sys/sched.h:
     113        Adopt newlib-cvs's versions.
     114
     1152010-03-25      Ralf Corsépius <ralf.corsepius@rtems.org>
     116
     117        * libc/include/strings.h: New (split-out from string.h).
     118        * libc/include/string.h: Remove bcmp, bcopy, bzero, ffs, index, rindex,
     119        strcasecmp, strncasecmp (Moved to strings.h).
     120        Remove strcmpi, stricmp, strncmpi, strnicmp.
     121        * libc/misc/ffs.c: Use <strings.h> instead of <string.h>.
     122        * libc/string/bcmp.c: Use <strings.h> instead of <string.h>.
     123        * libc/string/bzero.c: Use <strings.h> instead of <string.h>.
     124        * libc/string/rindex.c: Use <strings.h> instead of <string.h>.
     125        * libc/string/strcasecmp.c: Use <strings.h> instead of <string.h>.
     126        * libc/string/strcasecmp.c: Use <strings.h> instead of <string.h>.
     127
     1282010-03-23      Ralf Corsépius <ralf.corsepius@rtems.org>
     129
     130        * libc/sys/rtems/machine/_types.h: Add i386 to 64bit off_t targets.
     131
     1322010-03-10      Ralf Corsépius <ralf.corsepius@rtems.org>
     133
     134        * libc/posix/telldir.c: Adopt newlib-cvs's telldir.c
     135
     1362010-02-10      Ralf Corsépius <ralf.corsepius@rtems.org>
     137
     138        * libc/sys/rtems/machine/_types.h: Use __int64_t for _off_t, fpos_t for
     139        selected targets.
     140
     1412010-02-05      Ralf Corsépius <ralf.corsepius@rtems.org>
     142
     143        * libc/posix/telldir.c: Remove bogus nested prototype of lseek().
     144
     1452010-01-11  Sebastian Huber <sebastian.huber@embedded-brains.de>
     146
     147        * libc/posix/telldir.c (_cleanupdir): Fixed usage of freed memory.
     148
     1492009-12-18      Ralf Corsépius <ralf.corsepius@rtems.org>
     150
     151        * libc/search/db_local.h:
     152        Use __uint32_t instead of u_int (prototype mismatches).
     153        * libc/search/extern.h (__buf_init):
     154        Use __uint32_t instead of int (16 bit target portability).
     155        * libc/search/hash_buf.c: Use ptrdiff_t instead of __uint32_t,
     156        use __uint32_t instead of int (16 bit target portability).
     157        * libc/search/hash.h: Use __uint32_it instead of int
     158        (16 bit target portability).
     159        * libm/common/modfl.c: Add cast to (double*) to avoid GCC warning.
     160        * libm/common/sf_llrint.c, libm/common/sf_round.c: Add explicit
     161        casts to __uint32_t to avoid overflows on implicit casts.
     162
     1632009-12-18      Ralf Corsépius <ralf.corsepius@rtems.org>
     164
     165        Merger with newlib-1.18.0.
     166
     1672009-10-29      Ralf Corsépius <ralf.corsepius@rtems.org>
     168
     169        * libc/sys/rtems/machine/_types.h: Rework.
     170        * libc/sys/rtems/machine/stdint.h: Remove.
     171        * libc/include/inttypes.h:
     172        Rework logic to determine PRI*PTR.
     173        Prefer long64 over longlong64.
     174        * libc/include/machine/_default_types.h:
     175        Sync logic for __int32 with stdint.h (Prefer long over int).
     176        * libc/include/stdint.h:
     177        Remove __SPU__ hack.
     178        Prefer int for int16_t (sync with _default_types.h).
     179        Rework intptr_t determination.
     180
     1812009-10-28      Ralf Corsépius <ralf.corsepius@rtems.org>
     182
     183        * libc/sys/rtems/machine/_types.h: New.
     184        Add custom time for _ssize_t.
     185        * libc/stdlib/assert.c: Sync with newlib-CVS.
     186        * configure.host: Add -DHAVE_ASSERT_FUNC to newlib_cflags.
     187
     1882009-10-27      Ralf Corsépius <ralf.corsepius@rtems.org>
     189
     190        * libc/include/sys/pthread.h:
     191        Add pthread_atfork (Mandated by IEEE Std 1003.1-2008).
     192        Add pthread_rwlock_unlock (Formerly missing)
     193
     1942009-10-26      Ralf Corsépius <ralf.corsepius@rtems.org>
     195
     196        * libc/include/sys/signal.h: Sync with newlib-CVS.
     197
     1982009-10-09      Ralf Corsépius <ralf.corsepius@rtems.org>
     199
     200        * libc/include/sys/signal.h: Use pid_t as 1st arg to kill()
     201        (mandated by POSIX).
     202
     2032009-09-22      Ralf Corsépius <ralf.corsepius@rtems.org>
     204
     205        * libc/sys/rtems/sys/queue.h: Update copyright (from FreeBSD).
     206        Remove CIRCLEQ_*.
     207        * libc/search/hcreate.c: Don't include sys/queue.h.
     208
     2092009-09-18  Christopher Faylor  <me+cygwin@cgf.cx>
     210
     211        * libc/include/sys/unistd.h: Declare getpagesize as returning
     212        POSIX-mandated int.
     213
     2142009-09-15      Ralf Corsépius <ralf.corsepius@rtems.org>
     215
     216        * libc/include/stdlib.h: Add posix_memalign.
     217
     2182009-09-11      Ralf Corsépius <ralf.corsepius@rtems.org>
     219
     220        * configure.host (m32c): Remove -D_ABORT_PROVIDED.
     221
     2222009-09-10      Ralf Corsépius <ralf.corsepius@rtems.org>
     223
     224        * configure.host: Add -D_NO_POPEN.
     225        * libc/sys/rtems/crt0.c: Don't provide waitpid unless used.
     226
     2272009-09-09      Ralf Corsépius <ralf.corsepius@rtems.org>
     228
     229        * configure.host: Add -D_NO_WORDEXP.
     230
     2312009-09-06      Ralf Corsépius <ralf.corsepius@rtems.org>
     232
     233        * libc/sys/rtems/crt0.c: Add issetugid.
     234
     2352009-09-02      Ralf Corsépius <ralf.corsepius@rtems.org>
     236
     237        * libc/sys/rtems/crt0.c: Rework. Introduce macro RTEMS_STUB.
     238
     2392009-07-27      Ralf Corsépius <ralf.corsepius@rtems.org>
     240
     241        * libc/sys/rtems/crt0.c: Add _isatty_r.
     242
     2432009-07-06      Joel Sherrill <joel.sherrill@oarcorp.com>
     244
     245        * libc/include/sys/features.h: Define _UNIX98_THREAD_MUTEX_ATTRIBUTES.
     246
     2472009-05-05      Ralf Corsépius <ralf.corsepius@rtems.org>
     248
     249        * configure.host: Remove -DMISSING_SYSCALL_NAMES.
     250
     2512009-03-11      Ralf Corsépius <ralf.corsepius@rtems.org>
     252
     253        * libc/stdlib/assert.c: Don't build __assert_func.
     254        * libc/sys/rtems/crt0.c: Add __assert_func.
     255
     2562009-03-09      Ralf Corsépius <ralf.corsepius@rtems.org>
     257
     258        * libc/machine/powerpc/times.c: Remove.
     259        * libc/machine/powerpc/Makefile.am: Remove times.c.
     260        * libc/machine/powerpc/Makefile.in: Regenerate.
     261
     2622009-02-24      Ralf Corsépius <ralf.corsepius@rtems.org>
     263
     264        * libc/unix/ttyname.c: Sync with newlib-cvs.
     265        * configure.host: Add -DHAVE_BLKSIZE to newlib_cflags.
     266
     2672009-02-22      Ralf Corsépius <ralf.corsepius@rtems.org>
     268
     269        * libc/sys/rtems/machine/stdint.h: Add __lm32__.
     270        * libc/machine/lm32/configure.in: Set AC_CONFIG_SRC to setjmp.S.
     271        * libc/machine/lm32/configure: Regenerate.
     272
     2732009-02-20      Ralf Corsépius <ralf.corsepius@rtems.org>
     274
     275        * libc/unix/Makefile.in: Regenerate.
     276
     2772009-02-20  Craig Howland <howland@LGSInnovations.com> on behalf of
     278        Sebastian Huber <sebastian.huber@embedded-brains.de>
     279
     280        * libc/unix/ttyname.c:  Remove ttyname_r() (to a new file to avoid
     281        coupling ttyname_r() and ttyname() due to the latter's large buffer).
     282        * libc/unix/ttyname_r.c:  New file to hold ttyname_r(), previously in
     283        ttyname.c.
     284        * libc/unix/ttyname.h:  New file (common size definition for the 2
     285        ttyname*c files that are now split).
     286        * libc/unix/Makefile.am (ELIX_2_SOURCES):  Add ttyname_r.c.
     287
     2882009-02-16      Ralf Corsépius <ralf.corsepius@rtems.org>
     289
     290        * libc/sys/rtems/sys/param.h:
     291        Update copyright notice from FreeBSD.
     292        Remove HZ.
     293        Add #include <sys/priority.h>
     294        Remove priority handling (moved to sys/priority.h).
     295        Remove CLBYTES (Unused, abandoned in BSD).
     296
     2972009-02-06      Ralf Corsépius <ralf.corsepius@rtems.org>
     298
     299        * libc/include/sched.h:
     300        Remove (collides with RTEMS's schedul.h).
     301
  • newlib/configure.host

    diff -Naur newlib-1.18.0.orig/newlib/configure.host newlib-1.18.0-rtems4.10-20110518/newlib/configure.host
    old new  
    556556  *-*-rtems*)
    557557        default_newlib_io_long_long="yes"
    558558        default_newlib_io_c99_formats="yes"
     559        newlib_cflags="${newlib_cflags} -D_COMPILING_NEWLIB"
    559560        newlib_cflags="${newlib_cflags} -DMALLOC_PROVIDED -DEXIT_PROVIDED -DSIGNAL_PROVIDED -DREENTRANT_SYSCALLS_PROVIDED -DHAVE_NANOSLEEP -DHAVE_BLKSIZE -DHAVE_FCNTL -DHAVE_ASSERT_FUNC"
    560561        # turn off unsupported items in posix directory
    561562        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"
  • newlib/doc/makedoc.c

    diff -Naur newlib-1.18.0.orig/newlib/doc/makedoc.c newlib-1.18.0-rtems4.10-20110518/newlib/doc/makedoc.c
    old new  
    5757{
    5858    char *ptr;
    5959    unsigned int write_idx;
    60     unsigned int size;
     60    size_t size;
    6161} string_type;
    6262
    6363
     
    6868
    6969static void DEFUN(init_string_with_size,(buffer, size),
    7070           string_type *buffer AND
    71            unsigned int size )
     71           size_t size )
    7272{
    7373  buffer->write_idx = 0;
    7474  buffer->size = size;
     
    219219stinst_type *pc;
    220220stinst_type sstack[STACK];
    221221stinst_type *ssp = &sstack[0];
    222 int istack[STACK];
    223 int *isp = &istack[0];
     222long istack[STACK];
     223long *isp = &istack[0];
    224224
    225225typedef int *word_type;
    226226
     
    270270{
    271271    isp++;
    272272    pc++;
    273     *isp = (int)(*pc);
     273    *isp = (long)(*pc);
    274274    pc++;
    275275   
    276276}
  • newlib/libc/include/inttypes.h

    diff -Naur newlib-1.18.0.orig/newlib/libc/include/inttypes.h newlib-1.18.0-rtems4.10-20110518/newlib/libc/include/inttypes.h
    old new  
    242242#define SCNxMAX         __SCNMAX(x)
    243243
    244244/* ptr types */
    245 #if __have_long64
    246 #define __PRIPTR(x) __STRINGIFY(l##x)
    247 #define __SCNPTR(x) __STRINGIFY(l##x)
    248 #elif __have_longlong64
    249 #define __PRIPTR(x) __STRINGIFY(ll##x)
    250 #define __SCNPTR(x) __STRINGIFY(ll##x)
     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)
    251254#else
    252 #define __PRIPTR(x) __STRINGIFY(x)
    253 #define __SCNPTR(x) __STRINGIFY(x)
     255#error cannot determine PRI*PTR
    254256#endif
    255257
    256258#define PRIdPTR         __PRIPTR(d)
  • newlib/libc/include/machine/_default_types.h

    diff -Naur newlib-1.18.0.orig/newlib/libc/include/machine/_default_types.h newlib-1.18.0-rtems4.10-20110518/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/sched.h

    diff -Naur newlib-1.18.0.orig/newlib/libc/include/sched.h newlib-1.18.0-rtems4.10-20110518/newlib/libc/include/sched.h
    old new  
     1/*
     2 *  Written by Joel Sherrill <joel@OARcorp.com>.
     3 *
     4 *  COPYRIGHT (c) 1989-2010.
     5 *  On-Line Applications Research Corporation (OAR).
     6 *
     7 *  Permission to use, copy, modify, and distribute this software for any
     8 *  purpose without fee is hereby granted, provided that this entire notice
     9 *  is included in all copies of any software which is or includes a copy
     10 *  or modification of this software.
     11 *
     12 *  THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED
     13 *  WARRANTY.  IN PARTICULAR,  THE AUTHOR MAKES NO REPRESENTATION
     14 *  OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY OF THIS
     15 *  SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.
     16 *
     17 *  $Id: sched.h,v 1.2 2010/04/01 18:33:33 jjohnstn Exp $
     18 */
     19
    120#ifndef _SCHED_H_
    221#define _SCHED_H_
    322
     23#include <sys/types.h>
     24#include <sys/sched.h>
     25
    426#ifdef __cplusplus
    527extern "C" {
    628#endif
    729
    8 #include <sys/sched.h>
     30#if defined(_POSIX_PRIORITY_SCHEDULING)
     31/*
     32 *  XBD 13 - Set Scheduling Parameters, P1003.1b-2008, p. 1803
     33 */
     34int sched_setparam(
     35  pid_t                     __pid,
     36  const struct sched_param *__param
     37);
     38
     39/*
     40 *  XBD 13 - Set Scheduling Parameters, P1003.1b-2008, p. 1800
     41 */
     42int sched_getparam(
     43  pid_t                     __pid,
     44  struct sched_param       *__param
     45);
     46
     47/*
     48 *  XBD 13 - Set Scheduling Policy and Scheduling Parameters,
     49 *         P1003.1b-2008, p. 1805
     50 */
     51int sched_setscheduler(
     52  pid_t                     __pid,
     53  int                       __policy,
     54  const struct sched_param *__param
     55);
     56
     57/*
     58 *  XBD 13 - Get Scheduling Policy, P1003.1b-2008, p. 1801
     59 */
     60int sched_getscheduler(
     61  pid_t                     __pid
     62);
     63
     64/*
     65 *  XBD 13 - Get Scheduling Parameter Limits, P1003.1b-2008, p. 1799
     66 */
     67int sched_get_priority_max(
     68  int __policy
     69);
     70
     71int sched_get_priority_min(
     72  int  __policy
     73);
     74
     75/*
     76 *  XBD 13 - Get Scheduling Parameter Limits, P1003.1b-2008, p. 1802
     77 */
     78int sched_rr_get_interval(
     79  pid_t             __pid,
     80  struct timespec  *__interval
     81);
     82#endif /* _POSIX_PRIORITY_SCHEDULING */
     83
     84#if defined(_POSIX_THREADS) || defined(_POSIX_PRIORITY_SCHEDULING)
     85
     86/*
     87 *  XBD 13 - Yield Processor, P1003.1b-2008, p. 1807
     88 */
     89int sched_yield( void );
     90
     91#endif /* _POSIX_THREADS or _POSIX_PRIORITY_SCHEDULING */
    992
    1093#ifdef __cplusplus
    1194}
  • newlib/libc/include/stdint.h

    diff -Naur newlib-1.18.0.orig/newlib/libc/include/stdint.h newlib-1.18.0-rtems4.10-20110518/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;
     
    260283#define INTPTR_MIN (-__STDINT_EXP(LONG_MAX) - 1)
    261284#define UINTPTR_MAX (__STDINT_EXP(LONG_MAX) * 2UL + 1)
    262285#endif
     286#endif
    263287
    264288/* Limits of Specified-Width Integer Types */
    265289
     
    408432/* This must match size_t in stddef.h, currently long unsigned int */
    409433#ifdef __SIZE_MAX__
    410434#define SIZE_MAX __SIZE_MAX__
     435#elif defined(__SIZEOF_SIZE_T__) && defined(__CHAR_BIT__)
     436#define SIZE_MAX (((1UL << (__SIZEOF_SIZE_T__ * __CHAR_BIT__ - 1)) - 1) * 2 + 1)
    411437#else
    412438#define SIZE_MAX (__STDINT_EXP(LONG_MAX) * 2UL + 1)
    413439#endif
  • newlib/libc/include/string.h

    diff -Naur newlib-1.18.0.orig/newlib/libc/include/string.h newlib-1.18.0-rtems4.10-20110518/newlib/libc/include/string.h
    old new  
    4949#ifndef __STRICT_ANSI__
    5050char    *_EXFUN(strtok_r,(char *, const char *, char **));
    5151
    52 int      _EXFUN(bcmp,(const void *, const void *, size_t));
    53 void     _EXFUN(bcopy,(const void *, void *, size_t));
    54 void     _EXFUN(bzero,(void *, size_t));
    55 int      _EXFUN(ffs,(int));
    56 char    *_EXFUN(index,(const char *, int));
    5752_PTR     _EXFUN(memccpy,(_PTR, const _PTR, int, size_t));
    5853_PTR     _EXFUN(mempcpy,(_PTR, const _PTR, size_t));
    5954_PTR     _EXFUN(memmem, (const _PTR, size_t, const _PTR, size_t));
    60 char    *_EXFUN(rindex,(const char *, int));
    6155char    *_EXFUN(stpcpy,(char *, const char *));
    6256char    *_EXFUN(stpncpy,(char *, const char *, size_t));
    63 int      _EXFUN(strcasecmp,(const char *, const char *));
    6457char    *_EXFUN(strcasestr,(const char *, const char *));
    6558char    *_EXFUN(strdup,(const char *));
    6659char    *_EXFUN(_strdup_r,(struct _reent *, const char *));
     
    6962char    *_EXFUN(strerror_r,(int, char *, size_t));
    7063size_t   _EXFUN(strlcat,(char *, const char *, size_t));
    7164size_t   _EXFUN(strlcpy,(char *, const char *, size_t));
    72 int      _EXFUN(strncasecmp,(const char *, const char *, size_t));
    7365size_t   _EXFUN(strnlen,(const char *, size_t));
    7466char    *_EXFUN(strsep,(char **, const char *));
    7567char    *_EXFUN(strlwr,(char *));
     
    8173int     _EXFUN(strtosigno, (const char *__name));
    8274#endif
    8375
    84 /* These function names are used on Windows and perhaps other systems.  */
    85 #ifndef strcmpi
    86 #define strcmpi strcasecmp
    87 #endif
    88 #ifndef stricmp
    89 #define stricmp strcasecmp
    90 #endif
    91 #ifndef strncmpi
    92 #define strncmpi strncasecmp
    93 #endif
    94 #ifndef strnicmp
    95 #define strnicmp strncasecmp
    96 #endif
    97 
    9876#endif /* ! __STRICT_ANSI__ */
    9977
    10078#include <sys/string.h>
  • newlib/libc/include/strings.h

    diff -Naur newlib-1.18.0.orig/newlib/libc/include/strings.h newlib-1.18.0-rtems4.10-20110518/newlib/libc/include/strings.h
    old new  
     1/*
     2 * strings.h
     3 *
     4 * Definitions for string operations.
     5 */
     6
     7#ifndef _STRINGS_H_
     8#define _STRINGS_H_
     9
     10#include "_ansi.h"
     11#include <sys/reent.h>
     12
     13#include <sys/types.h> /* for size_t */
     14#include <locale.h> /* for locale_t */
     15
     16_BEGIN_STD_C
     17
     18#ifndef __STRICT_ANSI__
     19/*
     20 * Marked LEGACY in Open Group Base Specifications Issue 6/IEEE Std 1003.1-2004
     21 * Removed from Open Group Base Specifications Issue 7/IEEE Std 1003.1-2008
     22 */
     23int      _EXFUN(bcmp,(const void *, const void *, size_t));
     24void     _EXFUN(bcopy,(const void *, void *, size_t));
     25void     _EXFUN(bzero,(void *, size_t));
     26char    *_EXFUN(index,(const char *, int));
     27char    *_EXFUN(rindex,(const char *, int));
     28#endif /* ! __STRICT_ANSI__ */
     29
     30int      _EXFUN(ffs,(int));
     31int      _EXFUN(strcasecmp,(const char *, const char *));
     32#if 0
     33/* Not implemented */
     34int      _EXFUN(strcasecmp_l,(const char *, const char *, locale_t));
     35#endif
     36int      _EXFUN(strncasecmp,(const char *, const char *, size_t));
     37#if 0
     38/* Not implemented */
     39int      _EXFUN(strncasecmp_l,(const char *, const char *, size_t, locale_t));
     40#endif
     41
     42_END_STD_C
     43
     44#endif /* _STRINGS_H_ */
  • newlib/libc/include/sys/features.h

    diff -Naur newlib-1.18.0.orig/newlib/libc/include/sys/features.h newlib-1.18.0-rtems4.10-20110518/newlib/libc/include/sys/features.h
    old new  
    3333#define _POSIX_VERSION                  199309L
    3434#define _POSIX_ASYNCHRONOUS_IO          1
    3535#define _POSIX_FSYNC                    1
    36 #define _POSIX_MAPPED_FILES             1
     36/* #define _POSIX_MAPPED_FILES          1 */
    3737#define _POSIX_MEMLOCK                  1
    3838#define _POSIX_MEMLOCK_RANGE            1
    3939#define _POSIX_MEMORY_PROTECTION        1
  • newlib/libc/include/sys/sched.h

    diff -Naur newlib-1.18.0.orig/newlib/libc/include/sys/sched.h newlib-1.18.0-rtems4.10-20110518/newlib/libc/include/sys/sched.h
    old new  
    11/*
    22 *  Written by Joel Sherrill <joel@OARcorp.com>.
    33 *
    4  *  COPYRIGHT (c) 1989-2000.
     4 *  COPYRIGHT (c) 1989-2010.
    55 *  On-Line Applications Research Corporation (OAR).
    66 *
    77 *  Permission to use, copy, modify, and distribute this software for any
     
    1414 *  OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY OF THIS
    1515 *  SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.
    1616 *
    17  *  $Id: sched.h,v 1.2 2002/06/20 19:51:24 fitzsim Exp $
     17 *  $Id: sched.h,v 1.3 2010/04/01 18:33:37 jjohnstn Exp $
    1818 */
    1919
    2020
    21 #ifndef __POSIX_SYS_SCHEDULING_h
    22 #define __POSIX_SYS_SCHEDULING_h
     21#ifndef _SYS_SCHED_H_
     22#define _SYS_SCHED_H_
    2323
    2424#ifdef __cplusplus
    2525extern "C" {
    2626#endif
    2727
    28 #include <sys/unistd.h>
    29 
    30 #include <sys/types.h>
    31 #include <sys/time.h>
    32 
    33 /* Scheduling Policies, P1003.1b-1993, p. 250
    34    NOTE:  SCHED_SPORADIC added by P1003.4b/D8, p. 34.  */
    35 
     28/* Scheduling Policies */
     29/* Open Group Specifications Issue 6 */
     30#if defined(__CYGWIN__)
     31#define SCHED_OTHER    3
     32#else
    3633#define SCHED_OTHER    0
     34#endif
     35
    3736#define SCHED_FIFO     1
    3837#define SCHED_RR       2
    3938
    4039#if defined(_POSIX_SPORADIC_SERVER)
    41 #define SCHED_SPORADIC 3
     40#define SCHED_SPORADIC 4
    4241#endif
    4342
    44 /* Scheduling Parameters, P1003.1b-1993, p. 249
    45    NOTE:  Fields whose name begins with "ss_" added by P1003.4b/D8, p. 33. */
     43/* Scheduling Parameters */
     44/* Open Group Specifications Issue 6 */
    4645
    4746struct sched_param {
    4847  int sched_priority;           /* Process execution scheduling priority */
    4948
    50 #if defined(_POSIX_SPORADIC_SERVER)
    51   int ss_low_priority;          /* Low scheduling priority for sporadic */
     49#if defined(_POSIX_SPORADIC_SERVER) || defined(_POSIX_THREAD_SPORADIC_SERVER)
     50  int sched_ss_low_priority;    /* Low scheduling priority for sporadic */
    5251                                /*   server */
    53   struct timespec ss_replenish_period;
     52  struct timespec sched_ss_repl_period;
    5453                                /* Replenishment period for sporadic server */
    55   struct timespec ss_initial_budget;   /* Initial budget for sporadic server */
     54  struct timespec sched_ss_init_budget;
     55                               /* Initial budget for sporadic server */
     56  int sched_ss_max_repl;       /* Maximum pending replenishments for */
     57                               /* sporadic server */
    5658#endif
    5759};
    5860
    5961#ifdef __cplusplus
    6062}
    61 #endif 
     63#endif
    6264
    6365#endif
    6466/* end of include file */
  • newlib/libc/include/sys/types.h

    diff -Naur newlib-1.18.0.orig/newlib/libc/include/sys/types.h newlib-1.18.0-rtems4.10-20110518/newlib/libc/include/sys/types.h
    old new  
    176176#endif
    177177typedef _ssize_t ssize_t;
    178178
    179 #ifndef __CYGWIN__
     179#if defined(__rtems__)
     180typedef _mode_t mode_t;
     181#endif
     182
     183#if !defined(__CYGWIN__) && !defined(__rtems__)
    180184#ifdef __MS_types__
    181185typedef char *  addr_t;
    182186typedef int mode_t;
  • newlib/libc/include/time.h

    diff -Naur newlib-1.18.0.orig/newlib/libc/include/time.h newlib-1.18.0-rtems4.10-20110518/newlib/libc/include/time.h
    old new  
    212212   the identifier of the CPU_time clock associated with the PROCESS
    213213   making the function call.  */
    214214
     215#if defined(__rtems__) && !defined( __STRICT_ANSI__)
     216/* Don't use: Removed in rtems > 4.10 */
    215217#define CLOCK_PROCESS_CPUTIME (clockid_t)2
     218#endif
     219#define CLOCK_PROCESS_CPUTIME_ID (clockid_t)2
    216220
    217221#endif
    218222
     
    222226    the identifier of the CPU_time clock associated with the THREAD
    223227    making the function call.  */
    224228
     229#if defined(__rtems__) && !defined( __STRICT_ANSI__)
     230/* Don't use: Removed in rtems > 4.10 */
    225231#define CLOCK_THREAD_CPUTIME (clockid_t)3
     232#endif
     233#define CLOCK_THREAD_CPUTIME_ID (clockid_t)3
    226234
    227235#endif
    228236
  • newlib/libc/machine/powerpc/Makefile.am

    diff -Naur newlib-1.18.0.orig/newlib/libc/machine/powerpc/Makefile.am newlib-1.18.0-rtems4.10-20110518/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.18.0.orig/newlib/libc/machine/powerpc/Makefile.in newlib-1.18.0-rtems4.10-20110518/newlib/libc/machine/powerpc/Makefile.in
    old new  
    5151LIBRARIES = $(noinst_LIBRARIES)
    5252ARFLAGS = cru
    5353lib_a_AR = $(AR) $(ARFLAGS)
    54 am_lib_a_OBJECTS = lib_a-setjmp.$(OBJEXT) lib_a-times.$(OBJEXT)
     54am_lib_a_OBJECTS = lib_a-setjmp.$(OBJEXT)
    5555lib_a_OBJECTS = $(am_lib_a_OBJECTS)
    5656DEFAULT_INCLUDES = -I.@am__isrc@
    5757depcomp =
     
    173173AM_CCASFLAGS = $(INCLUDES)
    174174noinst_LIBRARIES = lib.a
    175175AM_CFLAGS = -I $(srcdir)/../../stdio -I $(srcdir)/../../stdlib
    176 lib_a_SOURCES = setjmp.S times.c
     176lib_a_SOURCES = setjmp.S
    177177lib_a_CCASFLAGS = $(AM_CCASFLAGS)
    178178lib_a_CFLAGS = $(AM_CFLAGS)
    179179lib_a_LIBADD = @extra_objs@
     
    184184all: all-am
    185185
    186186.SUFFIXES:
    187 .SUFFIXES: .S .c .o .obj
     187.SUFFIXES: .S .o .obj
    188188am--refresh:
    189189        @:
    190190$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
     
    245245lib_a-setjmp.obj: setjmp.S
    246246        $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(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`
    247247
    248 .c.o:
    249         $(COMPILE) -c $<
    250 
    251 .c.obj:
    252         $(COMPILE) -c `$(CYGPATH_W) '$<'`
    253 
    254 lib_a-times.o: times.c
    255         $(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
    256 
    257 lib_a-times.obj: times.c
    258         $(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`
    259 
    260248ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
    261249        list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
    262250        unique=`for i in $$list; do \
  • newlib/libc/machine/powerpc/times.c

    diff -Naur newlib-1.18.0.orig/newlib/libc/machine/powerpc/times.c newlib-1.18.0-rtems4.10-20110518/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/misc/__dprintf.c

    diff -Naur newlib-1.18.0.orig/newlib/libc/misc/__dprintf.c newlib-1.18.0-rtems4.10-20110518/newlib/libc/misc/__dprintf.c
    old new  
    55*/
    66
    77#include <_ansi.h>
     8#include <stdint.h>
    89#include "ctype.h"
    910#include "reent.h"
    1011#include "string.h"
     
    131132              write_string (unctrl (c));
    132133              break;
    133134            case 'p' :
    134               l = (_POINTER_INT) va_arg (args, char *);
     135              l = (intptr_t) va_arg (args, char *);
    135136              print_number (16, 1, l);
    136137              break;
    137138            case 'd' :
  • newlib/libc/misc/ffs.c

    diff -Naur newlib-1.18.0.orig/newlib/libc/misc/ffs.c newlib-1.18.0-rtems4.10-20110518/newlib/libc/misc/ffs.c
    old new  
    2424
    2525No supporting OS subroutines are required.  */
    2626
    27 #include <_ansi.h>
     27#include <strings.h>
    2828
    2929int
    3030_DEFUN(ffs, (word),
  • newlib/libc/posix/opendir.c

    diff -Naur newlib-1.18.0.orig/newlib/libc/posix/opendir.c newlib-1.18.0-rtems4.10-20110518/newlib/libc/posix/opendir.c
    old new  
    7474        dirp->dd_len = 512;
    7575
    7676        if (dirp->dd_buf == NULL) {
     77                free(dirp);
    7778                close (fd);
    7879                return NULL;
    7980        }
  • newlib/libc/posix/readdir.c

    diff -Naur newlib-1.18.0.orig/newlib/libc/posix/readdir.c newlib-1.18.0-rtems4.10-20110518/newlib/libc/posix/readdir.c
    old new  
    3737static char sccsid[] = "@(#)readdir.c   5.7 (Berkeley) 6/1/90";
    3838#endif /* LIBC_SCCS and not lint */
    3939
     40#include <stdint.h>
    4041#include <dirent.h>
    4142
    4243extern int getdents (int fd, void *dp, int count);
     
    7576      continue;
    7677    }
    7778    dp = (struct dirent *)(dirp->dd_buf + dirp->dd_loc);
    78     if ((int)dp & 03) { /* bogus pointer check */
     79    if ((intptr_t)dp & 03) {    /* bogus pointer check */
    7980#ifdef HAVE_DD_LOCK
    8081      __lock_release_recursive(dirp->dd_lock);
    8182#endif
  • newlib/libc/posix/rewinddir.c

    diff -Naur newlib-1.18.0.orig/newlib/libc/posix/rewinddir.c newlib-1.18.0-rtems4.10-20110518/newlib/libc/posix/rewinddir.c
    old new  
    4848#ifdef HAVE_DD_LOCK
    4949        __lock_acquire_recursive(dirp->dd_lock);
    5050#endif
    51         _seekdir((dirp), (off_t)0);
     51        _seekdir((dirp), 0L);
    5252#ifdef HAVE_DD_LOCK
    5353        __lock_release_recursive(dirp->dd_lock);
    5454#endif
  • newlib/libc/posix/telldir.c

    diff -Naur newlib-1.18.0.orig/newlib/libc/posix/telldir.c newlib-1.18.0-rtems4.10-20110518/newlib/libc/posix/telldir.c
    old new  
    6767#define NDIRHASH        32      /* Num of hash lists, must be a power of 2 */
    6868#define LOCHASH(i)      ((i)&(NDIRHASH-1))
    6969
    70 static long     dd_loccnt;      /* Index of entry for sequential readdir's */
     70static long     dd_loccnt = 1;  /* Index of entry for sequential readdir's */
    7171static struct   ddloc *dd_hash[NDIRHASH];   /* Hash list heads for ddlocs */
    7272__LOCK_INIT(static, dd_hash_lock);
    7373
     
    119119        register struct ddloc *lp;
    120120        register struct ddloc **prevlp;
    121121        struct dirent *dp;
    122         extern long lseek();
    123122
    124123#ifdef HAVE_DD_LOCK
    125124        __lock_acquire(dd_hash_lock);
    126125#endif
    127         prevlp = &dd_hash[LOCHASH(loc)];
    128         lp = *prevlp;
    129         while (lp != NULL) {
    130                 if (lp->loc_index == loc)
    131                         break;
    132                 prevlp = &lp->loc_next;
    133                 lp = lp->loc_next;
    134         }
    135         if (lp == NULL) {
     126        if (loc != 0) {
     127                prevlp = &dd_hash[LOCHASH(loc)];
     128                lp = *prevlp;
     129                while (lp != NULL) {
     130                        if (lp->loc_index == loc)
     131                                break;
     132                        prevlp = &lp->loc_next;
     133                        lp = lp->loc_next;
     134                }
     135                if (lp == NULL) {
    136136#ifdef HAVE_DD_LOCK
    137                 __lock_release(dd_hash_lock);
     137                        __lock_release(dd_hash_lock);
    138138#endif
    139                 return;
    140         }
    141         if (lp->loc_loc == dirp->dd_loc && lp->loc_seek == dirp->dd_seek)
    142                 goto found;
    143         (void) lseek(dirp->dd_fd, lp->loc_seek, 0);
    144         dirp->dd_seek = lp->loc_seek;
    145         dirp->dd_loc = 0;
    146         while (dirp->dd_loc < lp->loc_loc) {
    147                 dp = readdir(dirp);
    148                 if (dp == NULL)
    149                         break;
    150         }
     139                        return;
     140                }
     141                if (lp->loc_loc == dirp->dd_loc && lp->loc_seek == dirp->dd_seek)
     142                        goto found;
     143                (void) lseek(dirp->dd_fd, lp->loc_seek, 0);
     144                dirp->dd_seek = lp->loc_seek;
     145                dirp->dd_loc = 0;
     146                while (dirp->dd_loc < lp->loc_loc) {
     147                        dp = readdir(dirp);
     148                        if (dp == NULL)
     149                                break;
     150                }
    151151found:
    152152#ifdef SINGLEUSE
    153         *prevlp = lp->loc_next;
    154         free((caddr_t)lp);
     153                *prevlp = lp->loc_next;
     154                free((caddr_t)lp);
    155155#endif
     156        } else {
     157                // loc 0 means rewinding
     158                (void) lseek(dirp->dd_fd, 0, 0);
     159                dirp->dd_seek = 0;
     160                dirp->dd_loc = 0;
     161        }
    156162#ifdef HAVE_DD_LOCK
    157163        __lock_release(dd_hash_lock);
    158164#endif
     
    169175        __lock_acquire(dd_hash_lock);
    170176#endif
    171177        for (i = 0; i < NDIRHASH; ++i) {
     178                struct ddloc head;
    172179                register struct ddloc *lp;
    173180                register struct ddloc *prevlp;
     181
    174182                lp = dd_hash[i];
    175                 while (lp != NULL && lp->loc_dirp == dirp) {
    176                         dd_hash[i] = lp->loc_next;
    177                         prevlp = lp;
    178                         free((caddr_t)lp);
    179                         lp = prevlp->loc_next;
    180                 }
    181                 prevlp = lp;
     183                head.loc_next = lp;
     184                prevlp = &head;
    182185                while (lp != NULL) {
    183                         lp = lp->loc_next;
    184                         if (lp != NULL && lp->loc_dirp == dirp) {
    185                                 prevlp->loc_next = lp->loc_next;
     186                        struct ddloc *nextlp;
     187
     188                        nextlp = lp->loc_next;
     189                        if (lp->loc_dirp == dirp) {
     190                                prevlp->loc_next = nextlp;
    186191                                free((caddr_t)lp);
    187                                 lp = prevlp;
    188192                        }
    189193                        else
    190194                                prevlp = lp;
     195                        lp = nextlp;
    191196                }
     197                dd_hash[i] = head.loc_next;
    192198        }
    193199#ifdef HAVE_DD_LOCK
    194200        __lock_release(dd_hash_lock);
  • newlib/libc/search/db_local.h

    diff -Naur newlib-1.18.0.orig/newlib/libc/search/db_local.h newlib-1.18.0-rtems4.10-20110518/newlib/libc/search/db_local.h
    old new  
    102102typedef struct __db {
    103103        DBTYPE type;                    /* Underlying db type. */
    104104        int (*close)(struct __db *);
    105         int (*del)(const struct __db *, const DBT *, u_int);
    106         int (*get)(const struct __db *, const DBT *, DBT *, u_int);
    107         int (*put)(const struct __db *, DBT *, const DBT *, u_int);
    108         int (*seq)(const struct __db *, DBT *, DBT *, u_int);
    109         int (*sync)(const struct __db *, u_int);
     105        int (*del)(const struct __db *, const DBT *, __uint32_t);
     106        int (*get)(const struct __db *, const DBT *, DBT *, __uint32_t);
     107        int (*put)(const struct __db *, DBT *, const DBT *, __uint32_t);
     108        int (*seq)(const struct __db *, DBT *, DBT *, __uint32_t);
     109        int (*sync)(const struct __db *, __uint32_t);
    110110        void *internal;                 /* Access method private. */
    111111        int (*fd)(const struct __db *);
    112112} DB;
  • newlib/libc/search/extern.h

    diff -Naur newlib-1.18.0.orig/newlib/libc/search/extern.h newlib-1.18.0-rtems4.10-20110518/newlib/libc/search/extern.h
    old new  
    4343int      __big_split(HTAB *, BUFHEAD *, BUFHEAD *, BUFHEAD *,
    4444                int, __uint32_t, SPLIT_RETURN *);
    4545int      __buf_free(HTAB *, int, int);
    46 void     __buf_init(HTAB *, int);
     46void     __buf_init(HTAB *, __uint32_t);
    4747__uint32_t       __call_hash(HTAB *, char *, int);
    4848int      __delpair(HTAB *, BUFHEAD *, int);
    4949int      __expand_table(HTAB *);
  • newlib/libc/search/hash_buf.c

    diff -Naur newlib-1.18.0.orig/newlib/libc/search/hash_buf.c newlib-1.18.0-rtems4.10-20110518/newlib/libc/search/hash_buf.c
    old new  
    118118        int newpage;    /* If prev_bp set, indicates a new overflow page. */
    119119{
    120120        BUFHEAD *bp;
    121         __uint32_t is_disk_mask;
     121        ptrdiff_t is_disk_mask;
    122122        int is_disk, segment_ndx;
    123123        SEGMENT segp;
    124124
     
    298298extern void
    299299__buf_init(hashp, nbytes)
    300300        HTAB *hashp;
    301         int nbytes;
     301        __uint32_t nbytes;
    302302{
    303303        BUFHEAD *bfp;
    304304        int npages;
  • newlib/libc/search/hash.h

    diff -Naur newlib-1.18.0.orig/newlib/libc/search/hash.h newlib-1.18.0-rtems4.10-20110518/newlib/libc/search/hash.h
    old new  
    8282
    8383/* Hash Table Information */
    8484typedef struct hashhdr {                /* Disk resident portion */
    85         int             magic;          /* Magic NO for hash tables */
     85        __uint32_t      magic;          /* Magic NO for hash tables */
    8686        int             version;        /* Version ID */
    8787        __uint32_t      lorder;         /* Byte Order */
    8888        int             bsize;          /* Bucket/Page Size */
     
    9797        int             high_mask;      /* Mask to modulo into entire table */
    9898        int             low_mask;       /* Mask to modulo into lower half of
    9999                                         * table */
    100         int             ffactor;        /* Fill factor */
     100        __uint32_t      ffactor;        /* Fill factor */
    101101        int             nkeys;          /* Number of keys in hash table */
    102102        int             hdrpages;       /* Size of table header */
    103103        int             h_charkey;      /* value of hash(CHARKEY) */
  • newlib/libc/stdio/open_memstream.c

    diff -Naur newlib-1.18.0.orig/newlib/libc/stdio/open_memstream.c newlib-1.18.0-rtems4.10-20110518/newlib/libc/stdio/open_memstream.c
    old new  
    330330    c->max *= sizeof(wchar_t);
    331331  if (c->max < 64)
    332332    c->max = 64;
    333   else if (c->max > 64 * 1024)
    334     c->max = 64 * 1024;
     333#if (SIZE_MAX >= 0x10000)
     334  else if (c->max > 0x10000)
     335    c->max = 0x10000;
     336#endif
    335337  *size = 0;
    336338  *buf = _malloc_r (ptr, c->max);
    337339  if (!*buf)
  • newlib/libc/stdio/tmpnam.c

    diff -Naur newlib-1.18.0.orig/newlib/libc/stdio/tmpnam.c newlib-1.18.0-rtems4.10-20110518/newlib/libc/stdio/tmpnam.c
    old new  
    9494#include <_ansi.h>
    9595#include <reent.h>
    9696#include <stdio.h>
     97#include <stdint.h>
    9798#include <stdlib.h>
    9899#include <string.h>
    99100#include <fcntl.h>
     
    109110       char *result       _AND
    110111       _CONST char *part1 _AND
    111112       _CONST char *part2 _AND
    112        int part3          _AND
     113       intptr_t part3     _AND
    113114       int *part4)
    114115{
    115116  /*  Generate the filename and make sure that there isn't one called
     
    183184  if (filename)
    184185    {
    185186      if (! worker (p, filename, dir, prefix,
    186                     _getpid_r (p) ^ (int) (_POINTER_INT) p, &p->_inc))
     187                    _getpid_r (p) ^ (intptr_t) p, &p->_inc))
    187188        return NULL;
    188189    }
    189190  return filename;
  • newlib/libc/stdlib/putenv_r.c

    diff -Naur newlib-1.18.0.orig/newlib/libc/stdlib/putenv_r.c newlib-1.18.0-rtems4.10-20110518/newlib/libc/stdlib/putenv_r.c
    old new  
    2424#include <reent.h>
    2525#include <stdlib.h>
    2626#include <string.h>
     27#include <strings.h>
    2728
    2829#include "envlock.h"
    2930
  • newlib/libc/stdlib/strtod.c

    diff -Naur newlib-1.18.0.orig/newlib/libc/stdlib/strtod.c newlib-1.18.0-rtems4.10-20110518/newlib/libc/stdlib/strtod.c
    old new  
    299299                }
    300300        s0 = s;
    301301        y = z = 0;
    302         for(nd = nf = 0; (c = *s) >= '0' && c <= '9'; nd++, s++)
    303                 if (nd < 9)
    304                         y = 10*y + c - '0';
    305                 else if (nd < 16)
    306                         z = 10*z + c - '0';
     302        for(nd = nf = 0; (c = *s) >= '0' && c <= '9'; nd++, s++) {
     303                if (nd < DBL_DIG + 1) {
     304                        if (nd < 9)
     305                                y = 10*y + c - '0';
     306                        else
     307                                z = 10*z + c - '0';
     308                }
     309        }
    307310        nd0 = nd;
    308311        if (strncmp (s, _localeconv_r (ptr)->decimal_point,
    309                      strlen (_localeconv_r (ptr)->decimal_point)) == 0)
    310                 {
     312                     strlen (_localeconv_r (ptr)->decimal_point)) == 0) {
    311313                decpt = 1;
    312314                c = *(s += strlen (_localeconv_r (ptr)->decimal_point));
    313315                if (!nd) {
     
    325327 have_dig:
    326328                        nz++;
    327329                        if (c -= '0') {
    328                                 nf += nz;
    329                                 for(i = 1; i < nz; i++)
    330                                         if (nd++ < 9)
    331                                                 y *= 10;
    332                                         else if (nd <= DBL_DIG + 1)
    333                                                 z *= 10;
    334                                 if (nd++ < 9)
    335                                         y = 10*y + c;
    336                                 else if (nd <= DBL_DIG + 1)
    337                                         z = 10*z + c;
    338                                 nz = 0;
     330                                for(i = 1; i < nz; i++) {
     331                                        if (nd <= DBL_DIG + 1) {
     332                                                if (nd + i < 10)
     333                                                        y *= 10;
     334                                                else
     335                                                        z *= 10;
     336                                        }
    339337                                }
     338                                if (nd <= DBL_DIG + 1) {
     339                                        if (nd + i < 10)
     340                                                y = 10*y + c;
     341                                        else
     342                                                z = 10*z + c;
     343                                }
     344                                if (nd <= DBL_DIG + 1) {
     345                                        nf += nz;
     346                                        nd += nz;
     347                                }
     348                                nz = 0;
    340349                        }
    341350                }
     351        }
    342352 dig_done:
    343353        e = 0;
    344354        if (c == 'e' || c == 'E') {
  • newlib/libc/string/bcmp.c

    diff -Naur newlib-1.18.0.orig/newlib/libc/string/bcmp.c newlib-1.18.0-rtems4.10-20110518/newlib/libc/string/bcmp.c
    old new  
    66        bcmp
    77
    88ANSI_SYNOPSIS
    9         #include <string.h>
     9        #include <strings.h>
    1010        int bcmp(const void *<[s1]>, const void *<[s2]>, size_t <[n]>);
    1111
    1212TRAD_SYNOPSIS
    13         #include <string.h>
     13        #include <strings.h>
    1414        int bcmp(<[s1]>, <[s2]>, <[n]>)
    1515        const void *<[s1]>;
    1616        const void *<[s2]>;
     
    3535        bcmp ansi pure
    3636*/
    3737
    38 #include <string.h>
     38#include <strings.h>
    3939
    4040int
    4141_DEFUN (bcmp, (m1, m2, n),
  • newlib/libc/string/bcopy.c

    diff -Naur newlib-1.18.0.orig/newlib/libc/string/bcopy.c newlib-1.18.0-rtems4.10-20110518/newlib/libc/string/bcopy.c
    old new  
    33        <<bcopy>>---copy memory regions
    44
    55ANSI_SYNOPSIS
    6         #include <string.h>
     6        #include <strings.h>
    77        void bcopy(const void *<[in]>, void *<[out]>, size_t <[n]>);
    88
    99TRAD_SYNOPSIS
     
    2626        bcopy - pure
    2727*/
    2828
    29 #include <string.h>
     29#include <strings.h>
    3030
    3131void
    3232_DEFUN (bcopy, (b1, b2, length),
  • newlib/libc/string/bzero.c

    diff -Naur newlib-1.18.0.orig/newlib/libc/string/bzero.c newlib-1.18.0-rtems4.10-20110518/newlib/libc/string/bzero.c
    old new  
    66        bzero
    77
    88ANSI_SYNOPSIS
    9         #include <string.h>
     9        #include <strings.h>
    1010        void bzero(void *<[b]>, size_t <[length]>);
    1111
    1212TRAD_SYNOPSIS
    13         #include <string.h>
     13        #include <strings.h>
    1414        void bzero(<[b]>, <[length]>)
    1515        void *<[b]>;
    1616        size_t <[length]>;
     
    3030<<bzero>> requires no supporting OS subroutines.
    3131*/
    3232
    33 #include <string.h>
     33#include <strings.h>
    3434
    3535_VOID
    3636_DEFUN (bzero, (b, length),
  • newlib/libc/string/index.c

    diff -Naur newlib-1.18.0.orig/newlib/libc/string/index.c newlib-1.18.0-rtems4.10-20110518/newlib/libc/string/index.c
    old new  
    1010        char * index(const char *<[string]>, int <[c]>);
    1111
    1212TRAD_SYNOPSIS
    13         #include <string.h>
     13        #include <strings.h>
    1414        char * index(<[string]>, <[c]>);
    1515        char *<[string]>;
    1616        int *<[c]>;
     
    3333        index - pure
    3434*/
    3535
    36 #include <string.h>
     36#include <strings.h>
     37#include <string.h> /* strchr */
    3738
    3839char *
    3940_DEFUN (index, (s, c),
  • newlib/libc/string/memccpy.c

    diff -Naur newlib-1.18.0.orig/newlib/libc/string/memccpy.c newlib-1.18.0-rtems4.10-20110518/newlib/libc/string/memccpy.c
    old new  
    3535        */
    3636
    3737#include <_ansi.h>
     38#include <stdint.h>
    3839#include <stddef.h>
    3940#include <string.h>
    4041#include <limits.h>
    4142
    4243/* Nonzero if either X or Y is not aligned on a "long" boundary.  */
    4344#define UNALIGNED(X, Y) \
    44   (((long)X & (sizeof (long) - 1)) | ((long)Y & (sizeof (long) - 1)))
     45  (((intptr_t)X & (sizeof (long) - 1)) | ((intptr_t)Y & (sizeof (long) - 1)))
    4546
    4647/* How many bytes are copied each iteration of the word copy loop.  */
    4748#define LITTLEBLOCKSIZE (sizeof (long))
  • newlib/libc/string/memchr.c

    diff -Naur newlib-1.18.0.orig/newlib/libc/string/memchr.c newlib-1.18.0-rtems4.10-20110518/newlib/libc/string/memchr.c
    old new  
    3838
    3939#include <_ansi.h>
    4040#include <string.h>
     41#include <stdint.h>
    4142#include <limits.h>
    4243
    4344/* Nonzero if either X or Y is not aligned on a "long" boundary.  */
    44 #define UNALIGNED(X) ((long)X & (sizeof (long) - 1))
     45#define UNALIGNED(X) ((intptr_t)X & (sizeof (long) - 1))
    4546
    4647/* How many bytes are loaded each iteration of the word copy loop.  */
    4748#define LBLOCKSIZE (sizeof (long))
  • newlib/libc/string/memcmp.c

    diff -Naur newlib-1.18.0.orig/newlib/libc/string/memcmp.c newlib-1.18.0-rtems4.10-20110518/newlib/libc/string/memcmp.c
    old new  
    3737*/
    3838
    3939#include <string.h>
    40 
     40#include <stdint.h>
    4141
    4242/* Nonzero if either X or Y is not aligned on a "long" boundary.  */
    4343#define UNALIGNED(X, Y) \
    44   (((long)X & (sizeof (long) - 1)) | ((long)Y & (sizeof (long) - 1)))
     44  (((intptr_t)X & (sizeof (long) - 1)) | ((intptr_t)Y & (sizeof (long) - 1)))
    4545
    4646/* How many bytes are copied each iteration of the word copy loop.  */
    4747#define LBLOCKSIZE (sizeof (long))
  • newlib/libc/string/memcpy.c

    diff -Naur newlib-1.18.0.orig/newlib/libc/string/memcpy.c newlib-1.18.0-rtems4.10-20110518/newlib/libc/string/memcpy.c
    old new  
    3434        */
    3535
    3636#include <_ansi.h>
     37#include <stdint.h>
    3738#include <string.h>
    3839
    3940/* Nonzero if either X or Y is not aligned on a "long" boundary.  */
    4041#define UNALIGNED(X, Y) \
    41   (((long)X & (sizeof (long) - 1)) | ((long)Y & (sizeof (long) - 1)))
     42  (((intptr_t)X & (sizeof (long) - 1)) | ((intptr_t)Y & (sizeof (long) - 1)))
    4243
    4344/* How many bytes are copied each iteration of the 4X unrolled loop.  */
    4445#define BIGBLOCKSIZE    (sizeof (long) << 2)
  • newlib/libc/string/memmove.c

    diff -Naur newlib-1.18.0.orig/newlib/libc/string/memmove.c newlib-1.18.0-rtems4.10-20110518/newlib/libc/string/memmove.c
    old new  
    3636*/
    3737
    3838#include <string.h>
     39#include <stdint.h>
    3940#include <_ansi.h>
    4041#include <stddef.h>
    4142#include <limits.h>
    4243
    4344/* Nonzero if either X or Y is not aligned on a "long" boundary.  */
    4445#define UNALIGNED(X, Y) \
    45   (((long)X & (sizeof (long) - 1)) | ((long)Y & (sizeof (long) - 1)))
     46  (((intptr_t)X & (sizeof (long) - 1)) | ((intptr_t)Y & (sizeof (long) - 1)))
    4647
    4748/* How many bytes are copied each iteration of the 4X unrolled loop.  */
    4849#define BIGBLOCKSIZE    (sizeof (long) << 2)
  • newlib/libc/string/mempcpy.c

    diff -Naur newlib-1.18.0.orig/newlib/libc/string/mempcpy.c newlib-1.18.0-rtems4.10-20110518/newlib/libc/string/mempcpy.c
    old new  
    3434#include <stddef.h>
    3535#include <limits.h>
    3636#include <string.h>
     37#include <stdint.h>
    3738
    3839/* Nonzero if either X or Y is not aligned on a "long" boundary.  */
    3940#define UNALIGNED(X, Y) \
    40   (((long)X & (sizeof (long) - 1)) | ((long)Y & (sizeof (long) - 1)))
     41  (((intptr_t)X & (sizeof (long) - 1)) | ((uintptr_t)Y & (sizeof (long) - 1)))
    4142
    4243/* How many bytes are copied each iteration of the 4X unrolled loop.  */
    4344#define BIGBLOCKSIZE    (sizeof (long) << 2)
  • newlib/libc/string/memset.c

    diff -Naur newlib-1.18.0.orig/newlib/libc/string/memset.c newlib-1.18.0-rtems4.10-20110518/newlib/libc/string/memset.c
    old new  
    3434*/
    3535
    3636#include <string.h>
     37#include <stdint.h>
    3738
    3839#define LBLOCKSIZE (sizeof(long))
    39 #define UNALIGNED(X)   ((long)X & (LBLOCKSIZE - 1))
     40#define UNALIGNED(X)   ((intptr_t)X & (LBLOCKSIZE - 1))
    4041#define TOO_SMALL(LEN) ((LEN) < LBLOCKSIZE)
    4142
    4243_PTR
  • newlib/libc/string/rindex.c

    diff -Naur newlib-1.18.0.orig/newlib/libc/string/rindex.c newlib-1.18.0-rtems4.10-20110518/newlib/libc/string/rindex.c
    old new  
    1010        char * rindex(const char *<[string]>, int <[c]>);
    1111
    1212TRAD_SYNOPSIS
    13         #include <string.h>
     13        #include <strings.h>
    1414        char * rindex(<[string]>, <[c]>);
    1515        char *<[string]>;
    1616        int *<[c]>;
     
    3333        rindex - pure
    3434*/
    3535
    36 #include <string.h>
     36#include <strings.h>
     37#include <string.h> /* strchr */
    3738
    3839char *
    3940_DEFUN (rindex, (s, c),
  • newlib/libc/string/stpcpy.c

    diff -Naur newlib-1.18.0.orig/newlib/libc/string/stpcpy.c newlib-1.18.0-rtems4.10-20110518/newlib/libc/string/stpcpy.c
    old new  
    3434*/
    3535
    3636#include <string.h>
     37#include <stdint.h>
    3738#include <limits.h>
    3839
    3940/*SUPPRESS 560*/
     
    4142
    4243/* Nonzero if either X or Y is not aligned on a "long" boundary.  */
    4344#define UNALIGNED(X, Y) \
    44   (((long)X & (sizeof (long) - 1)) | ((long)Y & (sizeof (long) - 1)))
     45  (((intptr_t)X & (sizeof (long) - 1)) | ((intptr_t)Y & (sizeof (long) - 1)))
    4546
    4647#if LONG_MAX == 2147483647L
    4748#define DETECTNULL(X) (((X) - 0x01010101) & ~(X) & 0x80808080)
  • newlib/libc/string/stpncpy.c

    diff -Naur newlib-1.18.0.orig/newlib/libc/string/stpncpy.c newlib-1.18.0-rtems4.10-20110518/newlib/libc/string/stpncpy.c
    old new  
    4040*/
    4141
    4242#include <string.h>
     43#include <stdint.h>
    4344#include <limits.h>
    4445
    4546/*SUPPRESS 560*/
     
    4748
    4849/* Nonzero if either X or Y is not aligned on a "long" boundary.  */
    4950#define UNALIGNED(X, Y) \
    50   (((long)X & (sizeof (long) - 1)) | ((long)Y & (sizeof (long) - 1)))
     51  (((intptr_t)X & (sizeof (long) - 1)) | ((intptr_t)Y & (sizeof (long) - 1)))
    5152
    5253#if LONG_MAX == 2147483647L
    5354#define DETECTNULL(X) (((X) - 0x01010101) & ~(X) & 0x80808080)
  • newlib/libc/string/strcasecmp.c

    diff -Naur newlib-1.18.0.orig/newlib/libc/string/strcasecmp.c newlib-1.18.0-rtems4.10-20110518/newlib/libc/string/strcasecmp.c
    old new  
    3838        strcasecmp
    3939*/
    4040
    41 #include <string.h>
     41#include <strings.h>
    4242#include <ctype.h>
    4343
    4444int
  • newlib/libc/string/strcat.c

    diff -Naur newlib-1.18.0.orig/newlib/libc/string/strcat.c newlib-1.18.0-rtems4.10-20110518/newlib/libc/string/strcat.c
    old new  
    3333        strcat ansi pure
    3434*/
    3535
     36#include <stdint.h>
    3637#include <string.h>
    3738#include <limits.h>
    3839
    3940/* Nonzero if X is aligned on a "long" boundary.  */
    4041#define ALIGNED(X) \
    41   (((long)X & (sizeof (long) - 1)) == 0)
     42  (((uintptr_t)X & (sizeof (long) - 1)) == 0)
    4243
    4344#if LONG_MAX == 2147483647L
    4445#define DETECTNULL(X) (((X) - 0x01010101) & ~(X) & 0x80808080)
  • newlib/libc/string/strchr.c

    diff -Naur newlib-1.18.0.orig/newlib/libc/string/strchr.c newlib-1.18.0-rtems4.10-20110518/newlib/libc/string/strchr.c
    old new  
    3333        strchr ansi pure
    3434*/
    3535
     36#include <stdint.h>
    3637#include <string.h>
    3738#include <limits.h>
    3839
    3940/* Nonzero if X is not aligned on a "long" boundary.  */
    40 #define UNALIGNED(X) ((long)X & (sizeof (long) - 1))
     41#define UNALIGNED(X) ((uintptr_t)X & (sizeof (long) - 1))
    4142
    4243/* How many bytes are loaded each iteration of the word copy loop.  */
    4344#define LBLOCKSIZE (sizeof (long))
  • newlib/libc/string/strcmp.c

    diff -Naur newlib-1.18.0.orig/newlib/libc/string/strcmp.c newlib-1.18.0-rtems4.10-20110518/newlib/libc/string/strcmp.c
    old new  
    3535        strcmp ansi pure
    3636*/
    3737
     38#include <stdint.h>
    3839#include <string.h>
    3940#include <limits.h>
    4041
    4142/* Nonzero if either X or Y is not aligned on a "long" boundary.  */
    4243#define UNALIGNED(X, Y) \
    43   (((long)X & (sizeof (long) - 1)) | ((long)Y & (sizeof (long) - 1)))
     44  (((uintptr_t)X & (sizeof (long) - 1)) | ((uintptr_t)Y & (sizeof (long) - 1)))
    4445
    4546/* DETECTNULL returns nonzero if (long)X contains a NULL byte. */
    4647#if LONG_MAX == 2147483647L
  • newlib/libc/string/strcpy.c

    diff -Naur newlib-1.18.0.orig/newlib/libc/string/strcpy.c newlib-1.18.0-rtems4.10-20110518/newlib/libc/string/strcpy.c
    old new  
    3232        strcpy ansi pure
    3333*/
    3434
     35#include <stdint.h>
    3536#include <string.h>
    3637#include <limits.h>
    3738
     
    4041
    4142/* Nonzero if either X or Y is not aligned on a "long" boundary.  */
    4243#define UNALIGNED(X, Y) \
    43   (((long)X & (sizeof (long) - 1)) | ((long)Y & (sizeof (long) - 1)))
     44  (((intptr_t)X & (sizeof (long) - 1)) | ((intptr_t)Y & (sizeof (long) - 1)))
    4445
    4546#if LONG_MAX == 2147483647L
    4647#define DETECTNULL(X) (((X) - 0x01010101) & ~(X) & 0x80808080)
  • newlib/libc/string/strlen.c

    diff -Naur newlib-1.18.0.orig/newlib/libc/string/strlen.c newlib-1.18.0-rtems4.10-20110518/newlib/libc/string/strlen.c
    old new  
    3232*/
    3333
    3434#include <_ansi.h>
     35#include <stdint.h>
    3536#include <string.h>
    3637#include <limits.h>
    3738
    3839#define LBLOCKSIZE   (sizeof (long))
    39 #define UNALIGNED(X) ((long)X & (LBLOCKSIZE - 1))
     40#define UNALIGNED(X) ((intptr_t)X & (LBLOCKSIZE - 1))
    4041
    4142#if LONG_MAX == 2147483647L
    4243#define DETECTNULL(X) (((X) - 0x01010101) & ~(X) & 0x80808080)
  • newlib/libc/string/strncasecmp.c

    diff -Naur newlib-1.18.0.orig/newlib/libc/string/strncasecmp.c newlib-1.18.0-rtems4.10-20110518/newlib/libc/string/strncasecmp.c
    old new  
    66        strncasecmp
    77
    88ANSI_SYNOPSIS
    9         #include <string.h>
     9        #include <strings.h>
    1010        int strncasecmp(const char *<[a]>, const char * <[b]>, size_t <[length]>);
    1111
    1212TRAD_SYNOPSIS
    13         #include <string.h>
     13        #include <strings.h>
    1414        int strncasecmp(<[a]>, <[b]>, <[length]>)
    1515        char *<[a]>;
    1616        char *<[b]>;
     
    4040        strncasecmp
    4141*/
    4242
    43 #include <string.h>
     43#include <strings.h>
    4444#include <ctype.h>
    4545
    4646int
  • newlib/libc/string/strncat.c

    diff -Naur newlib-1.18.0.orig/newlib/libc/string/strncat.c newlib-1.18.0-rtems4.10-20110518/newlib/libc/string/strncat.c
    old new  
    4242*/
    4343
    4444#include <string.h>
     45#include <stdint.h>
    4546#include <limits.h>
    4647
    4748/* Nonzero if X is aligned on a "long" boundary.  */
    4849#define ALIGNED(X) \
    49   (((long)X & (sizeof (long) - 1)) == 0)
     50  (((intptr_t)X & (sizeof (long) - 1)) == 0)
    5051
    5152#if LONG_MAX == 2147483647L
    5253#define DETECTNULL(X) (((X) - 0x01010101) & ~(X) & 0x80808080)
  • newlib/libc/string/strncmp.c

    diff -Naur newlib-1.18.0.orig/newlib/libc/string/strncmp.c newlib-1.18.0-rtems4.10-20110518/newlib/libc/string/strncmp.c
    old new  
    3636        strncmp ansi pure
    3737*/
    3838
     39#include <stdint.h>
    3940#include <string.h>
    4041#include <limits.h>
    4142
    4243/* Nonzero if either X or Y is not aligned on a "long" boundary.  */
    4344#define UNALIGNED(X, Y) \
    44   (((long)X & (sizeof (long) - 1)) | ((long)Y & (sizeof (long) - 1)))
     45  (((uintptr_t)X & (sizeof (long) - 1)) | ((uintptr_t)Y & (sizeof (long) - 1)))
    4546
    4647/* DETECTNULL returns nonzero if (long)X contains a NULL byte. */
    4748#if LONG_MAX == 2147483647L
  • newlib/libc/string/strncpy.c

    diff -Naur newlib-1.18.0.orig/newlib/libc/string/strncpy.c newlib-1.18.0-rtems4.10-20110518/newlib/libc/string/strncpy.c
    old new  
    3838*/
    3939
    4040#include <string.h>
     41#include <stdint.h>
    4142#include <limits.h>
    4243
    4344/*SUPPRESS 560*/
     
    4546
    4647/* Nonzero if either X or Y is not aligned on a "long" boundary.  */
    4748#define UNALIGNED(X, Y) \
    48   (((long)X & (sizeof (long) - 1)) | ((long)Y & (sizeof (long) - 1)))
     49  (((intptr_t)X & (sizeof (long) - 1)) | ((intptr_t)Y & (sizeof (long) - 1)))
    4950
    5051#if LONG_MAX == 2147483647L
    5152#define DETECTNULL(X) (((X) - 0x01010101) & ~(X) & 0x80808080)
  • newlib/libc/string/str-two-way.h

    diff -Naur newlib-1.18.0.orig/newlib/libc/string/str-two-way.h newlib-1.18.0-rtems4.10-20110518/newlib/libc/string/str-two-way.h
    old new  
    11/* Byte-wise substring search, using the Two-Way algorithm.
    2  * Copyright (C) 2008 Eric Blake
     2 * Copyright (C) 2008, 2010 Eric Blake
    33 * Permission to use, copy, modify, and distribute this software
    44 * is freely granted, provided that this notice is preserved.
    55 */
     
    335335                     a byte out of place, there can be no match until
    336336                     after the mismatch.  */
    337337                  shift = needle_len - period;
    338                   memory = 0;
    339338                }
     339                memory = 0;
    340340              j += shift;
    341341              continue;
    342342            }
  • newlib/libc/sys/rtems/crt0.c

    diff -Naur newlib-1.18.0.orig/newlib/libc/sys/rtems/crt0.c newlib-1.18.0-rtems4.10-20110518/newlib/libc/sys/rtems/crt0.c
    old new  
    2424/* RTEMS provides some of its own routines including a Malloc family */
    2525RTEMS_STUB(void *,malloc(size_t s)) { return 0; }
    2626RTEMS_STUB(void *,realloc(void* p, size_t s)) { return 0; }
    27 RTEMS_STUB(void, free(void)) { ; }
    28 RTEMS_STUB(_PTR, calloc(struct _reent *r, size_t s1, size_t s2)) {}
     27RTEMS_STUB(void, free(void* ptr)) { ; }
     28RTEMS_STUB(_PTR, calloc(size_t s1, size_t s2)) {}
    2929
    3030#if defined(__GNUC__)
    3131/*
     
    4949#endif
    5050
    5151/* stubs for functions RTEMS provides */
     52RTEMS_STUB(int, clock_gettime(clockid_t clk_id, struct timespec *tp)) { return -1; }
    5253RTEMS_STUB(int, close (int fd)) { return -1; }
    5354RTEMS_STUB(int, dup2(int oldfd, int newfd)) { return -1; }
    5455RTEMS_STUB(int, fcntl( int fd, int cmd, ... /* arg */ )) { return -1; }
     
    5657RTEMS_STUB(int, fstat(int fd, struct stat *buf)) { return -1; }
    5758RTEMS_STUB(int, getdents(int fd, void *dp, int count)) { return -1; }
    5859RTEMS_STUB(char *, getlogin(void)) { return 0; }
     60RTEMS_STUB(int, gettimeofday(struct timeval *tv, struct timezone *tz)) { return -1; }
    5961RTEMS_STUB(struct passwd *, getpwnam(const char *name)) { return 0; }
    6062RTEMS_STUB(struct passwd *, getpwuid(uid_t uid)) { return 0; }
    6163RTEMS_STUB(uid_t, getuid(void)) { return 0; }
     
    6567RTEMS_STUB(int, open(const char *pathname, int flags, int mode)) { return -1; }
    6668RTEMS_STUB(int, pipe(int pipefd[2])) { return -1; }
    6769RTEMS_STUB(_ssize_t, read(int fd, void *buf, size_t count)) { return -1; }
     70RTEMS_STUB(int, sched_yield(void)) { return -1; }
    6871RTEMS_STUB(int, sigfillset(sigset_t *set)) { return -1; }
    6972RTEMS_STUB(int, sigprocmask(int how, const sigset_t *set, sigset_t *oldset)) { return -1; }
    7073RTEMS_STUB(int, stat(const char *path, struct stat *buf)) { return -1; }
     
    9598RTEMS_STUB(int, _kill_r (struct _reent *r, int pid, int sig )) { return -1; }
    9699#if !defined(REENTRANT_SYSCALLS_PROVIDED)
    97100/* cf. newlib/libc/reent/linkr.c */
    98 RTEMS_STUB(int, _link_r (struct _reent *, const char *, const char *)) { return -1; }
     101RTEMS_STUB(int, _link_r (struct _reent *r, const char *oldpath, const char *newpath)) { return -1; }
    99102#endif
    100103RTEMS_STUB(_off_t, _lseek_r ( struct _reent *ptr, int fd, _off_t offset, int whence )) { return -1; }
    101104RTEMS_STUB(int, _open_r (struct _reent *r, const char *buf, int flags, int mode)) { return -1; }
     
    103106RTEMS_STUB(int, _rename_r (struct _reent *r, const char *a, const char *b)){ return -1; }
    104107#if !(defined (REENTRANT_SYSCALLS_PROVIDED) || defined (MALLOC_PROVIDED))
    105108/* cf. newlib/libc/reent/sbrkr.c */
    106 RTEMS_STUB(void *,_sbrk_r (struct _reent *r, ptrdiff_t)) { return -1; }
     109RTEMS_STUB(void *,_sbrk_r (struct _reent *r, ptrdiff_t addr)) { return 0; }
    107110#endif
    108111RTEMS_STUB(int, _stat_r (struct _reent *r, const char *path, struct stat *buf)) { return -1; }
    109112RTEMS_STUB(_CLOCK_T_, _times_r (struct _reent *r, struct tms *ptms)) { return -1; }
    110113RTEMS_STUB(int, _unlink_r (struct _reent *r, const char *path)) { return -1; }
    111114#if !(defined (REENTRANT_SYSCALLS_PROVIDED) || defined (NO_EXEC))
    112115/* cf. newlib/libc/reent/execr.c */
    113 RTEMS_STUB(int, _wait_r (struct _reent *r, int *)) { return -1; }
     116RTEMS_STUB(int, _wait_r (struct _reent *r, int *status)) { return -1; }
    114117#endif
    115118RTEMS_STUB(_ssize_t, _write_r (struct _reent *r, int fd, const void *buf, size_t nbytes)) { return -1; }
    116119
  • newlib/libc/sys/rtems/include/limits.h

    diff -Naur newlib-1.18.0.orig/newlib/libc/sys/rtems/include/limits.h newlib-1.18.0-rtems4.10-20110518/newlib/libc/sys/rtems/include/limits.h
    old new  
    7878 *  Invariant values
    7979 */
    8080
     81#if defined(__SIZEOF_SIZE_T__) && defined(__CHAR_BIT__)
     82#define SSIZE_MAX               ((1UL << (__SIZEOF_SIZE_T__ * __CHAR_BIT__ - 1)) - 1)
     83#else /* historic fallback, wrong in most cases */
    8184#define SSIZE_MAX               32767
     85#endif
    8286
    8387/*
    8488 *  Maximum Values
  • newlib/libc/sys/rtems/machine/_types.h

    diff -Naur newlib-1.18.0.orig/newlib/libc/sys/rtems/machine/_types.h newlib-1.18.0-rtems4.10-20110518/newlib/libc/sys/rtems/machine/_types.h
    old new  
    3131
    3232typedef __int32_t blksize_t;
    3333typedef __int32_t blkcnt_t;
     34
     35/* EXPERIMENTAL: Use 64bit types */
     36#if defined(__arm__) || defined(__i386__) || defined(__m68k__) || defined(__mips__) || defined(__PPC__) || defined(__sparc__)
     37/* Use 64bit types */
     38typedef __int64_t _off_t;
     39#define __off_t_defined 1
     40
     41typedef __int64_t _fpos_t;
     42#define __fpos_t_defined 1
     43#else
     44/* Use 32bit types */
     45typedef __int32_t _off_t;
     46#define __off_t_defined 1
     47
     48typedef __int32_t _fpos_t;
     49#define __fpos_t_defined 1
     50#endif
     51
     52typedef __uint32_t _mode_t;
     53#define __mode_t_defined 1
     54
    3455#endif
  • newlib/libc/sys/rtems/sys/dirent.h

    diff -Naur newlib-1.18.0.orig/newlib/libc/sys/rtems/sys/dirent.h newlib-1.18.0-rtems4.10-20110518/newlib/libc/sys/rtems/sys/dirent.h
    old new  
    3131void seekdir(DIR *dir, long loc);
    3232long telldir(DIR *dir);
    3333
     34#ifdef _COMPILING_NEWLIB
     35void _seekdir(DIR *dir, long offset);
     36#endif
     37
    3438#include <sys/types.h>
    3539
    3640#include <limits.h>
  • newlib/libm/common/fdlibm.h

    diff -Naur newlib-1.18.0.orig/newlib/libm/common/fdlibm.h newlib-1.18.0-rtems4.10-20110518/newlib/libm/common/fdlibm.h
    old new  
    361361  sf_u.word = (i);                                              \
    362362  (d) = sf_u.value;                                             \
    363363} while (0)
     364
     365/* Macros to avoid undefined behaviour that can arise if the amount
     366   of a shift is exactly equal to the size of the shifted operand.  */
     367
     368#define SAFE_LEFT_SHIFT(op,amt)                                 \
     369  (((amt) < 8 * sizeof(op)) ? ((op) << (amt)) : 0)
     370
     371#define SAFE_RIGHT_SHIFT(op,amt)                                \
     372  (((amt) < 8 * sizeof(op)) ? ((op) >> (amt)) : 0)
  • newlib/libm/common/modfl.c

    diff -Naur newlib-1.18.0.orig/newlib/libm/common/modfl.c newlib-1.18.0-rtems4.10-20110518/newlib/libm/common/modfl.c
    old new  
    3636long double
    3737modfl (long double x, long double *iptr)
    3838{
    39   return modf(x, iptr);
     39  return modf(x, (double*) iptr);
    4040}
    4141#endif
    4242
  • newlib/libm/common/sf_ilogb.c

    diff -Naur newlib-1.18.0.orig/newlib/libm/common/sf_ilogb.c newlib-1.18.0-rtems4.10-20110518/newlib/libm/common/sf_ilogb.c
    old new  
    1313 * ====================================================
    1414 */
    1515
    16 #include "fdlibm.h"
    1716#include <limits.h>
     17#include "fdlibm.h"
    1818
    1919#ifdef __STDC__
    2020        int ilogbf(float x)
     
    2828        GET_FLOAT_WORD(hx,x);
    2929        hx &= 0x7fffffff;
    3030        if(FLT_UWORD_IS_ZERO(hx))
    31             return - INT_MAX;   /* ilogb(0) = 0x80000001 */
     31            return FP_ILOGB0;   /* ilogb(0) = special case error */
    3232        if(FLT_UWORD_IS_SUBNORMAL(hx)) {
    3333            for (ix = -126,hx<<=8; hx>0; hx<<=1) ix -=1;
    3434            return ix;
    3535        }
     36        #if FP_ILOGBNAN != INT_MAX
     37        else if (FLT_UWORD_IS_NAN(hx)) return FP_ILOGBNAN;      /* NAN */
     38        #endif
    3639        else if (!FLT_UWORD_IS_FINITE(hx)) return INT_MAX;
    3740        else return (hx>>23)-127;
    3841}
  • newlib/libm/common/sf_llrint.c

    diff -Naur newlib-1.18.0.orig/newlib/libm/common/sf_llrint.c newlib-1.18.0-rtems4.10-20110518/newlib/libm/common/sf_llrint.c
    old new  
    7171          GET_FLOAT_WORD (i0, t);
    7272          /* Detect the all-zeros representation of plus and
    7373             minus zero, which fails the calculation below. */
    74           if ((i0 & ~(1 << 31)) == 0)
     74          if ((i0 & ~((__uint32_t)1 << 31)) == 0)
    7575              return 0;
    7676          j0 = ((i0 >> 23) & 0xff) - 0x7f;
    7777          i0 &= 0x7fffff;
  • newlib/libm/common/sf_log2.c

    diff -Naur newlib-1.18.0.orig/newlib/libm/common/sf_log2.c newlib-1.18.0-rtems4.10-20110518/newlib/libm/common/sf_log2.c
    old new  
    3030        float x;
    3131#endif
    3232{
    33   return (logf(x) / (float) M_LOG2_E);
     33  return (logf(x) / (float_t) M_LN2);
    3434}
    3535
    3636#ifdef _DOUBLE_IS_32BITS
  • newlib/libm/common/sf_rint.c

    diff -Naur newlib-1.18.0.orig/newlib/libm/common/sf_rint.c newlib-1.18.0-rtems4.10-20110518/newlib/libm/common/sf_rint.c
    old new  
    5757                i = (0x007fffff)>>j0;
    5858                if((i0&i)==0) return x; /* x is integral */
    5959                i>>=1;
    60                 if((i0&i)!=0) i0 = (i0&(~i))|((0x100000)>>j0);
     60                if((i0&i)!=0) i0 = (i0&(~i))|((0x200000)>>j0);
    6161            }
    6262        } else {
    6363            if(!FLT_UWORD_IS_FINITE(ix)) return x+x; /* inf or NaN */
  • newlib/libm/common/sf_round.c

    diff -Naur newlib-1.18.0.orig/newlib/libm/common/sf_round.c newlib-1.18.0-rtems4.10-20110518/newlib/libm/common/sf_round.c
    old new  
    3838          w &= 0x80000000;
    3939          if (exponent_less_127 == -1)
    4040            /* Result is +1.0 or -1.0. */
    41             w |= (127 << 23);
     41            w |= ((__uint32_t)127 << 23);
    4242        }
    4343      else
    4444        {
  • newlib/libm/common/s_ilogb.c

    diff -Naur newlib-1.18.0.orig/newlib/libm/common/s_ilogb.c newlib-1.18.0-rtems4.10-20110518/newlib/libm/common/s_ilogb.c
    old new  
    4444RETURNS
    4545
    4646<<ilogb>> and <<ilogbf>> return the power of two used to form the
    47 floating-point argument.  If <[val]> is <<0>>, they return <<-
    48 INT_MAX>> (<<INT_MAX>> is defined in limits.h).  If <[val]> is
    49 infinite, or NaN, they return <<INT_MAX>>.
     47floating-point argument.
     48If <[val]> is <<0>>, they return <<FP_ILOGB0>>.
     49If <[val]> is infinite, they return <<INT_MAX>>.
     50If <[val]> is NaN, they return <<FP_ILOGBNAN>>.
     51(<<FP_ILOGB0>> and <<FP_ILOGBNAN>> are defined in math.h, but in turn are
     52defined as INT_MIN or INT_MAX from limits.h.  The value of FP_ILOGB0 may be
     53either INT_MIN or -INT_MAX.  The value of FP_ILOGBNAN may be either INT_MAX or
     54INT_MIN.)
     55
     56@comment The bugs might not be worth noting, given the mass non-C99/POSIX
     57@comment behavior of much of the Newlib math library.
     58@comment BUGS
     59@comment On errors, errno is not set per C99 and POSIX requirements even if
     60@comment (math_errhandling & MATH_ERRNO) is non-zero.
    5061
    5162PORTABILITY
    52         Neither <<ilogb>> nor <<ilogbf>> is required by ANSI C or by
    53         the System V Interface Definition (Issue 2).  */
     63C99, POSIX
     64*/
    5465
    5566/* ilogb(double x)
    5667 * return the binary exponent of non-zero x
     
    5869 * ilogb(inf/NaN) = 0x7fffffff (no signal is raised)
    5970 */
    6071
    61 #include "fdlibm.h"
    6272#include <limits.h>
     73#include "fdlibm.h"
    6374
    6475#ifndef _DOUBLE_IS_32BITS
    6576
     
    7687        hx &= 0x7fffffff;
    7788        if(hx<0x00100000) {
    7889            if((hx|lx)==0)
    79                 return - INT_MAX;       /* ilogb(0) = 0x80000001 */
     90                return FP_ILOGB0;       /* ilogb(0) = special case error */
    8091            else                        /* subnormal x */
    8192                if(hx==0) {
    8293                    for (ix = -1043; lx>0; lx<<=1) ix -=1;
     
    8697            return ix;
    8798        }
    8899        else if (hx<0x7ff00000) return (hx>>20)-1023;
    89         else return INT_MAX;
     100        #if FP_ILOGBNAN != INT_MAX
     101        else if (hx>0x7ff00000) return FP_ILOGBNAN;     /* NAN */
     102        #endif
     103        else return INT_MAX;    /* infinite (or, possibly, NAN) */
    90104}
    91105
    92106#endif /* _DOUBLE_IS_32BITS */
  • newlib/libm/common/s_llrint.c

    diff -Naur newlib-1.18.0.orig/newlib/libm/common/s_llrint.c newlib-1.18.0-rtems4.10-20110518/newlib/libm/common/s_llrint.c
    old new  
    6161
    6262  /* Extract exponent field. */
    6363  j0 = ((i0 & 0x7ff00000) >> 20) - 1023;
     64  /* j0 in [-1023,1024] */
    6465 
    6566  if(j0 < 20)
    6667    {
     68      /* j0 in [-1023,19] */
    6769      if(j0 < -1)
    6870        return 0;
    6971      else
    7072        {
     73          /* j0 in [0,19] */
     74          /* shift amt in [0,19] */
    7175          w = TWO52[sx] + x;
    7276          t = w - TWO52[sx];
    7377          GET_HIGH_WORD(i0, t);
    7478          /* Detect the all-zeros representation of plus and
    7579             minus zero, which fails the calculation below. */
    76           if ((i0 & ~(1 << 31)) == 0)
     80          if ((i0 & ~((__int32_t)1 << 31)) == 0)
    7781              return 0;
     82          /* After round:  j0 in [0,20] */
    7883          j0 = ((i0 & 0x7ff00000) >> 20) - 1023;
    7984          i0 &= 0x000fffff;
    8085          i0 |= 0x00100000;
     86          /* shift amt in [20,0] */
    8187          result = i0 >> (20 - j0);
    8288        }
    8389    }
    8490  else if (j0 < (int)(8 * sizeof (long long int)) - 1)
    8591    {
     92      /* 64bit return: j0 in [20,62] */
    8693      if (j0 >= 52)
     94        /* 64bit return: j0 in [52,62] */
     95        /* 64bit return: left shift amt in [32,42] */
    8796        result = ((long long int) ((i0 & 0x000fffff) | 0x0010000) << (j0 - 20)) |
     97                /* 64bit return: right shift amt in [0,10] */
    8898                   (i1 << (j0 - 52));
    8999      else
    90100        {
     101          /* 64bit return: j0 in [20,51] */
    91102          w = TWO52[sx] + x;
    92103          t = w - TWO52[sx];
    93104          EXTRACT_WORDS (i0, i1, t);
    94105          j0 = ((i0 & 0x7ff00000) >> 20) - 1023;
    95106          i0 &= 0x000fffff;
    96107          i0 |= 0x00100000;
    97           result = ((long long int) i0 << (j0 - 20)) | (i1 >> (52 - j0));
     108          /* After round:
     109           * 64bit return: j0 in [20,52] */
     110          /* 64bit return: left shift amt in [0,32] */
     111          /* ***64bit return: right shift amt in [32,0] */
     112          result = ((long long int) i0 << (j0 - 20))
     113                        | SAFE_RIGHT_SHIFT (i1, (52 - j0));
    98114        }
    99115    }
    100116  else
  • newlib/libm/common/s_llround.c

    diff -Naur newlib-1.18.0.orig/newlib/libm/common/s_llround.c newlib-1.18.0-rtems4.10-20110518/newlib/libm/common/s_llround.c
    old new  
    3131  msw &= 0x000fffff;
    3232  msw |= 0x00100000;
    3333
     34  /* exponent_less_1023 in [-1023,1024] */
    3435  if (exponent_less_1023 < 20)
    3536    {
     37      /* exponent_less_1023 in [-1023,19] */
    3638      if (exponent_less_1023 < 0)
    3739        {
    3840          if (exponent_less_1023 < -1)
     
    4244        }
    4345      else
    4446        {
     47          /* exponent_less_1023 in [0,19] */
     48          /* shift amt in [0,19] */
    4549          msw += 0x80000 >> exponent_less_1023;
     50          /* shift amt in [20,1] */
    4651          result = msw >> (20 - exponent_less_1023);
    4752        }
    4853    }
    4954  else if (exponent_less_1023 < (8 * sizeof (long long int)) - 1)
    5055    {
     56      /* 64bit longlong: exponent_less_1023 in [20,62] */
    5157      if (exponent_less_1023 >= 52)
    52         result = ((long long int) msw << (exponent_less_1023 - 20)) | (lsw << (exponent_less_1023 - 52));
     58        /* 64bit longlong: exponent_less_1023 in [52,62] */
     59        /* 64bit longlong: shift amt in [32,42] */
     60        result = ((long long int) msw << (exponent_less_1023 - 20))
     61                    /* 64bit longlong: shift amt in [0,10] */
     62                    | (lsw << (exponent_less_1023 - 52));
    5363      else
    5464        {
    55           unsigned int tmp = lsw + (0x80000000 >> (exponent_less_1023 - 20));
     65          /* 64bit longlong: exponent_less_1023 in [20,51] */
     66          unsigned int tmp = lsw
     67                    /* 64bit longlong: shift amt in [0,31] */
     68                    + (0x80000000 >> (exponent_less_1023 - 20));
    5669          if (tmp < lsw)
    5770            ++msw;
    58           result = ((long long int) msw << (exponent_less_1023 - 20)) | (tmp >> (52 - exponent_less_1023));
     71          /* 64bit longlong: shift amt in [0,31] */
     72          result = ((long long int) msw << (exponent_less_1023 - 20))
     73                    /* ***64bit longlong: shift amt in [32,1] */
     74                    | SAFE_RIGHT_SHIFT (tmp, (52 - exponent_less_1023));
    5975        }
    6076    }
    6177  else
  • newlib/libm/common/s_log2.c

    diff -Naur newlib-1.18.0.orig/newlib/libm/common/s_log2.c newlib-1.18.0-rtems4.10-20110518/newlib/libm/common/s_log2.c
    old new  
    3434rather are derivatives based on <<log>>.  (Accuracy might be slightly off from
    3535a direct calculation.)  In addition to functions, they are also implemented as
    3636macros defined in math.h:
    37 . #define log2(x) (log (x) / _M_LOG2_E)
    38 . #define log2f(x) (logf (x) / (float) _M_LOG2_E)
     37. #define log2(x) (log (x) / _M_LN2)
     38. #define log2f(x) (logf (x) / (float) _M_LN2)
    3939To use the functions instead, just undefine the macros first.
    4040
    4141You can use the (non-ANSI) function <<matherr>> to specify error
     
    7979        double x;
    8080#endif
    8181{
    82   return (log(x) / M_LOG2_E);
     82  return (log(x) / M_LN2);
    8383}
    8484
    8585#endif /* defined(_DOUBLE_IS_32BITS) */
  • newlib/libm/common/s_lrint.c

    diff -Naur newlib-1.18.0.orig/newlib/libm/common/s_lrint.c newlib-1.18.0-rtems4.10-20110518/newlib/libm/common/s_lrint.c
    old new  
    9898
    9999  /* Extract exponent field. */
    100100  j0 = ((i0 & 0x7ff00000) >> 20) - 1023;
     101  /* j0 in [-1023,1024] */
    101102 
    102103  if(j0 < 20)
    103104    {
     105      /* j0 in [-1023,19] */
    104106      if(j0 < -1)
    105107        return 0;
    106108      else
    107109        {
     110          /* j0 in [0,19] */
     111          /* shift amt in [0,19] */
    108112          w = TWO52[sx] + x;
    109113          t = w - TWO52[sx];
    110114          GET_HIGH_WORD(i0, t);
     
    112116             minus zero, which fails the calculation below. */
    113117          if ((i0 & ~(1L << 31)) == 0)
    114118              return 0;
     119          /* After round:  j0 in [0,20] */
    115120          j0 = ((i0 & 0x7ff00000) >> 20) - 1023;
    116121          i0 &= 0x000fffff;
    117122          i0 |= 0x00100000;
     123          /* shift amt in [20,0] */
    118124          result = i0 >> (20 - j0);
    119125        }
    120126    }
    121127  else if (j0 < (int)(8 * sizeof (long int)) - 1)
    122128    {
     129      /* 32bit return: j0 in [20,30] */
     130      /* 64bit return: j0 in [20,62] */
    123131      if (j0 >= 52)
     132        /* 64bit return: j0 in [52,62] */
     133        /* 64bit return: left shift amt in [32,42] */
    124134        result = ((long int) ((i0 & 0x000fffff) | 0x0010000) << (j0 - 20)) |
     135                /* 64bit return: right shift amt in [0,10] */
    125136                   (i1 << (j0 - 52));
    126137      else
    127138        {
     139          /* 32bit return: j0 in [20,30] */
     140          /* 64bit return: j0 in [20,51] */
    128141          w = TWO52[sx] + x;
    129142          t = w - TWO52[sx];
    130143          EXTRACT_WORDS (i0, i1, t);
    131144          j0 = ((i0 & 0x7ff00000) >> 20) - 1023;
    132145          i0 &= 0x000fffff;
    133146          i0 |= 0x00100000;
    134           result = ((long int) i0 << (j0 - 20)) | (i1 >> (52 - j0));
     147          /* After round:
     148           * 32bit return: j0 in [20,31];
     149           * 64bit return: j0 in [20,52] */
     150          /* 32bit return: left shift amt in [0,11] */
     151          /* 64bit return: left shift amt in [0,32] */
     152          /* ***32bit return: right shift amt in [32,21] */
     153          /* ***64bit return: right shift amt in [32,0] */
     154          result = ((long int) i0 << (j0 - 20))
     155                        | SAFE_RIGHT_SHIFT (i1, (52 - j0));
    135156        }
    136157    }
    137158  else
  • newlib/libm/common/s_lround.c

    diff -Naur newlib-1.18.0.orig/newlib/libm/common/s_lround.c newlib-1.18.0-rtems4.10-20110518/newlib/libm/common/s_lround.c
    old new  
    7171  exponent_less_1023 = ((msw & 0x7ff00000) >> 20) - 1023;
    7272  msw &= 0x000fffff;
    7373  msw |= 0x00100000;
    74 
     74  /* exponent_less_1023 in [-1023,1024] */
    7575  if (exponent_less_1023 < 20)
    7676    {
     77      /* exponent_less_1023 in [-1023,19] */
    7778      if (exponent_less_1023 < 0)
    7879        {
    7980          if (exponent_less_1023 < -1)
     
    8384        }
    8485      else
    8586        {
     87          /* exponent_less_1023 in [0,19] */
     88          /* shift amt in [0,19] */
    8689          msw += 0x80000 >> exponent_less_1023;
     90          /* shift amt in [20,1] */
    8791          result = msw >> (20 - exponent_less_1023);
    8892        }
    8993    }
    9094  else if (exponent_less_1023 < (8 * sizeof (long int)) - 1)
    9195    {
     96      /* 32bit long: exponent_less_1023 in [20,30] */
     97      /* 64bit long: exponent_less_1023 in [20,62] */
    9298      if (exponent_less_1023 >= 52)
    93         result = ((long int) msw << (exponent_less_1023 - 20)) | (lsw << (exponent_less_1023 - 52));
     99        /* 64bit long: exponent_less_1023 in [52,62] */
     100        /* 64bit long: shift amt in [32,42] */
     101        result = ((long int) msw << (exponent_less_1023 - 20))
     102                /* 64bit long: shift amt in [0,10] */
     103                | (lsw << (exponent_less_1023 - 52));
    94104      else
    95105        {
    96           unsigned int tmp = lsw + (0x80000000 >> (exponent_less_1023 - 20));
     106          /* 32bit long: exponent_less_1023 in [20,30] */
     107          /* 64bit long: exponent_less_1023 in [20,51] */
     108          unsigned int tmp = lsw
     109                    /* 32bit long: shift amt in [0,10] */
     110                    /* 64bit long: shift amt in [0,31] */
     111                    + (0x80000000 >> (exponent_less_1023 - 20));
    97112          if (tmp < lsw)
    98113            ++msw;
    99           result = ((long int) msw << (exponent_less_1023 - 20)) | (tmp >> (52 - exponent_less_1023));
     114          /* 32bit long: shift amt in [0,10] */
     115          /* 64bit long: shift amt in [0,31] */
     116          result = ((long int) msw << (exponent_less_1023 - 20))
     117                    /* ***32bit long: shift amt in [32,22] */
     118                    /* ***64bit long: shift amt in [32,1] */
     119                    | SAFE_RIGHT_SHIFT (tmp, (52 - exponent_less_1023));
    100120        }
    101121    }
    102122  else
  • newlib/libm/common/s_rint.c

    diff -Naur newlib-1.18.0.orig/newlib/libm/common/s_rint.c newlib-1.18.0-rtems4.10-20110518/newlib/libm/common/s_rint.c
    old new  
    5151 * rounding mode.
    5252 * Method:
    5353 *      Using floating addition.
     54 *      Whenever a fraction is present, if the second or any following bit after
     55 *      the radix point is set, limit to the second radix point to avoid
     56 *      possible double rounding in the TWO52 +- steps (in case guard bits are
     57 *      used).  Specifically, if have any, chop off bits past the 2nd place and
     58 *      set the second place.
     59 *      (e.g.   2.0625=0b10.0001 => 0b10.01=2.25;
     60 *              2.3125=0b10.011  => 0b10.01=2.25;
     61 *              1.5625= 0b1.1001 =>  0b1.11=1.75;
     62 *              1.9375= 0b1.1111 =>  0b1.11=1.75.
     63 *      Pseudo-code:  if(x.frac & ~0b0.10) x.frac = (x.frac & 0b0.11) | 0b0.01;).
    5464 * Exception:
    5565 *      Inexact flag raised if x not equal to rint(x).
    5666 */
     
    8191        double t;
    8292        volatile double w;
    8393        EXTRACT_WORDS(i0,i1,x);
    84         sx = (i0>>31)&1;
    85         j0 = ((i0>>20)&0x7ff)-0x3ff;
    86         if(j0<20) {
    87             if(j0<0) { 
    88                 if(((i0&0x7fffffff)|i1)==0) return x;
     94        sx = (i0>>31)&1;                /* sign */
     95        j0 = ((i0>>20)&0x7ff)-0x3ff;    /* exponent */
     96        if(j0<20) {                     /* no integral bits in LS part */
     97            if(j0<0) {                  /* x is fractional or 0 */
     98                if(((i0&0x7fffffff)|i1)==0) return x;   /* x == 0 */
    8999                i1 |= (i0&0x0fffff);
    90100                i0 &= 0xfffe0000;
    91101                i0 |= ((i1|-i1)>>12)&0x80000;
     
    95105                GET_HIGH_WORD(i0,t);
    96106                SET_HIGH_WORD(t,(i0&0x7fffffff)|(sx<<31));
    97107                return t;
    98             } else {
     108            } else {                    /* x has integer and maybe fraction */
    99109                i = (0x000fffff)>>j0;
    100110                if(((i0&i)|i1)==0) return x; /* x is integral */
    101111                i>>=1;
    102112                if(((i0&i)|i1)!=0) {
    103                     if(j0==19) i1 = 0x40000000; else
    104                     i0 = (i0&(~i))|((0x20000)>>j0);
     113                    /* 2nd or any later bit after radix is set */
     114                    if(j0==19) i1 = 0x80000000; else i1 = 0;
     115                    i0 = (i0&(~i))|((0x40000)>>j0);
    105116                }
    106117            }
    107118        } else if (j0>51) {
     
    119130}
    120131
    121132#endif /* _DOUBLE_IS_32BITS */
    122 
    123 
    124 
  • newlib/libm/common/s_round.c

    diff -Naur newlib-1.18.0.orig/newlib/libm/common/s_round.c newlib-1.18.0-rtems4.10-20110518/newlib/libm/common/s_round.c
    old new  
    6868          msw &= 0x80000000;
    6969          if (exponent_less_1023 == -1)
    7070            /* Result is +1.0 or -1.0. */
    71             msw |= (1023 << 20);
     71            msw |= ((__int32_t)1023 << 20);
    7272          lsw = 0;
    7373        }
    7474      else
  • newlib/libm/math/e_scalb.c

    diff -Naur newlib-1.18.0.orig/newlib/libm/math/e_scalb.c newlib-1.18.0-rtems4.10-20110518/newlib/libm/math/e_scalb.c
    old new  
    1717 * should use scalbn() instead.
    1818 */
    1919
     20#include <limits.h>
    2021#include "fdlibm.h"
    2122
    2223#ifndef _DOUBLE_IS_32BITS
     
    4647            else       return x/(-fn);
    4748        }
    4849        if (rint(fn)!=fn) return (fn-fn)/(fn-fn);
     50#if (INT_MAX < 65000)
     51        if ( fn > (double) INT_MAX) return scalbn(x, INT_MAX);
     52#else
    4953        if ( fn > 65000.0) return scalbn(x, 65000);
    50         if (-fn > 65000.0) return scalbn(x,-65000);
     54#endif
     55
     56#if (INT_MIN > -65000)
     57        if (fn < (double) INT_MIN) return scalbn(x,INT_MIN);
     58#else
     59        if (fn < -65000.0) return scalbn(x,-65000);
     60#endif
    5161        return scalbn(x,(int)fn);
    5262#endif
    5363}
  • newlib/libm/math/wf_tgamma.c

    diff -Naur newlib-1.18.0.orig/newlib/libm/math/wf_tgamma.c newlib-1.18.0-rtems4.10-20110518/newlib/libm/math/wf_tgamma.c
    old new  
    4343        return y;
    4444#endif
    4545}
     46
     47#ifdef _DOUBLE_IS_32BITS
     48
     49#ifdef __STDC__
     50        double tgamma(double x)
     51#else
     52        double tgamma(x)
     53        double x;
     54#endif
     55{
     56        return (double) tgammaf((float) x);
     57}
     58
     59#endif /* defined(_DOUBLE_IS_32BITS) */
  • newlib/libm/math/w_tgamma.c

    diff -Naur newlib-1.18.0.orig/newlib/libm/math/w_tgamma.c newlib-1.18.0-rtems4.10-20110518/newlib/libm/math/w_tgamma.c
    old new  
    1717
    1818#include "fdlibm.h"
    1919
     20#ifndef _DOUBLE_IS_32BITS
     21
    2022#ifdef __STDC__
    2123        double tgamma(double x)
    2224#else
     
    4244        return y;
    4345#endif
    4446}
     47
     48#endif /* defined(_DOUBLE_IS_32BITS) */
  • newlib/Makefile.am

    diff -Naur newlib-1.18.0.orig/newlib/Makefile.am newlib-1.18.0-rtems4.10-20110518/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
  • newlib/Makefile.in

    diff -Naur newlib-1.18.0.orig/newlib/Makefile.in newlib-1.18.0-rtems4.10-20110518/newlib/Makefile.in
    old new  
    122122        install-pdf-recursive install-ps-recursive install-recursive \
    123123        installcheck-recursive installdirs-recursive pdf-recursive \
    124124        ps-recursive uninstall-recursive
    125 DATA = $(noinst_DATA) $(toollib_DATA)
     125DATA = $(toollib_DATA)
    126126RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
    127127  distclean-recursive maintainer-clean-recursive
    128128AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
     
    351351@USE_LIBTOOL_FALSE@toollib_LIBRARIES = libm.a \
    352352@USE_LIBTOOL_FALSE@     libc.a
    353353
    354 noinst_DATA = stmp-targ-include
     354BUILT_SOURCES = stmp-targ-include
    355355toollib_DATA = $(CRT0) $(CRT1)
    356356
    357357# The functions ldexp, frexp and modf are traditionally supplied in
     
    411411
    412412# dejagnu support
    413413RUNTESTFLAGS =
    414 all: newlib.h
     414all: $(BUILT_SOURCES) newlib.h
    415415        $(MAKE) $(AM_MAKEFLAGS) all-recursive
    416416
    417417.SUFFIXES:
     
    725725        done
    726726check-am:
    727727        $(MAKE) $(AM_MAKEFLAGS) check-DEJAGNU
    728 check: check-recursive
     728check: $(BUILT_SOURCES)
     729        $(MAKE) $(AM_MAKEFLAGS) check-recursive
    729730all-am: Makefile $(LIBRARIES) $(LTLIBRARIES) $(DATA) newlib.h
    730731installdirs: installdirs-recursive
    731732installdirs-am:
    732733        for dir in "$(DESTDIR)$(toollibdir)" "$(DESTDIR)$(toollibdir)" "$(DESTDIR)$(toollibdir)"; do \
    733734          test -z "$$dir" || $(MKDIR_P) "$$dir"; \
    734735        done
    735 install: install-recursive
     736install: $(BUILT_SOURCES)
     737        $(MAKE) $(AM_MAKEFLAGS) install-recursive
    736738install-exec: install-exec-recursive
    737739install-data: install-data-recursive
    738740uninstall: uninstall-recursive
     
    758760maintainer-clean-generic:
    759761        @echo "This command is intended for maintainers to use"
    760762        @echo "it deletes files that may require special tools to rebuild."
     763        -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
    761764clean: clean-recursive
    762765
    763766clean-am: clean-generic clean-libtool clean-toollibLIBRARIES \
     
    833836uninstall-am: uninstall-toollibDATA uninstall-toollibLIBRARIES \
    834837        uninstall-toollibLTLIBRARIES
    835838
    836 .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all check-am \
    837         ctags-recursive install-am install-strip tags-recursive
     839.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all check \
     840        check-am ctags-recursive install install-am install-strip \
     841        tags-recursive
    838842
    839843.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
    840844        all all-am am--refresh check check-DEJAGNU check-am clean \
Note: See TracBrowser for help on using the repository browser.