source:
rtems-tools/tools/4.10/newlib/newlib-1.18.0-rtems4.10-20110518.diff
@
038b250
Last change on this file since 038b250 was 038b250, checked in by Chris Johns <chrisj@…>, on 03/19/13 at 06:16:54 | |
---|---|
|
|
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 1 2011-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 6 2011-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 12 2011-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 17 2011-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 22 2011-01-31 Ralf Corsépius <ralf.corsepius@rtems.org> 23 24 * libc/sys/rtems/crt0.c: Add clock_gettime, gettimeofday, 25 sched_yield. 26 27 2011-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 32 2011-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 1 37 2009-12-17 Jeff Johnston <jjohnstn@redhat.com> 2 38 3 39 * NEWS: Update with 1.18.0 info. … … 41 77 * libc/stdlib/atexit.c: Ditto. 42 78 * libc/stdlib/on_exit.c: Ditto. 43 79 44 2009-12-17 Ralf Corsà ©pius <ralf.corsepius@rtems.org>80 2009-12-17 Ralf Corsépius <ralf.corsepius@rtems.org> 45 81 46 82 * 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 48 84 libc/include/machine/endian.h) 49 85 50 2009-12-17 Ralf Corsà ©pius <ralf.corsepius@rtems.org>86 2009-12-17 Ralf Corsépius <ralf.corsepius@rtems.org> 51 87 52 88 * libc/include/machine/setjmp.h: Set up _JBLEN #ifdef __m68k__. 53 89 54 2009-12-17 Ralf Cors epius <ralf.corsepius@rtems.org>90 2009-12-17 Ralf Corsépius <ralf.corsepius@rtems.org> 55 91 56 * libc/include/pthread.h: Add pthread_atfork, pthread_rwlock_unlock 92 * libc/include/pthread.h: Add pthread_atfork, pthread_rwlock_unlock 57 93 * libc/include/sys/stat.h: Use struct timespec st_*tim, 58 94 blksize_t st_blksize, blkcnt_t st_blocks. 59 95 Add st_*time compatibility macros. … … 69 105 and ETOOMANYREFS into general list as they are referenced 70 106 by OpenGroup and needed by RTEMS. 71 107 72 2009-12-16 Ralf Corsà ©pius <ralf.corsepius@rtems.org>108 2009-12-16 Ralf Corsépius <ralf.corsepius@rtems.org> 73 109 74 110 * libc/search/hcreate.c: Don't include <sys/queue.h> (Unused). 75 111 76 2009-12-16 Ralf Corsà ©pius <ralf.corsepius@rtems.org>112 2009-12-16 Ralf Corsépius <ralf.corsepius@rtems.org> 77 113 78 * libc/sys/rtems/machine/_types.h: New (Derived from 114 * libc/sys/rtems/machine/_types.h: New (Derived from 79 115 machine/_default_types.h). 80 116 * libc/sys/rtems/crt0.c: Rework. Introduce macro RTEMS_STUB. 81 117 * libc/sys/rtems/sys/param.h: 82 83 84 85 86 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). 87 123 * libc/sys/rtems/sys/queue.h: Update copyright (from FreeBSD). 88 124 Remove CIRCLEQ_*. 89 125 90 126 2009-12-15 Conny Marco Menebrocker <c-m-m@gmx.de> 91 127 … … 1666 1702 1667 1703 * libc/machine/arm/strcpy.c: Add missing comma. 1668 1704 1669 2009-02-26 Ralf Cors epius <ralf.corsepius@rtems.org>1705 2009-02-26 Ralf Corsépius <ralf.corsepius@rtems.org> 1670 1706 1671 1707 * libc/machine/lm32/configure.in: Let 1672 1708 AC_CONFIG_SRCDIR point to setjmp.S instead of setjmp.s … … 1852 1888 * libc/string/wcstrings.tex: Ditto. 1853 1889 * libc/string/Makefile.in: Regenerated. 1854 1890 1855 2008-12-12 Ralf Cors epius <ralf.corsepius@rtems.org>1891 2008-12-12 Ralf Corsépius <ralf.corsepius@rtems.org> 1856 1892 1857 1893 * libc/stdio/fputws.c: Fix documentation. 1858 1894 * libc/stdio/getwchar.c: Ditto. 1859 1895 * libc/stdio/putwchar.c: Ditto. 1860 1896 1861 2008-12-12 Ralf Cors epius <ralf.corsepius@rtems.org>1897 2008-12-12 Ralf Corsépius <ralf.corsepius@rtems.org> 1862 1898 1863 1899 * libc/include/sys/features.h: Set RTEMS's _POSIX_MONOTONIC_CLOCK to 1864 1900 200112L (SUSv3 compliance). 1865 1901 Comment out RTEMS's _POSIX_SHARED_MEMORY_OBJECTS (Unsupported). 1866 1902 1867 2008-12-12 Ralf Cors epius <ralf.corsepius@rtems.org>1903 2008-12-12 Ralf Corsépius <ralf.corsepius@rtems.org> 1868 1904 1869 1905 * libc/sys/rtems/crt0.c: Add stubs for getdents(), nanosleep(), 1870 1906 _execve(), _exit(). 1871 1907 1872 2008-12-12 Ralf Cors epius <ralf.corsepius@rtems.org>1908 2008-12-12 Ralf Corsépius <ralf.corsepius@rtems.org> 1873 1909 1874 1910 * configure.host: Let *rtems* default to c99-formats. 1875 1911 … … 2019 2055 <linux/dirent.h>. 2020 2056 * libc/sys/linux/io64.c: Add weak alias for _stat64. 2021 2057 2022 2008-11-27 Ralf Cors epius <ralf.corsepius@rtems.org>2058 2008-11-27 Ralf Corsépius <ralf.corsepius@rtems.org> 2023 2059 2024 2060 * libc/posix/telldir.c: Use #if !defined() instead of #ifndef 2025 2061 to fix GCC warning. … … 2191 2227 * libc/unix/collate.c (__collate_err): simplify to remove unnecessary 2192 2228 strdup() and strlen() calls, also getting rid of a compiler warning. 2193 2229 2194 2008-11-19 Ralf Cors epius <ralf.corsepius@rtems.org>2230 2008-11-19 Ralf Corsépius <ralf.corsepius@rtems.org> 2195 2231 2196 2232 * libc/include/sys/config.h: Don't put 2197 2233 __ATTRIBUTE_IMPURE_PTR__ into .sdata section for mips-rtems. 2198 2234 2199 2008-11-19 Ralf Cors epius <ralf.corsepius@rtems.org>2235 2008-11-19 Ralf Corsépius <ralf.corsepius@rtems.org> 2200 2236 2201 2237 * libc/posix/runetype.h: Add include of stddef.h and remove 2202 2238 defining standard types: size_t and wchar_t. 2203 2239 2204 2008-11-19 Ralf Cors epius <ralf.corsepius@rtems.org>2240 2008-11-19 Ralf Corsépius <ralf.corsepius@rtems.org> 2205 2241 2206 2242 * libc/include/pthread.h: Remove prototypes for 2207 2243 pthread_attr_getcputime and pthread_attr_setcputime which … … 4256 4292 * libc/machine/spu/sprintf.c: Ditto. 4257 4293 * libc/machine/spu/sscanf.c: Ditto. 4258 4294 4259 2007-08-03 Ralf Cors epius <ralf.corsepius@rtems.org>4295 2007-08-03 Ralf Corsépius <ralf.corsepius@rtems.org> 4260 4296 4261 4297 * libc/include/tar.h: New. 4262 4298 … … 6241 6277 * libc/include/sys/signal.h (sigdelset, sigfillset, sigismember): New macros. 6242 6278 (sigaddset, sigemptyset): Add return code. 6243 6279 6244 2006-04-13 Ralf Cors epius <ralf.corsepius@rtems.org>6280 2006-04-13 Ralf Corsépius <ralf.corsepius@rtems.org> 6245 6281 6246 6282 * acinclude.m4: New _NEWLIB_VERSION. 6247 6283 * acinclude.m4(NEWLIB_CONFIGURE): AC_REQUIRE(_NEWLIB_VERSION). … … 6730 6766 * libc/sys/linux/sys/stat.h: Change *stat64 prototypes to 6731 6767 take a pointer to struct stat64 rather than struct stat. 6732 6768 6733 2005-12-16 Ralf Cors epius <ralf.corsepius@rtems.org>6769 2005-12-16 Ralf Corsépius <ralf.corsepius@rtems.org> 6734 6770 6735 6771 * libc/include/stdint.h: Prefer long over int for int32_t. 6736 6772 Use __have_long32 to set up int32_t. … … 6759 6795 * libc/include/sys/types.h: Remove the ifdef armour around 6760 6796 standard POSIX types. 6761 6797 6762 2005-12-06 Ralf Cors epius <ralf.corsepius@rtems.org>6798 2005-12-06 Ralf Corsépius <ralf.corsepius@rtems.org> 6763 6799 6764 6800 * libc/sys/rtems/crt0.c: Add rtems_gxx_key_create, 6765 6801 rtems_gxx_key_delete, rtems_gxx_getspecific, … … 6838 6874 * libc/sys/linux/sys/unistd.h (readlink, symlink): New 6839 6875 prototypes. 6840 6876 6841 2005-11-01 Ralf Cors epius <ralf.corsepius@rtems.org>6877 2005-11-01 Ralf Corsépius <ralf.corsepius@rtems.org> 6842 6878 6843 6879 * libc/include/stdint.h: Cleanup #if vs. #ifdef. 6844 6880 … … 7062 7098 * libc/stdlib/mallocr.c (mALLOc, rEALLOCc, mEMALIGn): Set errno 7063 7099 to ENOMEM on failure. 7064 7100 7065 2005-10-06 Ralf Cors epius <ralf.corsepius@rtems.org>7101 2005-10-06 Ralf Corsépius <ralf.corsepius@rtems.org> 7066 7102 7067 7103 * libc/include/stdint.h: Add [u]int_fast<N>_t types. 7068 7104 7069 2005-10-04 Ralf Cors epius <ralf.corsepius@rtems.org>7105 2005-10-04 Ralf Corsépius <ralf.corsepius@rtems.org> 7070 7106 7071 7107 * libc/include/stdint.h: Move magic to set __have_long* to the 7072 7108 beginning. Use #if __have* instead of #if defined(__have*). … … 7082 7118 * libc/sys/linux/include/stdint.h: Include <sys/types.h> and 7083 7119 incorporate Ralf's change below. 7084 7120 7085 2005-10-03 Ralf Cors epius <ralf.corsepius@rtems.org>7121 2005-10-03 Ralf Corsépius <ralf.corsepius@rtems.org> 7086 7122 7087 7123 * libc/include/stdint.h: 7088 7124 Use __INTMAX_TYPE__ to derive intmax_t. 7089 7125 Use __UINTMAX_TYPE__ to derive uintmax_t. 7090 7126 Fix minor typo. 7091 7127 7092 2005-09-27 Ralf Cors epius <ralf.corsepius@rtems.org>7128 2005-09-27 Ralf Corsépius <ralf.corsepius@rtems.org> 7093 7129 7094 7130 * libc/include/stdint.h: Correct __STDINT_EXP macro incorrectly 7095 7131 handling GCC >= 4. … … 7425 7461 * configure.host (newlib_cflags) <cris-*-*, crisv32-*-*>: Add 7426 7462 -DCOMPACT_CTYPE. 7427 7463 7428 2005-03-06 Ralf Cors epious <ralf.corsepius@rtems.org>7464 2005-03-06 Ralf Corsépius <ralf.corsepius@rtems.org> 7429 7465 7430 7466 * libc/sys/rtems/include/inttypes.h: New file. 7431 7467 * libc/sys/rtems/include/stdint.h: Ditto. 7432 7468 7433 2005-03-06 Ralf Cors epious <ralf.corsepius@rtems.org>7469 2005-03-06 Ralf Corsépius <ralf.corsepius@rtems.org> 7434 7470 7435 7471 * libc/string/memcmp.c: Fix to avoid pointer signedness warning. 7436 7472 7437 2005-03-06 Ralf Cors epious <ralf.corsepius@rtems.org>7473 2005-03-06 Ralf Corsépius <ralf.corsepius@rtems.org> 7438 7474 7439 7475 * libc/include/machine/_types.h: New file. 7440 7476 * libc/include/sys/types.h: Do not check for __rtems__ … … 7443 7479 * libc/sys/rtems/machine/_types.h: Removed. Replaced with 7444 7480 shared header file. 7445 7481 7446 2005-02-25 Ralf Cors epious <ralf.corsepius@rtems.org>7482 2005-02-25 Ralf Corsépius <ralf.corsepius@rtems.org> 7447 7483 7448 7484 * libm/common/fdlibm.h (FLT_UWORD_MAX, FLT_UWORD_HALF_MAX): Add 7449 7485 L qualifier for these long constants. … … 7459 7495 * libc/time/strftime.c (strftime): Fix '%x' to deal with negative 7460 7496 years. Fix '%z' to use long, not int. 7461 7497 7462 2005-02-24 Ralf Cors epious <ralf.corsepius@rtems.org>7498 2005-02-24 Ralf Corsépius <ralf.corsepius@rtems.org> 7463 7499 7464 7500 * libm/common/s_fpclassify.c: Use __uint32_t instead of int to 7465 7501 manipulate float values in integer form. 7466 7502 * libm/common/sf_round.c: Ditto. 7467 7503 7468 2005-02-24 Ralf Cors epious <ralf.corsepius@rtems.org>7504 2005-02-24 Ralf Corsépius <ralf.corsepius@rtems.org> 7469 7505 7470 7506 * libc/include/sys/types.h [__rtems__]: Include new 7471 7507 header file machine/_types.h. … … 7829 7865 * libc/stdio/fread.c (fread): Fix return value for unbuffered 7830 7866 fread. 7831 7867 7832 2004-10-25 Ralf Cors epius <corsepiu@faw.uni-ulm.de>7868 2004-10-25 Ralf Corsépius <corsepiu@faw.uni-ulm.de> 7833 7869 7834 7870 * libc/include/machine/setjmp.h: Add AVR support. 7835 7871 * libc/sys/rtems/crt0.S [__AVR__]: Add __stack. … … 14061 14097 14062 14098 * libc/include/sys/unistd.h: Prototype chroot() for RTEMS. 14063 14099 14064 2001-08-29 Ralf Cors epius <corsepiu@faw.uni-ulm.de>14100 2001-08-29 Ralf Corsépius <corsepiu@faw.uni-ulm.de> 14065 14101 14066 14102 * libc/machine/i386/f_atan2.S, libc/machine/i386/f_atan2f.S, 14067 14103 libc/machine/i386/f_exp.c, libc/machine/i386/f_expf.c, … … 14738 14774 * libc/sys/linux/sys/utsname.h: Ditto. 14739 14775 * libc/sys/linux/sys/wait.h: Ditto. 14740 14776 14741 2000-12-08 Ralf Cors epius <corsepiu@faw.uni-ulm.de>14777 2000-12-08 Ralf Corsépius <corsepiu@faw.uni-ulm.de> 14742 14778 14743 14779 * Makefile.am: $(INSTALL), $(INSTALL_DATA), and $(INSTALL_PROGRAM) 14744 14780 can be a relative path to $(top_srcdir)/install.sh so ensure the … … 15643 15679 * libc/include/stdlib.h: add ptsname, grantpt, unlockpt to cygwin 15644 15680 section 15645 15681 15646 Sat Oct 2 02:02:00 MEST 1999 Ralf Cors epius <corsepiu@faw.uni-ulm.de>15682 Sat Oct 2 02:02:00 MEST 1999 Ralf Corsépius <corsepiu@faw.uni-ulm.de> 15647 15683 15648 15684 * libc/machine/sh/asm.h: Added __SH4_SINGLE__ to DELAYED_BRANCHES 15649 15685 * 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 1 2011-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 9 2011-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 14 2011-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 19 2011-01-05 Ralf Corsépius <ralf.corsepius@rtems.org> 20 21 * libm/common/s_llrint.c: Back-port from newlib-cvs. 22 23 2011-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 30 2011-01-05 Ralf Corsépius <ralf.corsepius@rtems.org> 31 32 * libm/common/s_round.c: Cast const int to __int32_t. 33 34 2011-01-04 Ralf Corsépius <ralf.corsepius@rtems.org> 35 36 * doc/makedoc.c: Add cludge to make makedoc 64bit compliant. 37 38 2011-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 43 2011-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 48 2011-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 60 2011-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 65 2010-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 71 2010-08-24 Sebastian Huber <sebastian.huber@embedded-brains.de> 72 73 * libc/posix/opendir.c: Added missing memory free. 74 75 2010-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 81 2010-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 90 2010-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 96 2010-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 101 2010-06-17 Ralf Corsépius <ralf.corsepius@rtems.org> 102 103 * libc/sys/rtems/machine/_types.h: Special case for sparc64. 104 105 2010-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 110 2010-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 115 2010-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 128 2010-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 132 2010-03-10 Ralf Corsépius <ralf.corsepius@rtems.org> 133 134 * libc/posix/telldir.c: Adopt newlib-cvs's telldir.c 135 136 2010-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 141 2010-02-05 Ralf Corsépius <ralf.corsepius@rtems.org> 142 143 * libc/posix/telldir.c: Remove bogus nested prototype of lseek(). 144 145 2010-01-11 Sebastian Huber <sebastian.huber@embedded-brains.de> 146 147 * libc/posix/telldir.c (_cleanupdir): Fixed usage of freed memory. 148 149 2009-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 163 2009-12-18 Ralf Corsépius <ralf.corsepius@rtems.org> 164 165 Merger with newlib-1.18.0. 166 167 2009-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 181 2009-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 188 2009-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 194 2009-10-26 Ralf Corsépius <ralf.corsepius@rtems.org> 195 196 * libc/include/sys/signal.h: Sync with newlib-CVS. 197 198 2009-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 203 2009-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 209 2009-09-18 Christopher Faylor <me+cygwin@cgf.cx> 210 211 * libc/include/sys/unistd.h: Declare getpagesize as returning 212 POSIX-mandated int. 213 214 2009-09-15 Ralf Corsépius <ralf.corsepius@rtems.org> 215 216 * libc/include/stdlib.h: Add posix_memalign. 217 218 2009-09-11 Ralf Corsépius <ralf.corsepius@rtems.org> 219 220 * configure.host (m32c): Remove -D_ABORT_PROVIDED. 221 222 2009-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 227 2009-09-09 Ralf Corsépius <ralf.corsepius@rtems.org> 228 229 * configure.host: Add -D_NO_WORDEXP. 230 231 2009-09-06 Ralf Corsépius <ralf.corsepius@rtems.org> 232 233 * libc/sys/rtems/crt0.c: Add issetugid. 234 235 2009-09-02 Ralf Corsépius <ralf.corsepius@rtems.org> 236 237 * libc/sys/rtems/crt0.c: Rework. Introduce macro RTEMS_STUB. 238 239 2009-07-27 Ralf Corsépius <ralf.corsepius@rtems.org> 240 241 * libc/sys/rtems/crt0.c: Add _isatty_r. 242 243 2009-07-06 Joel Sherrill <joel.sherrill@oarcorp.com> 244 245 * libc/include/sys/features.h: Define _UNIX98_THREAD_MUTEX_ATTRIBUTES. 246 247 2009-05-05 Ralf Corsépius <ralf.corsepius@rtems.org> 248 249 * configure.host: Remove -DMISSING_SYSCALL_NAMES. 250 251 2009-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 256 2009-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 262 2009-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 267 2009-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 273 2009-02-20 Ralf Corsépius <ralf.corsepius@rtems.org> 274 275 * libc/unix/Makefile.in: Regenerate. 276 277 2009-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 288 2009-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 297 2009-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 556 556 *-*-rtems*) 557 557 default_newlib_io_long_long="yes" 558 558 default_newlib_io_c99_formats="yes" 559 newlib_cflags="${newlib_cflags} -D_COMPILING_NEWLIB" 559 560 newlib_cflags="${newlib_cflags} -DMALLOC_PROVIDED -DEXIT_PROVIDED -DSIGNAL_PROVIDED -DREENTRANT_SYSCALLS_PROVIDED -DHAVE_NANOSLEEP -DHAVE_BLKSIZE -DHAVE_FCNTL -DHAVE_ASSERT_FUNC" 560 561 # turn off unsupported items in posix directory 561 562 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 57 57 { 58 58 char *ptr; 59 59 unsigned int write_idx; 60 unsigned int size;60 size_t size; 61 61 } string_type; 62 62 63 63 … … 68 68 69 69 static void DEFUN(init_string_with_size,(buffer, size), 70 70 string_type *buffer AND 71 unsigned int size )71 size_t size ) 72 72 { 73 73 buffer->write_idx = 0; 74 74 buffer->size = size; … … 219 219 stinst_type *pc; 220 220 stinst_type sstack[STACK]; 221 221 stinst_type *ssp = &sstack[0]; 222 intistack[STACK];223 int*isp = &istack[0];222 long istack[STACK]; 223 long *isp = &istack[0]; 224 224 225 225 typedef int *word_type; 226 226 … … 270 270 { 271 271 isp++; 272 272 pc++; 273 *isp = ( int)(*pc);273 *isp = (long)(*pc); 274 274 pc++; 275 275 276 276 } -
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 242 242 #define SCNxMAX __SCNMAX(x) 243 243 244 244 /* 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) 251 254 #else 252 #define __PRIPTR(x) __STRINGIFY(x) 253 #define __SCNPTR(x) __STRINGIFY(x) 255 #error cannot determine PRI*PTR 254 256 #endif 255 257 256 258 #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 54 54 #endif 55 55 #endif 56 56 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 62 58 typedef signed long __int32_t; 63 59 typedef unsigned long __uint32_t; 64 60 #define ___int32_t_defined 1 61 #elif __EXP(INT_MAX) == 0x7fffffffL 62 typedef signed int __int32_t; 63 typedef unsigned int __uint32_t; 64 #define ___int32_t_defined 1 65 65 #elif __EXP(SHRT_MAX) == 0x7fffffffL 66 66 typedef signed short __int32_t; 67 67 typedef 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 1 20 #ifndef _SCHED_H_ 2 21 #define _SCHED_H_ 3 22 23 #include <sys/types.h> 24 #include <sys/sched.h> 25 4 26 #ifdef __cplusplus 5 27 extern "C" { 6 28 #endif 7 29 8 #include <sys/sched.h> 30 #if defined(_POSIX_PRIORITY_SCHEDULING) 31 /* 32 * XBD 13 - Set Scheduling Parameters, P1003.1b-2008, p. 1803 33 */ 34 int 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 */ 42 int 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 */ 51 int 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 */ 60 int sched_getscheduler( 61 pid_t __pid 62 ); 63 64 /* 65 * XBD 13 - Get Scheduling Parameter Limits, P1003.1b-2008, p. 1799 66 */ 67 int sched_get_priority_max( 68 int __policy 69 ); 70 71 int sched_get_priority_min( 72 int __policy 73 ); 74 75 /* 76 * XBD 13 - Get Scheduling Parameter Limits, P1003.1b-2008, p. 1802 77 */ 78 int 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 */ 89 int sched_yield( void ); 90 91 #endif /* _POSIX_THREADS or _POSIX_PRIORITY_SCHEDULING */ 9 92 10 93 #ifdef __cplusplus 11 94 } -
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 33 33 /* Check if "long" is 64bit or 32bit wide */ 34 34 #if __STDINT_EXP(LONG_MAX) > 0x7fffffff 35 35 #define __have_long64 1 36 #elif __STDINT_EXP(LONG_MAX) == 0x7fffffff && !defined(__SPU__)36 #elif __STDINT_EXP(LONG_MAX) == 0x7fffffff 37 37 #define __have_long32 1 38 38 #endif 39 39 … … 49 49 #define __int_least8_t_defined 1 50 50 #endif 51 51 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 57 53 typedef signed int int16_t; 58 54 typedef unsigned int uint16_t; 59 55 #define __int16_t_defined 1 56 #elif __STDINT_EXP(SHRT_MAX) == 0x7fff 57 typedef signed short int16_t; 58 typedef unsigned short uint16_t; 59 #define __int16_t_defined 1 60 60 #elif __STDINT_EXP(SCHAR_MAX) == 0x7fff 61 61 typedef signed char int16_t; 62 62 typedef unsigned char uint16_t; … … 239 239 * GCC doesn't provide an appropriate macro for [u]intptr_t 240 240 * For now, use __PTRDIFF_TYPE__ 241 241 */ 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 242 265 #if defined(__PTRDIFF_TYPE__) 243 266 typedef signed __PTRDIFF_TYPE__ intptr_t; 244 267 typedef unsigned __PTRDIFF_TYPE__ uintptr_t; … … 260 283 #define INTPTR_MIN (-__STDINT_EXP(LONG_MAX) - 1) 261 284 #define UINTPTR_MAX (__STDINT_EXP(LONG_MAX) * 2UL + 1) 262 285 #endif 286 #endif 263 287 264 288 /* Limits of Specified-Width Integer Types */ 265 289 … … 408 432 /* This must match size_t in stddef.h, currently long unsigned int */ 409 433 #ifdef __SIZE_MAX__ 410 434 #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) 411 437 #else 412 438 #define SIZE_MAX (__STDINT_EXP(LONG_MAX) * 2UL + 1) 413 439 #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 49 49 #ifndef __STRICT_ANSI__ 50 50 char *_EXFUN(strtok_r,(char *, const char *, char **)); 51 51 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));57 52 _PTR _EXFUN(memccpy,(_PTR, const _PTR, int, size_t)); 58 53 _PTR _EXFUN(mempcpy,(_PTR, const _PTR, size_t)); 59 54 _PTR _EXFUN(memmem, (const _PTR, size_t, const _PTR, size_t)); 60 char *_EXFUN(rindex,(const char *, int));61 55 char *_EXFUN(stpcpy,(char *, const char *)); 62 56 char *_EXFUN(stpncpy,(char *, const char *, size_t)); 63 int _EXFUN(strcasecmp,(const char *, const char *));64 57 char *_EXFUN(strcasestr,(const char *, const char *)); 65 58 char *_EXFUN(strdup,(const char *)); 66 59 char *_EXFUN(_strdup_r,(struct _reent *, const char *)); … … 69 62 char *_EXFUN(strerror_r,(int, char *, size_t)); 70 63 size_t _EXFUN(strlcat,(char *, const char *, size_t)); 71 64 size_t _EXFUN(strlcpy,(char *, const char *, size_t)); 72 int _EXFUN(strncasecmp,(const char *, const char *, size_t));73 65 size_t _EXFUN(strnlen,(const char *, size_t)); 74 66 char *_EXFUN(strsep,(char **, const char *)); 75 67 char *_EXFUN(strlwr,(char *)); … … 81 73 int _EXFUN(strtosigno, (const char *__name)); 82 74 #endif 83 75 84 /* These function names are used on Windows and perhaps other systems. */85 #ifndef strcmpi86 #define strcmpi strcasecmp87 #endif88 #ifndef stricmp89 #define stricmp strcasecmp90 #endif91 #ifndef strncmpi92 #define strncmpi strncasecmp93 #endif94 #ifndef strnicmp95 #define strnicmp strncasecmp96 #endif97 98 76 #endif /* ! __STRICT_ANSI__ */ 99 77 100 78 #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 */ 23 int _EXFUN(bcmp,(const void *, const void *, size_t)); 24 void _EXFUN(bcopy,(const void *, void *, size_t)); 25 void _EXFUN(bzero,(void *, size_t)); 26 char *_EXFUN(index,(const char *, int)); 27 char *_EXFUN(rindex,(const char *, int)); 28 #endif /* ! __STRICT_ANSI__ */ 29 30 int _EXFUN(ffs,(int)); 31 int _EXFUN(strcasecmp,(const char *, const char *)); 32 #if 0 33 /* Not implemented */ 34 int _EXFUN(strcasecmp_l,(const char *, const char *, locale_t)); 35 #endif 36 int _EXFUN(strncasecmp,(const char *, const char *, size_t)); 37 #if 0 38 /* Not implemented */ 39 int _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 33 33 #define _POSIX_VERSION 199309L 34 34 #define _POSIX_ASYNCHRONOUS_IO 1 35 35 #define _POSIX_FSYNC 1 36 #define _POSIX_MAPPED_FILES 1 36 /* #define _POSIX_MAPPED_FILES 1 */ 37 37 #define _POSIX_MEMLOCK 1 38 38 #define _POSIX_MEMLOCK_RANGE 1 39 39 #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 1 1 /* 2 2 * Written by Joel Sherrill <joel@OARcorp.com>. 3 3 * 4 * COPYRIGHT (c) 1989-20 00.4 * COPYRIGHT (c) 1989-2010. 5 5 * On-Line Applications Research Corporation (OAR). 6 6 * 7 7 * Permission to use, copy, modify, and distribute this software for any … … 14 14 * OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY OF THIS 15 15 * SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. 16 16 * 17 * $Id: sched.h,v 1. 2 2002/06/20 19:51:24 fitzsimExp $17 * $Id: sched.h,v 1.3 2010/04/01 18:33:37 jjohnstn Exp $ 18 18 */ 19 19 20 20 21 #ifndef _ _POSIX_SYS_SCHEDULING_h22 #define _ _POSIX_SYS_SCHEDULING_h21 #ifndef _SYS_SCHED_H_ 22 #define _SYS_SCHED_H_ 23 23 24 24 #ifdef __cplusplus 25 25 extern "C" { 26 26 #endif 27 27 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 36 33 #define SCHED_OTHER 0 34 #endif 35 37 36 #define SCHED_FIFO 1 38 37 #define SCHED_RR 2 39 38 40 39 #if defined(_POSIX_SPORADIC_SERVER) 41 #define SCHED_SPORADIC 340 #define SCHED_SPORADIC 4 42 41 #endif 43 42 44 /* Scheduling Parameters , P1003.1b-1993, p. 24945 NOTE: Fields whose name begins with "ss_" added by P1003.4b/D8, p. 33.*/43 /* Scheduling Parameters */ 44 /* Open Group Specifications Issue 6 */ 46 45 47 46 struct sched_param { 48 47 int sched_priority; /* Process execution scheduling priority */ 49 48 50 #if defined(_POSIX_SPORADIC_SERVER) 51 int s s_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 */ 52 51 /* server */ 53 struct timespec s s_replenish_period;52 struct timespec sched_ss_repl_period; 54 53 /* 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 */ 56 58 #endif 57 59 }; 58 60 59 61 #ifdef __cplusplus 60 62 } 61 #endif 63 #endif 62 64 63 65 #endif 64 66 /* 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 176 176 #endif 177 177 typedef _ssize_t ssize_t; 178 178 179 #ifndef __CYGWIN__ 179 #if defined(__rtems__) 180 typedef _mode_t mode_t; 181 #endif 182 183 #if !defined(__CYGWIN__) && !defined(__rtems__) 180 184 #ifdef __MS_types__ 181 185 typedef char * addr_t; 182 186 typedef 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 212 212 the identifier of the CPU_time clock associated with the PROCESS 213 213 making the function call. */ 214 214 215 #if defined(__rtems__) && !defined( __STRICT_ANSI__) 216 /* Don't use: Removed in rtems > 4.10 */ 215 217 #define CLOCK_PROCESS_CPUTIME (clockid_t)2 218 #endif 219 #define CLOCK_PROCESS_CPUTIME_ID (clockid_t)2 216 220 217 221 #endif 218 222 … … 222 226 the identifier of the CPU_time clock associated with the THREAD 223 227 making the function call. */ 224 228 229 #if defined(__rtems__) && !defined( __STRICT_ANSI__) 230 /* Don't use: Removed in rtems > 4.10 */ 225 231 #define CLOCK_THREAD_CPUTIME (clockid_t)3 232 #endif 233 #define CLOCK_THREAD_CPUTIME_ID (clockid_t)3 226 234 227 235 #endif 228 236 -
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 10 10 11 11 AM_CFLAGS = -I $(srcdir)/../../stdio -I $(srcdir)/../../stdlib 12 12 13 lib_a_SOURCES = setjmp.S times.c13 lib_a_SOURCES = setjmp.S 14 14 lib_a_CCASFLAGS=$(AM_CCASFLAGS) 15 15 lib_a_CFLAGS=$(AM_CFLAGS) 16 16 lib_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 51 51 LIBRARIES = $(noinst_LIBRARIES) 52 52 ARFLAGS = cru 53 53 lib_a_AR = $(AR) $(ARFLAGS) 54 am_lib_a_OBJECTS = lib_a-setjmp.$(OBJEXT) lib_a-times.$(OBJEXT)54 am_lib_a_OBJECTS = lib_a-setjmp.$(OBJEXT) 55 55 lib_a_OBJECTS = $(am_lib_a_OBJECTS) 56 56 DEFAULT_INCLUDES = -I.@am__isrc@ 57 57 depcomp = … … 173 173 AM_CCASFLAGS = $(INCLUDES) 174 174 noinst_LIBRARIES = lib.a 175 175 AM_CFLAGS = -I $(srcdir)/../../stdio -I $(srcdir)/../../stdlib 176 lib_a_SOURCES = setjmp.S times.c176 lib_a_SOURCES = setjmp.S 177 177 lib_a_CCASFLAGS = $(AM_CCASFLAGS) 178 178 lib_a_CFLAGS = $(AM_CFLAGS) 179 179 lib_a_LIBADD = @extra_objs@ … … 184 184 all: all-am 185 185 186 186 .SUFFIXES: 187 .SUFFIXES: .S . c .o .obj187 .SUFFIXES: .S .o .obj 188 188 am--refresh: 189 189 @: 190 190 $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) … … 245 245 lib_a-setjmp.obj: setjmp.S 246 246 $(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` 247 247 248 .c.o:249 $(COMPILE) -c $<250 251 .c.obj:252 $(COMPILE) -c `$(CYGPATH_W) '$<'`253 254 lib_a-times.o: times.c255 $(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.c256 257 lib_a-times.obj: times.c258 $(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 260 248 ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) 261 249 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ 262 250 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_t13 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 for19 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 * 100028 + host_ru.r.ru_utime.tv_usec;29 tp->tms_stime = host_ru.r.ru_stime.tv_sec * 100030 + 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 5 5 */ 6 6 7 7 #include <_ansi.h> 8 #include <stdint.h> 8 9 #include "ctype.h" 9 10 #include "reent.h" 10 11 #include "string.h" … … 131 132 write_string (unctrl (c)); 132 133 break; 133 134 case 'p' : 134 l = ( _POINTER_INT) va_arg (args, char *);135 l = (intptr_t) va_arg (args, char *); 135 136 print_number (16, 1, l); 136 137 break; 137 138 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 24 24 25 25 No supporting OS subroutines are required. */ 26 26 27 #include < _ansi.h>27 #include <strings.h> 28 28 29 29 int 30 30 _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 74 74 dirp->dd_len = 512; 75 75 76 76 if (dirp->dd_buf == NULL) { 77 free(dirp); 77 78 close (fd); 78 79 return NULL; 79 80 } -
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 37 37 static char sccsid[] = "@(#)readdir.c 5.7 (Berkeley) 6/1/90"; 38 38 #endif /* LIBC_SCCS and not lint */ 39 39 40 #include <stdint.h> 40 41 #include <dirent.h> 41 42 42 43 extern int getdents (int fd, void *dp, int count); … … 75 76 continue; 76 77 } 77 78 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 */ 79 80 #ifdef HAVE_DD_LOCK 80 81 __lock_release_recursive(dirp->dd_lock); 81 82 #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 48 48 #ifdef HAVE_DD_LOCK 49 49 __lock_acquire_recursive(dirp->dd_lock); 50 50 #endif 51 _seekdir((dirp), (off_t)0);51 _seekdir((dirp), 0L); 52 52 #ifdef HAVE_DD_LOCK 53 53 __lock_release_recursive(dirp->dd_lock); 54 54 #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 67 67 #define NDIRHASH 32 /* Num of hash lists, must be a power of 2 */ 68 68 #define LOCHASH(i) ((i)&(NDIRHASH-1)) 69 69 70 static long dd_loccnt ; /* Index of entry for sequential readdir's */70 static long dd_loccnt = 1; /* Index of entry for sequential readdir's */ 71 71 static struct ddloc *dd_hash[NDIRHASH]; /* Hash list heads for ddlocs */ 72 72 __LOCK_INIT(static, dd_hash_lock); 73 73 … … 119 119 register struct ddloc *lp; 120 120 register struct ddloc **prevlp; 121 121 struct dirent *dp; 122 extern long lseek();123 122 124 123 #ifdef HAVE_DD_LOCK 125 124 __lock_acquire(dd_hash_lock); 126 125 #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) { 136 136 #ifdef HAVE_DD_LOCK 137 __lock_release(dd_hash_lock);137 __lock_release(dd_hash_lock); 138 138 #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 } 151 151 found: 152 152 #ifdef SINGLEUSE 153 *prevlp = lp->loc_next;154 free((caddr_t)lp);153 *prevlp = lp->loc_next; 154 free((caddr_t)lp); 155 155 #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 } 156 162 #ifdef HAVE_DD_LOCK 157 163 __lock_release(dd_hash_lock); 158 164 #endif … … 169 175 __lock_acquire(dd_hash_lock); 170 176 #endif 171 177 for (i = 0; i < NDIRHASH; ++i) { 178 struct ddloc head; 172 179 register struct ddloc *lp; 173 180 register struct ddloc *prevlp; 181 174 182 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; 182 185 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; 186 191 free((caddr_t)lp); 187 lp = prevlp;188 192 } 189 193 else 190 194 prevlp = lp; 195 lp = nextlp; 191 196 } 197 dd_hash[i] = head.loc_next; 192 198 } 193 199 #ifdef HAVE_DD_LOCK 194 200 __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 102 102 typedef struct __db { 103 103 DBTYPE type; /* Underlying db type. */ 104 104 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); 110 110 void *internal; /* Access method private. */ 111 111 int (*fd)(const struct __db *); 112 112 } 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 43 43 int __big_split(HTAB *, BUFHEAD *, BUFHEAD *, BUFHEAD *, 44 44 int, __uint32_t, SPLIT_RETURN *); 45 45 int __buf_free(HTAB *, int, int); 46 void __buf_init(HTAB *, int);46 void __buf_init(HTAB *, __uint32_t); 47 47 __uint32_t __call_hash(HTAB *, char *, int); 48 48 int __delpair(HTAB *, BUFHEAD *, int); 49 49 int __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 118 118 int newpage; /* If prev_bp set, indicates a new overflow page. */ 119 119 { 120 120 BUFHEAD *bp; 121 __uint32_t is_disk_mask;121 ptrdiff_t is_disk_mask; 122 122 int is_disk, segment_ndx; 123 123 SEGMENT segp; 124 124 … … 298 298 extern void 299 299 __buf_init(hashp, nbytes) 300 300 HTAB *hashp; 301 int nbytes;301 __uint32_t nbytes; 302 302 { 303 303 BUFHEAD *bfp; 304 304 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 82 82 83 83 /* Hash Table Information */ 84 84 typedef struct hashhdr { /* Disk resident portion */ 85 intmagic; /* Magic NO for hash tables */85 __uint32_t magic; /* Magic NO for hash tables */ 86 86 int version; /* Version ID */ 87 87 __uint32_t lorder; /* Byte Order */ 88 88 int bsize; /* Bucket/Page Size */ … … 97 97 int high_mask; /* Mask to modulo into entire table */ 98 98 int low_mask; /* Mask to modulo into lower half of 99 99 * table */ 100 intffactor; /* Fill factor */100 __uint32_t ffactor; /* Fill factor */ 101 101 int nkeys; /* Number of keys in hash table */ 102 102 int hdrpages; /* Size of table header */ 103 103 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 330 330 c->max *= sizeof(wchar_t); 331 331 if (c->max < 64) 332 332 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 335 337 *size = 0; 336 338 *buf = _malloc_r (ptr, c->max); 337 339 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 94 94 #include <_ansi.h> 95 95 #include <reent.h> 96 96 #include <stdio.h> 97 #include <stdint.h> 97 98 #include <stdlib.h> 98 99 #include <string.h> 99 100 #include <fcntl.h> … … 109 110 char *result _AND 110 111 _CONST char *part1 _AND 111 112 _CONST char *part2 _AND 112 int part3_AND113 intptr_t part3 _AND 113 114 int *part4) 114 115 { 115 116 /* Generate the filename and make sure that there isn't one called … … 183 184 if (filename) 184 185 { 185 186 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)) 187 188 return NULL; 188 189 } 189 190 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 24 24 #include <reent.h> 25 25 #include <stdlib.h> 26 26 #include <string.h> 27 #include <strings.h> 27 28 28 29 #include "envlock.h" 29 30 -
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 299 299 } 300 300 s0 = s; 301 301 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 } 307 310 nd0 = nd; 308 311 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) { 311 313 decpt = 1; 312 314 c = *(s += strlen (_localeconv_r (ptr)->decimal_point)); 313 315 if (!nd) { … … 325 327 have_dig: 326 328 nz++; 327 329 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 } 339 337 } 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; 340 349 } 341 350 } 351 } 342 352 dig_done: 343 353 e = 0; 344 354 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 6 6 bcmp 7 7 8 8 ANSI_SYNOPSIS 9 #include <string .h>9 #include <strings.h> 10 10 int bcmp(const void *<[s1]>, const void *<[s2]>, size_t <[n]>); 11 11 12 12 TRAD_SYNOPSIS 13 #include <string .h>13 #include <strings.h> 14 14 int bcmp(<[s1]>, <[s2]>, <[n]>) 15 15 const void *<[s1]>; 16 16 const void *<[s2]>; … … 35 35 bcmp ansi pure 36 36 */ 37 37 38 #include <string .h>38 #include <strings.h> 39 39 40 40 int 41 41 _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 3 3 <<bcopy>>---copy memory regions 4 4 5 5 ANSI_SYNOPSIS 6 #include <string .h>6 #include <strings.h> 7 7 void bcopy(const void *<[in]>, void *<[out]>, size_t <[n]>); 8 8 9 9 TRAD_SYNOPSIS … … 26 26 bcopy - pure 27 27 */ 28 28 29 #include <string .h>29 #include <strings.h> 30 30 31 31 void 32 32 _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 6 6 bzero 7 7 8 8 ANSI_SYNOPSIS 9 #include <string .h>9 #include <strings.h> 10 10 void bzero(void *<[b]>, size_t <[length]>); 11 11 12 12 TRAD_SYNOPSIS 13 #include <string .h>13 #include <strings.h> 14 14 void bzero(<[b]>, <[length]>) 15 15 void *<[b]>; 16 16 size_t <[length]>; … … 30 30 <<bzero>> requires no supporting OS subroutines. 31 31 */ 32 32 33 #include <string .h>33 #include <strings.h> 34 34 35 35 _VOID 36 36 _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 10 10 char * index(const char *<[string]>, int <[c]>); 11 11 12 12 TRAD_SYNOPSIS 13 #include <string .h>13 #include <strings.h> 14 14 char * index(<[string]>, <[c]>); 15 15 char *<[string]>; 16 16 int *<[c]>; … … 33 33 index - pure 34 34 */ 35 35 36 #include <string.h> 36 #include <strings.h> 37 #include <string.h> /* strchr */ 37 38 38 39 char * 39 40 _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 35 35 */ 36 36 37 37 #include <_ansi.h> 38 #include <stdint.h> 38 39 #include <stddef.h> 39 40 #include <string.h> 40 41 #include <limits.h> 41 42 42 43 /* Nonzero if either X or Y is not aligned on a "long" boundary. */ 43 44 #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))) 45 46 46 47 /* How many bytes are copied each iteration of the word copy loop. */ 47 48 #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 38 38 39 39 #include <_ansi.h> 40 40 #include <string.h> 41 #include <stdint.h> 41 42 #include <limits.h> 42 43 43 44 /* 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)) 45 46 46 47 /* How many bytes are loaded each iteration of the word copy loop. */ 47 48 #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 37 37 */ 38 38 39 39 #include <string.h> 40 40 #include <stdint.h> 41 41 42 42 /* Nonzero if either X or Y is not aligned on a "long" boundary. */ 43 43 #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))) 45 45 46 46 /* How many bytes are copied each iteration of the word copy loop. */ 47 47 #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 34 34 */ 35 35 36 36 #include <_ansi.h> 37 #include <stdint.h> 37 38 #include <string.h> 38 39 39 40 /* Nonzero if either X or Y is not aligned on a "long" boundary. */ 40 41 #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))) 42 43 43 44 /* How many bytes are copied each iteration of the 4X unrolled loop. */ 44 45 #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 36 36 */ 37 37 38 38 #include <string.h> 39 #include <stdint.h> 39 40 #include <_ansi.h> 40 41 #include <stddef.h> 41 42 #include <limits.h> 42 43 43 44 /* Nonzero if either X or Y is not aligned on a "long" boundary. */ 44 45 #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))) 46 47 47 48 /* How many bytes are copied each iteration of the 4X unrolled loop. */ 48 49 #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 34 34 #include <stddef.h> 35 35 #include <limits.h> 36 36 #include <string.h> 37 #include <stdint.h> 37 38 38 39 /* Nonzero if either X or Y is not aligned on a "long" boundary. */ 39 40 #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))) 41 42 42 43 /* How many bytes are copied each iteration of the 4X unrolled loop. */ 43 44 #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 34 34 */ 35 35 36 36 #include <string.h> 37 #include <stdint.h> 37 38 38 39 #define LBLOCKSIZE (sizeof(long)) 39 #define UNALIGNED(X) (( long)X & (LBLOCKSIZE - 1))40 #define UNALIGNED(X) ((intptr_t)X & (LBLOCKSIZE - 1)) 40 41 #define TOO_SMALL(LEN) ((LEN) < LBLOCKSIZE) 41 42 42 43 _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 10 10 char * rindex(const char *<[string]>, int <[c]>); 11 11 12 12 TRAD_SYNOPSIS 13 #include <string .h>13 #include <strings.h> 14 14 char * rindex(<[string]>, <[c]>); 15 15 char *<[string]>; 16 16 int *<[c]>; … … 33 33 rindex - pure 34 34 */ 35 35 36 #include <string.h> 36 #include <strings.h> 37 #include <string.h> /* strchr */ 37 38 38 39 char * 39 40 _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 34 34 */ 35 35 36 36 #include <string.h> 37 #include <stdint.h> 37 38 #include <limits.h> 38 39 39 40 /*SUPPRESS 560*/ … … 41 42 42 43 /* Nonzero if either X or Y is not aligned on a "long" boundary. */ 43 44 #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))) 45 46 46 47 #if LONG_MAX == 2147483647L 47 48 #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 40 40 */ 41 41 42 42 #include <string.h> 43 #include <stdint.h> 43 44 #include <limits.h> 44 45 45 46 /*SUPPRESS 560*/ … … 47 48 48 49 /* Nonzero if either X or Y is not aligned on a "long" boundary. */ 49 50 #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))) 51 52 52 53 #if LONG_MAX == 2147483647L 53 54 #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 38 38 strcasecmp 39 39 */ 40 40 41 #include <string .h>41 #include <strings.h> 42 42 #include <ctype.h> 43 43 44 44 int -
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 33 33 strcat ansi pure 34 34 */ 35 35 36 #include <stdint.h> 36 37 #include <string.h> 37 38 #include <limits.h> 38 39 39 40 /* Nonzero if X is aligned on a "long" boundary. */ 40 41 #define ALIGNED(X) \ 41 ((( long)X & (sizeof (long) - 1)) == 0)42 (((uintptr_t)X & (sizeof (long) - 1)) == 0) 42 43 43 44 #if LONG_MAX == 2147483647L 44 45 #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 33 33 strchr ansi pure 34 34 */ 35 35 36 #include <stdint.h> 36 37 #include <string.h> 37 38 #include <limits.h> 38 39 39 40 /* 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)) 41 42 42 43 /* How many bytes are loaded each iteration of the word copy loop. */ 43 44 #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 35 35 strcmp ansi pure 36 36 */ 37 37 38 #include <stdint.h> 38 39 #include <string.h> 39 40 #include <limits.h> 40 41 41 42 /* Nonzero if either X or Y is not aligned on a "long" boundary. */ 42 43 #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))) 44 45 45 46 /* DETECTNULL returns nonzero if (long)X contains a NULL byte. */ 46 47 #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 32 32 strcpy ansi pure 33 33 */ 34 34 35 #include <stdint.h> 35 36 #include <string.h> 36 37 #include <limits.h> 37 38 … … 40 41 41 42 /* Nonzero if either X or Y is not aligned on a "long" boundary. */ 42 43 #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))) 44 45 45 46 #if LONG_MAX == 2147483647L 46 47 #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 32 32 */ 33 33 34 34 #include <_ansi.h> 35 #include <stdint.h> 35 36 #include <string.h> 36 37 #include <limits.h> 37 38 38 39 #define LBLOCKSIZE (sizeof (long)) 39 #define UNALIGNED(X) (( long)X & (LBLOCKSIZE - 1))40 #define UNALIGNED(X) ((intptr_t)X & (LBLOCKSIZE - 1)) 40 41 41 42 #if LONG_MAX == 2147483647L 42 43 #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 6 6 strncasecmp 7 7 8 8 ANSI_SYNOPSIS 9 #include <string .h>9 #include <strings.h> 10 10 int strncasecmp(const char *<[a]>, const char * <[b]>, size_t <[length]>); 11 11 12 12 TRAD_SYNOPSIS 13 #include <string .h>13 #include <strings.h> 14 14 int strncasecmp(<[a]>, <[b]>, <[length]>) 15 15 char *<[a]>; 16 16 char *<[b]>; … … 40 40 strncasecmp 41 41 */ 42 42 43 #include <string .h>43 #include <strings.h> 44 44 #include <ctype.h> 45 45 46 46 int -
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 42 42 */ 43 43 44 44 #include <string.h> 45 #include <stdint.h> 45 46 #include <limits.h> 46 47 47 48 /* Nonzero if X is aligned on a "long" boundary. */ 48 49 #define ALIGNED(X) \ 49 ((( long)X & (sizeof (long) - 1)) == 0)50 (((intptr_t)X & (sizeof (long) - 1)) == 0) 50 51 51 52 #if LONG_MAX == 2147483647L 52 53 #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 36 36 strncmp ansi pure 37 37 */ 38 38 39 #include <stdint.h> 39 40 #include <string.h> 40 41 #include <limits.h> 41 42 42 43 /* Nonzero if either X or Y is not aligned on a "long" boundary. */ 43 44 #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))) 45 46 46 47 /* DETECTNULL returns nonzero if (long)X contains a NULL byte. */ 47 48 #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 38 38 */ 39 39 40 40 #include <string.h> 41 #include <stdint.h> 41 42 #include <limits.h> 42 43 43 44 /*SUPPRESS 560*/ … … 45 46 46 47 /* Nonzero if either X or Y is not aligned on a "long" boundary. */ 47 48 #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))) 49 50 50 51 #if LONG_MAX == 2147483647L 51 52 #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 1 1 /* Byte-wise substring search, using the Two-Way algorithm. 2 * Copyright (C) 2008 Eric Blake2 * Copyright (C) 2008, 2010 Eric Blake 3 3 * Permission to use, copy, modify, and distribute this software 4 4 * is freely granted, provided that this notice is preserved. 5 5 */ … … 335 335 a byte out of place, there can be no match until 336 336 after the mismatch. */ 337 337 shift = needle_len - period; 338 memory = 0;339 338 } 339 memory = 0; 340 340 j += shift; 341 341 continue; 342 342 } -
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 24 24 /* RTEMS provides some of its own routines including a Malloc family */ 25 25 RTEMS_STUB(void *,malloc(size_t s)) { return 0; } 26 26 RTEMS_STUB(void *,realloc(void* p, size_t s)) { return 0; } 27 RTEMS_STUB(void, free(void )) { ; }28 RTEMS_STUB(_PTR, calloc(s truct _reent *r, size_t s1, size_t s2)) {}27 RTEMS_STUB(void, free(void* ptr)) { ; } 28 RTEMS_STUB(_PTR, calloc(size_t s1, size_t s2)) {} 29 29 30 30 #if defined(__GNUC__) 31 31 /* … … 49 49 #endif 50 50 51 51 /* stubs for functions RTEMS provides */ 52 RTEMS_STUB(int, clock_gettime(clockid_t clk_id, struct timespec *tp)) { return -1; } 52 53 RTEMS_STUB(int, close (int fd)) { return -1; } 53 54 RTEMS_STUB(int, dup2(int oldfd, int newfd)) { return -1; } 54 55 RTEMS_STUB(int, fcntl( int fd, int cmd, ... /* arg */ )) { return -1; } … … 56 57 RTEMS_STUB(int, fstat(int fd, struct stat *buf)) { return -1; } 57 58 RTEMS_STUB(int, getdents(int fd, void *dp, int count)) { return -1; } 58 59 RTEMS_STUB(char *, getlogin(void)) { return 0; } 60 RTEMS_STUB(int, gettimeofday(struct timeval *tv, struct timezone *tz)) { return -1; } 59 61 RTEMS_STUB(struct passwd *, getpwnam(const char *name)) { return 0; } 60 62 RTEMS_STUB(struct passwd *, getpwuid(uid_t uid)) { return 0; } 61 63 RTEMS_STUB(uid_t, getuid(void)) { return 0; } … … 65 67 RTEMS_STUB(int, open(const char *pathname, int flags, int mode)) { return -1; } 66 68 RTEMS_STUB(int, pipe(int pipefd[2])) { return -1; } 67 69 RTEMS_STUB(_ssize_t, read(int fd, void *buf, size_t count)) { return -1; } 70 RTEMS_STUB(int, sched_yield(void)) { return -1; } 68 71 RTEMS_STUB(int, sigfillset(sigset_t *set)) { return -1; } 69 72 RTEMS_STUB(int, sigprocmask(int how, const sigset_t *set, sigset_t *oldset)) { return -1; } 70 73 RTEMS_STUB(int, stat(const char *path, struct stat *buf)) { return -1; } … … 95 98 RTEMS_STUB(int, _kill_r (struct _reent *r, int pid, int sig )) { return -1; } 96 99 #if !defined(REENTRANT_SYSCALLS_PROVIDED) 97 100 /* cf. newlib/libc/reent/linkr.c */ 98 RTEMS_STUB(int, _link_r (struct _reent * , const char *, const char *)) { return -1; }101 RTEMS_STUB(int, _link_r (struct _reent *r, const char *oldpath, const char *newpath)) { return -1; } 99 102 #endif 100 103 RTEMS_STUB(_off_t, _lseek_r ( struct _reent *ptr, int fd, _off_t offset, int whence )) { return -1; } 101 104 RTEMS_STUB(int, _open_r (struct _reent *r, const char *buf, int flags, int mode)) { return -1; } … … 103 106 RTEMS_STUB(int, _rename_r (struct _reent *r, const char *a, const char *b)){ return -1; } 104 107 #if !(defined (REENTRANT_SYSCALLS_PROVIDED) || defined (MALLOC_PROVIDED)) 105 108 /* cf. newlib/libc/reent/sbrkr.c */ 106 RTEMS_STUB(void *,_sbrk_r (struct _reent *r, ptrdiff_t )) { return -1; }109 RTEMS_STUB(void *,_sbrk_r (struct _reent *r, ptrdiff_t addr)) { return 0; } 107 110 #endif 108 111 RTEMS_STUB(int, _stat_r (struct _reent *r, const char *path, struct stat *buf)) { return -1; } 109 112 RTEMS_STUB(_CLOCK_T_, _times_r (struct _reent *r, struct tms *ptms)) { return -1; } 110 113 RTEMS_STUB(int, _unlink_r (struct _reent *r, const char *path)) { return -1; } 111 114 #if !(defined (REENTRANT_SYSCALLS_PROVIDED) || defined (NO_EXEC)) 112 115 /* cf. newlib/libc/reent/execr.c */ 113 RTEMS_STUB(int, _wait_r (struct _reent *r, int * )) { return -1; }116 RTEMS_STUB(int, _wait_r (struct _reent *r, int *status)) { return -1; } 114 117 #endif 115 118 RTEMS_STUB(_ssize_t, _write_r (struct _reent *r, int fd, const void *buf, size_t nbytes)) { return -1; } 116 119 -
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 78 78 * Invariant values 79 79 */ 80 80 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 */ 81 84 #define SSIZE_MAX 32767 85 #endif 82 86 83 87 /* 84 88 * 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 31 31 32 32 typedef __int32_t blksize_t; 33 33 typedef __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 */ 38 typedef __int64_t _off_t; 39 #define __off_t_defined 1 40 41 typedef __int64_t _fpos_t; 42 #define __fpos_t_defined 1 43 #else 44 /* Use 32bit types */ 45 typedef __int32_t _off_t; 46 #define __off_t_defined 1 47 48 typedef __int32_t _fpos_t; 49 #define __fpos_t_defined 1 50 #endif 51 52 typedef __uint32_t _mode_t; 53 #define __mode_t_defined 1 54 34 55 #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 31 31 void seekdir(DIR *dir, long loc); 32 32 long telldir(DIR *dir); 33 33 34 #ifdef _COMPILING_NEWLIB 35 void _seekdir(DIR *dir, long offset); 36 #endif 37 34 38 #include <sys/types.h> 35 39 36 40 #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 361 361 sf_u.word = (i); \ 362 362 (d) = sf_u.value; \ 363 363 } 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 36 36 long double 37 37 modfl (long double x, long double *iptr) 38 38 { 39 return modf(x, iptr);39 return modf(x, (double*) iptr); 40 40 } 41 41 #endif 42 42 -
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 13 13 * ==================================================== 14 14 */ 15 15 16 #include "fdlibm.h"17 16 #include <limits.h> 17 #include "fdlibm.h" 18 18 19 19 #ifdef __STDC__ 20 20 int ilogbf(float x) … … 28 28 GET_FLOAT_WORD(hx,x); 29 29 hx &= 0x7fffffff; 30 30 if(FLT_UWORD_IS_ZERO(hx)) 31 return - INT_MAX; /* ilogb(0) = 0x80000001*/31 return FP_ILOGB0; /* ilogb(0) = special case error */ 32 32 if(FLT_UWORD_IS_SUBNORMAL(hx)) { 33 33 for (ix = -126,hx<<=8; hx>0; hx<<=1) ix -=1; 34 34 return ix; 35 35 } 36 #if FP_ILOGBNAN != INT_MAX 37 else if (FLT_UWORD_IS_NAN(hx)) return FP_ILOGBNAN; /* NAN */ 38 #endif 36 39 else if (!FLT_UWORD_IS_FINITE(hx)) return INT_MAX; 37 40 else return (hx>>23)-127; 38 41 } -
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 71 71 GET_FLOAT_WORD (i0, t); 72 72 /* Detect the all-zeros representation of plus and 73 73 minus zero, which fails the calculation below. */ 74 if ((i0 & ~( 1 << 31)) == 0)74 if ((i0 & ~((__uint32_t)1 << 31)) == 0) 75 75 return 0; 76 76 j0 = ((i0 >> 23) & 0xff) - 0x7f; 77 77 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 30 30 float x; 31 31 #endif 32 32 { 33 return (logf(x) / (float ) M_LOG2_E);33 return (logf(x) / (float_t) M_LN2); 34 34 } 35 35 36 36 #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 57 57 i = (0x007fffff)>>j0; 58 58 if((i0&i)==0) return x; /* x is integral */ 59 59 i>>=1; 60 if((i0&i)!=0) i0 = (i0&(~i))|((0x 100000)>>j0);60 if((i0&i)!=0) i0 = (i0&(~i))|((0x200000)>>j0); 61 61 } 62 62 } else { 63 63 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 38 38 w &= 0x80000000; 39 39 if (exponent_less_127 == -1) 40 40 /* Result is +1.0 or -1.0. */ 41 w |= ( 127 << 23);41 w |= ((__uint32_t)127 << 23); 42 42 } 43 43 else 44 44 { -
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 44 44 RETURNS 45 45 46 46 <<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>>. 47 floating-point argument. 48 If <[val]> is <<0>>, they return <<FP_ILOGB0>>. 49 If <[val]> is infinite, they return <<INT_MAX>>. 50 If <[val]> is NaN, they return <<FP_ILOGBNAN>>. 51 (<<FP_ILOGB0>> and <<FP_ILOGBNAN>> are defined in math.h, but in turn are 52 defined as INT_MIN or INT_MAX from limits.h. The value of FP_ILOGB0 may be 53 either INT_MIN or -INT_MAX. The value of FP_ILOGBNAN may be either INT_MAX or 54 INT_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. 50 61 51 62 PORTABILITY 52 Neither <<ilogb>> nor <<ilogbf>> is required by ANSI C or by 53 the System V Interface Definition (Issue 2).*/63 C99, POSIX 64 */ 54 65 55 66 /* ilogb(double x) 56 67 * return the binary exponent of non-zero x … … 58 69 * ilogb(inf/NaN) = 0x7fffffff (no signal is raised) 59 70 */ 60 71 61 #include "fdlibm.h"62 72 #include <limits.h> 73 #include "fdlibm.h" 63 74 64 75 #ifndef _DOUBLE_IS_32BITS 65 76 … … 76 87 hx &= 0x7fffffff; 77 88 if(hx<0x00100000) { 78 89 if((hx|lx)==0) 79 return - INT_MAX; /* ilogb(0) = 0x80000001*/90 return FP_ILOGB0; /* ilogb(0) = special case error */ 80 91 else /* subnormal x */ 81 92 if(hx==0) { 82 93 for (ix = -1043; lx>0; lx<<=1) ix -=1; … … 86 97 return ix; 87 98 } 88 99 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) */ 90 104 } 91 105 92 106 #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 61 61 62 62 /* Extract exponent field. */ 63 63 j0 = ((i0 & 0x7ff00000) >> 20) - 1023; 64 /* j0 in [-1023,1024] */ 64 65 65 66 if(j0 < 20) 66 67 { 68 /* j0 in [-1023,19] */ 67 69 if(j0 < -1) 68 70 return 0; 69 71 else 70 72 { 73 /* j0 in [0,19] */ 74 /* shift amt in [0,19] */ 71 75 w = TWO52[sx] + x; 72 76 t = w - TWO52[sx]; 73 77 GET_HIGH_WORD(i0, t); 74 78 /* Detect the all-zeros representation of plus and 75 79 minus zero, which fails the calculation below. */ 76 if ((i0 & ~( 1 << 31)) == 0)80 if ((i0 & ~((__int32_t)1 << 31)) == 0) 77 81 return 0; 82 /* After round: j0 in [0,20] */ 78 83 j0 = ((i0 & 0x7ff00000) >> 20) - 1023; 79 84 i0 &= 0x000fffff; 80 85 i0 |= 0x00100000; 86 /* shift amt in [20,0] */ 81 87 result = i0 >> (20 - j0); 82 88 } 83 89 } 84 90 else if (j0 < (int)(8 * sizeof (long long int)) - 1) 85 91 { 92 /* 64bit return: j0 in [20,62] */ 86 93 if (j0 >= 52) 94 /* 64bit return: j0 in [52,62] */ 95 /* 64bit return: left shift amt in [32,42] */ 87 96 result = ((long long int) ((i0 & 0x000fffff) | 0x0010000) << (j0 - 20)) | 97 /* 64bit return: right shift amt in [0,10] */ 88 98 (i1 << (j0 - 52)); 89 99 else 90 100 { 101 /* 64bit return: j0 in [20,51] */ 91 102 w = TWO52[sx] + x; 92 103 t = w - TWO52[sx]; 93 104 EXTRACT_WORDS (i0, i1, t); 94 105 j0 = ((i0 & 0x7ff00000) >> 20) - 1023; 95 106 i0 &= 0x000fffff; 96 107 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)); 98 114 } 99 115 } 100 116 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 31 31 msw &= 0x000fffff; 32 32 msw |= 0x00100000; 33 33 34 /* exponent_less_1023 in [-1023,1024] */ 34 35 if (exponent_less_1023 < 20) 35 36 { 37 /* exponent_less_1023 in [-1023,19] */ 36 38 if (exponent_less_1023 < 0) 37 39 { 38 40 if (exponent_less_1023 < -1) … … 42 44 } 43 45 else 44 46 { 47 /* exponent_less_1023 in [0,19] */ 48 /* shift amt in [0,19] */ 45 49 msw += 0x80000 >> exponent_less_1023; 50 /* shift amt in [20,1] */ 46 51 result = msw >> (20 - exponent_less_1023); 47 52 } 48 53 } 49 54 else if (exponent_less_1023 < (8 * sizeof (long long int)) - 1) 50 55 { 56 /* 64bit longlong: exponent_less_1023 in [20,62] */ 51 57 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)); 53 63 else 54 64 { 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)); 56 69 if (tmp < lsw) 57 70 ++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)); 59 75 } 60 76 } 61 77 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 34 34 rather are derivatives based on <<log>>. (Accuracy might be slightly off from 35 35 a direct calculation.) In addition to functions, they are also implemented as 36 36 macros defined in math.h: 37 . #define log2(x) (log (x) / _M_L OG2_E)38 . #define log2f(x) (logf (x) / (float) _M_L OG2_E)37 . #define log2(x) (log (x) / _M_LN2) 38 . #define log2f(x) (logf (x) / (float) _M_LN2) 39 39 To use the functions instead, just undefine the macros first. 40 40 41 41 You can use the (non-ANSI) function <<matherr>> to specify error … … 79 79 double x; 80 80 #endif 81 81 { 82 return (log(x) / M_L OG2_E);82 return (log(x) / M_LN2); 83 83 } 84 84 85 85 #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 98 98 99 99 /* Extract exponent field. */ 100 100 j0 = ((i0 & 0x7ff00000) >> 20) - 1023; 101 /* j0 in [-1023,1024] */ 101 102 102 103 if(j0 < 20) 103 104 { 105 /* j0 in [-1023,19] */ 104 106 if(j0 < -1) 105 107 return 0; 106 108 else 107 109 { 110 /* j0 in [0,19] */ 111 /* shift amt in [0,19] */ 108 112 w = TWO52[sx] + x; 109 113 t = w - TWO52[sx]; 110 114 GET_HIGH_WORD(i0, t); … … 112 116 minus zero, which fails the calculation below. */ 113 117 if ((i0 & ~(1L << 31)) == 0) 114 118 return 0; 119 /* After round: j0 in [0,20] */ 115 120 j0 = ((i0 & 0x7ff00000) >> 20) - 1023; 116 121 i0 &= 0x000fffff; 117 122 i0 |= 0x00100000; 123 /* shift amt in [20,0] */ 118 124 result = i0 >> (20 - j0); 119 125 } 120 126 } 121 127 else if (j0 < (int)(8 * sizeof (long int)) - 1) 122 128 { 129 /* 32bit return: j0 in [20,30] */ 130 /* 64bit return: j0 in [20,62] */ 123 131 if (j0 >= 52) 132 /* 64bit return: j0 in [52,62] */ 133 /* 64bit return: left shift amt in [32,42] */ 124 134 result = ((long int) ((i0 & 0x000fffff) | 0x0010000) << (j0 - 20)) | 135 /* 64bit return: right shift amt in [0,10] */ 125 136 (i1 << (j0 - 52)); 126 137 else 127 138 { 139 /* 32bit return: j0 in [20,30] */ 140 /* 64bit return: j0 in [20,51] */ 128 141 w = TWO52[sx] + x; 129 142 t = w - TWO52[sx]; 130 143 EXTRACT_WORDS (i0, i1, t); 131 144 j0 = ((i0 & 0x7ff00000) >> 20) - 1023; 132 145 i0 &= 0x000fffff; 133 146 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)); 135 156 } 136 157 } 137 158 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 71 71 exponent_less_1023 = ((msw & 0x7ff00000) >> 20) - 1023; 72 72 msw &= 0x000fffff; 73 73 msw |= 0x00100000; 74 74 /* exponent_less_1023 in [-1023,1024] */ 75 75 if (exponent_less_1023 < 20) 76 76 { 77 /* exponent_less_1023 in [-1023,19] */ 77 78 if (exponent_less_1023 < 0) 78 79 { 79 80 if (exponent_less_1023 < -1) … … 83 84 } 84 85 else 85 86 { 87 /* exponent_less_1023 in [0,19] */ 88 /* shift amt in [0,19] */ 86 89 msw += 0x80000 >> exponent_less_1023; 90 /* shift amt in [20,1] */ 87 91 result = msw >> (20 - exponent_less_1023); 88 92 } 89 93 } 90 94 else if (exponent_less_1023 < (8 * sizeof (long int)) - 1) 91 95 { 96 /* 32bit long: exponent_less_1023 in [20,30] */ 97 /* 64bit long: exponent_less_1023 in [20,62] */ 92 98 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)); 94 104 else 95 105 { 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)); 97 112 if (tmp < lsw) 98 113 ++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)); 100 120 } 101 121 } 102 122 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 51 51 * rounding mode. 52 52 * Method: 53 53 * 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;). 54 64 * Exception: 55 65 * Inexact flag raised if x not equal to rint(x). 56 66 */ … … 81 91 double t; 82 92 volatile double w; 83 93 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 */ 89 99 i1 |= (i0&0x0fffff); 90 100 i0 &= 0xfffe0000; 91 101 i0 |= ((i1|-i1)>>12)&0x80000; … … 95 105 GET_HIGH_WORD(i0,t); 96 106 SET_HIGH_WORD(t,(i0&0x7fffffff)|(sx<<31)); 97 107 return t; 98 } else { 108 } else { /* x has integer and maybe fraction */ 99 109 i = (0x000fffff)>>j0; 100 110 if(((i0&i)|i1)==0) return x; /* x is integral */ 101 111 i>>=1; 102 112 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); 105 116 } 106 117 } 107 118 } else if (j0>51) { … … 119 130 } 120 131 121 132 #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 68 68 msw &= 0x80000000; 69 69 if (exponent_less_1023 == -1) 70 70 /* Result is +1.0 or -1.0. */ 71 msw |= ( 1023 << 20);71 msw |= ((__int32_t)1023 << 20); 72 72 lsw = 0; 73 73 } 74 74 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 17 17 * should use scalbn() instead. 18 18 */ 19 19 20 #include <limits.h> 20 21 #include "fdlibm.h" 21 22 22 23 #ifndef _DOUBLE_IS_32BITS … … 46 47 else return x/(-fn); 47 48 } 48 49 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 49 53 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 51 61 return scalbn(x,(int)fn); 52 62 #endif 53 63 } -
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 43 43 return y; 44 44 #endif 45 45 } 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 17 17 18 18 #include "fdlibm.h" 19 19 20 #ifndef _DOUBLE_IS_32BITS 21 20 22 #ifdef __STDC__ 21 23 double tgamma(double x) 22 24 #else … … 42 44 return y; 43 45 #endif 44 46 } 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 81 81 libc.a 82 82 endif 83 83 84 noinst_DATA= stmp-targ-include84 BUILT_SOURCES = stmp-targ-include 85 85 86 86 toollib_DATA = $(CRT0) $(CRT1) 87 87 -
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 122 122 install-pdf-recursive install-ps-recursive install-recursive \ 123 123 installcheck-recursive installdirs-recursive pdf-recursive \ 124 124 ps-recursive uninstall-recursive 125 DATA = $( noinst_DATA) $(toollib_DATA)125 DATA = $(toollib_DATA) 126 126 RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ 127 127 distclean-recursive maintainer-clean-recursive 128 128 AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ … … 351 351 @USE_LIBTOOL_FALSE@toollib_LIBRARIES = libm.a \ 352 352 @USE_LIBTOOL_FALSE@ libc.a 353 353 354 noinst_DATA= stmp-targ-include354 BUILT_SOURCES = stmp-targ-include 355 355 toollib_DATA = $(CRT0) $(CRT1) 356 356 357 357 # The functions ldexp, frexp and modf are traditionally supplied in … … 411 411 412 412 # dejagnu support 413 413 RUNTESTFLAGS = 414 all: newlib.h414 all: $(BUILT_SOURCES) newlib.h 415 415 $(MAKE) $(AM_MAKEFLAGS) all-recursive 416 416 417 417 .SUFFIXES: … … 725 725 done 726 726 check-am: 727 727 $(MAKE) $(AM_MAKEFLAGS) check-DEJAGNU 728 check: check-recursive 728 check: $(BUILT_SOURCES) 729 $(MAKE) $(AM_MAKEFLAGS) check-recursive 729 730 all-am: Makefile $(LIBRARIES) $(LTLIBRARIES) $(DATA) newlib.h 730 731 installdirs: installdirs-recursive 731 732 installdirs-am: 732 733 for dir in "$(DESTDIR)$(toollibdir)" "$(DESTDIR)$(toollibdir)" "$(DESTDIR)$(toollibdir)"; do \ 733 734 test -z "$$dir" || $(MKDIR_P) "$$dir"; \ 734 735 done 735 install: install-recursive 736 install: $(BUILT_SOURCES) 737 $(MAKE) $(AM_MAKEFLAGS) install-recursive 736 738 install-exec: install-exec-recursive 737 739 install-data: install-data-recursive 738 740 uninstall: uninstall-recursive … … 758 760 maintainer-clean-generic: 759 761 @echo "This command is intended for maintainers to use" 760 762 @echo "it deletes files that may require special tools to rebuild." 763 -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) 761 764 clean: clean-recursive 762 765 763 766 clean-am: clean-generic clean-libtool clean-toollibLIBRARIES \ … … 833 836 uninstall-am: uninstall-toollibDATA uninstall-toollibLIBRARIES \ 834 837 uninstall-toollibLTLIBRARIES 835 838 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 838 842 839 843 .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ 840 844 all all-am am--refresh check check-DEJAGNU check-am clean \
Note: See TracBrowser
for help on using the repository browser.