Ticket #370: newlib-1.11.0-rtems-20030203.diff

File newlib-1.11.0-rtems-20030203.diff, 24.7 KB (added by Ralf Corsepius, on 12/03/06 at 13:31:12)

newlib-1.11.0-rtems-20030203.diff

  • newlib-1.11.0/newlib/libc/include/machine/types.h

    diff -uNr /usr1/rtems/work-tools/original/newlib-1.11.0/newlib/libc/include/machine/types.h newlib-1.11.0/newlib/libc/include/machine/types.h
    old new  
    88 */
    99
    1010#if defined(__rtems__)
    11 typedef long long          int64_t;
     11typedef signed long long   int64_t;
    1212#if defined( __h8300__)
    13 typedef long               int32_t;
     13typedef signed long        int32_t;
    1414#else
    15 typedef int                int32_t;
     15typedef signed int         int32_t;
    1616#endif
    17 typedef short              int16_t;
    18 typedef char               int8_t;
     17typedef signed short       int16_t;
     18typedef signed char        int8_t;
    1919
    2020typedef unsigned long long u_int64_t;
    2121#if defined( __h8300__)
  • newlib-1.11.0/newlib/libc/include/sys/signal.h

    diff -uNr /usr1/rtems/work-tools/original/newlib-1.11.0/newlib/libc/include/sys/signal.h newlib-1.11.0/newlib/libc/include/sys/signal.h
    old new  
    279279#define SIGTERM 15      /* software termination signal from kill */
    280280
    281281#if defined(__rtems__)
    282 #define SIGUSR1 16  /* reserved as application defined signal 1 */
    283 #define SIGUSR2 17  /* reserved as application defined signal 2 */
    284 
    285 #define __SIGFIRSTNOTRT SIGHUP
    286 #define __SIGLASTNOTRT  SIGUSR2
    287 
    288 /* RTEMS does not support job control, hence no Job Control Signals are
    289    defined per P1003.1b-1993, p. 60-61.
    290 
    291    RTEMS does not support memory protection, hence no Memory Protection
    292    Signals are defined per P1003.1b-1993, p. 60-61. */
     282#define SIGURG  16      /* urgent condition on IO channel */
     283#define SIGSTOP 17      /* sendable stop signal not from tty */
     284#define SIGTSTP 18      /* stop signal from tty */
     285#define SIGCONT 19      /* continue a stopped process */
     286#define SIGCHLD 20      /* to parent on child stop or exit */
     287#define SIGCLD  20      /* System V name for SIGCHLD */
     288#define SIGTTIN 21      /* to readers pgrp upon background tty read */
     289#define SIGTTOU 22      /* like TTIN for output if (tp->t_local&LTOSTOP) */
     290#define SIGIO   23      /* input/output possible signal */
     291#define SIGPOLL SIGIO   /* System V name for SIGIO */
     292#define SIGWINCH 24     /* window changed */
     293#define SIGUSR1 25      /* user defined signal 1 */
     294#define SIGUSR2 26      /* user defined signal 2 */
    293295
    294296/* Real-Time Signals Range, P1003.1b-1993, p. 61
    295297   NOTE: By P1003.1b-1993, this should be at least RTSIG_MAX
    296298         (which is a minimum of 8) signals.
    297299 */
     300#define SIGRTMIN 27
     301#define SIGRTMAX 31
     302#define __SIGFIRSTNOTRT SIGHUP
     303#define __SIGLASTNOTRT  SIGUSR2
    298304
    299 #define SIGRTMIN 18
    300 #define SIGRTMAX 32
     305#define NSIG    32      /* signal 0 implied */
    301306
    302307#elif defined(__svr4__)
    303308/* svr4 specifics. different signals above 15, and sigaction. */
  • newlib-1.11.0/newlib/libc/machine/arm/Makefile.am

    diff -uNr /usr1/rtems/work-tools/original/newlib-1.11.0/newlib/libc/machine/arm/Makefile.am newlib-1.11.0/newlib/libc/machine/arm/Makefile.am
    old new  
    66
    77noinst_LIBRARIES = lib.a
    88
    9 lib_a_SOURCES =
     9lib_a_SOURCES = memcpy.S
    1010
    1111ACLOCAL_AMFLAGS = -I ../../..
    1212CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host
  • newlib-1.11.0/newlib/libc/machine/arm/Makefile.in

    diff -uNr /usr1/rtems/work-tools/original/newlib-1.11.0/newlib/libc/machine/arm/Makefile.in newlib-1.11.0/newlib/libc/machine/arm/Makefile.in
    old new  
    1 # Makefile.in generated automatically by automake 1.4 from Makefile.am
     1# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am
    22
    3 # Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
     3# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
    44# This Makefile.in is free software; the Free Software Foundation
    55# gives unlimited permission to copy and/or distribute it,
    66# with or without modifications, as long as this notice is preserved.
     
    8989
    9090noinst_LIBRARIES = lib.a
    9191
    92 lib_a_SOURCES =
     92lib_a_SOURCES = memcpy.S
    9393
    9494ACLOCAL_AMFLAGS = -I ../../..
    9595CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host
     
    103103CPPFLAGS = @CPPFLAGS@
    104104LIBS = @LIBS@
    105105lib_a_LIBADD =
    106 lib_a_OBJECTS =
     106lib_a_OBJECTS =  memcpy.o
     107CFLAGS = @CFLAGS@
     108COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
     109CCLD = $(CC)
     110LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@
    107111DIST_COMMON =  Makefile.am Makefile.in aclocal.m4 configure configure.in
    108112
    109113
     
    166170        -rm -f lib.a
    167171        $(AR) cru lib.a $(lib_a_OBJECTS) $(lib_a_LIBADD)
    168172        $(RANLIB) lib.a
     173
    169174tags: TAGS
    170 TAGS:
    171175
     176ID: $(HEADERS) $(SOURCES) $(LISP)
     177        list='$(SOURCES) $(HEADERS)'; \
     178        unique=`for i in $$list; do echo $$i; done | \
     179          awk '    { files[$$0] = 1; } \
     180               END { for (i in files) print i; }'`; \
     181        here=`pwd` && cd $(srcdir) \
     182          && mkid -f$$here/ID $$unique $(LISP)
     183
     184TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) $(LISP)
     185        tags=; \
     186        here=`pwd`; \
     187        list='$(SOURCES) $(HEADERS)'; \
     188        unique=`for i in $$list; do echo $$i; done | \
     189          awk '    { files[$$0] = 1; } \
     190               END { for (i in files) print i; }'`; \
     191        test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
     192          || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags  $$unique $(LISP) -o $$here/TAGS)
     193
     194mostlyclean-tags:
     195
     196clean-tags:
     197
     198distclean-tags:
     199        -rm -f TAGS ID
     200
     201maintainer-clean-tags:
    172202
    173203distdir = $(PACKAGE)-$(VERSION)
    174204top_distdir = $(distdir)
     
    256286
    257287maintainer-clean-generic:
    258288mostlyclean-am:  mostlyclean-noinstLIBRARIES mostlyclean-compile \
    259                 mostlyclean-generic
     289                mostlyclean-tags mostlyclean-generic
    260290
    261291mostlyclean: mostlyclean-am
    262292
    263 clean-am:  clean-noinstLIBRARIES clean-compile clean-generic \
     293clean-am:  clean-noinstLIBRARIES clean-compile clean-tags clean-generic \
    264294                mostlyclean-am
    265295
    266296clean: clean-am
    267297
    268298distclean-am:  distclean-noinstLIBRARIES distclean-compile \
    269                 distclean-generic clean-am
     299                distclean-tags distclean-generic clean-am
    270300
    271301distclean: distclean-am
    272302        -rm -f config.status
    273303
    274304maintainer-clean-am:  maintainer-clean-noinstLIBRARIES \
    275                 maintainer-clean-compile maintainer-clean-generic \
    276                 distclean-am
     305                maintainer-clean-compile maintainer-clean-tags \
     306                maintainer-clean-generic distclean-am
    277307        @echo "This command is intended for maintainers to use;"
    278308        @echo "it deletes files that may require special tools to rebuild."
    279309
     
    283313.PHONY: mostlyclean-noinstLIBRARIES distclean-noinstLIBRARIES \
    284314clean-noinstLIBRARIES maintainer-clean-noinstLIBRARIES \
    285315mostlyclean-compile distclean-compile clean-compile \
    286 maintainer-clean-compile tags distdir info-am info dvi-am dvi check \
     316maintainer-clean-compile tags mostlyclean-tags distclean-tags \
     317clean-tags maintainer-clean-tags distdir info-am info dvi-am dvi check \
    287318check-am installcheck-am installcheck install-info-am install-info \
    288319install-exec-am install-exec install-data-am install-data install-am \
    289320install uninstall-am uninstall all-redirect all-am all installdirs \
  • newlib-1.11.0/newlib/libc/machine/arm/memcpy.S

    diff -uNr /usr1/rtems/work-tools/original/newlib-1.11.0/newlib/libc/machine/arm/memcpy.S newlib-1.11.0/newlib/libc/machine/arm/memcpy.S
    old new  
     1/*      $NetBSD: memcpy.S,v 1.3 1997/11/22 03:27:12 mark Exp $  */
     2
     3/*-
     4 * Copyright (c) 1997 The NetBSD Foundation, Inc.
     5 * All rights reserved.
     6 *
     7 * This code is derived from software contributed to The NetBSD Foundation
     8 * by Neil A. Carson and Mark Brinicombe
     9 *
     10 * Redistribution and use in source and binary forms, with or without
     11 * modification, are permitted provided that the following conditions
     12 * are met:
     13 * 1. Redistributions of source code must retain the above copyright
     14 *    notice, this list of conditions and the following disclaimer.
     15 * 2. Redistributions in binary form must reproduce the above copyright
     16 *    notice, this list of conditions and the following disclaimer in the
     17 *    documentation and/or other materials provided with the distribution.
     18 * 3. All advertising materials mentioning features or use of this software
     19 *    must display the following acknowledgement:
     20 *      This product includes software developed by the NetBSD
     21 *      Foundation, Inc. and its contributors.
     22 * 4. Neither the name of The NetBSD Foundation nor the names of its
     23 *    contributors may be used to endorse or promote products derived
     24 *    from this software without specific prior written permission.
     25 *
     26 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
     27 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
     28 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     29 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
     30 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     31 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     32 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     33 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     34 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     35 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     36 * POSSIBILITY OF SUCH DAMAGE.
     37 */
     38
     39/* This was modified by Jay Monkman <jmonkman@smoothsmoothie.com> to
     40 *   save and restore r12. This is necessary for RTEMS.
     41 */
     42/* #include <machine/asm.h>*/
     43
     44#define ENTRY(_LABEL) \
     45  .global _LABEL ; _LABEL:
     46/*
     47.globl memcpy
     48memcpy:
     49*/
     50ENTRY(memcpy)
     51        stmfd   sp!, {r0, r12, lr}
     52        bl      _memcpy
     53        ldmfd   sp!, {r0, r12, pc}
     54
     55
     56/*
     57.globl memove
     58memmove:
     59*/
     60ENTRY(memmove)
     61        stmfd   sp!, {r0, r12, lr}
     62        bl      _memcpy
     63        ldmfd   sp!, {r0, r12, pc}
     64       
     65
     66
     67/*
     68 * This is one fun bit of code ...
     69 * Some easy listening music is suggested while trying to understand this
     70 * code e.g. Iron Maiden
     71 *
     72 * For anyone attempting to understand it :
     73 *
     74 * The core code is implemented here with simple stubs for memcpy()
     75 * memmove() and bcopy().
     76 *
     77 * All local labels are prefixed with Lmemcpy_
     78 * Following the prefix a label starting f is used in the forward copy code
     79 * while a label using b is used in the backwards copy code
     80 * The source and destination addresses determine whether a forward or
     81 * backward copy is performed.
     82 * Separate bits of code are used to deal with the following situations
     83 * for both the forward and backwards copy.
     84 * unaligned source address
     85 * unaligned destination address
     86 * Separate copy routines are used to produce an optimised result for each
     87 * of these cases.
     88 * The copy code will use LDM/STM instructions to copy up to 32 bytes at
     89 * a time where possible.
     90 *
     91 * Note: r12 (aka ip) can be trashed during the function along with
     92 * r0-r3 although r0-r2 have defined uses i.e. src, dest, len through out.
     93 * Additional registers are preserved prior to use i.e. r4, r5 & lr
     94 *
     95 * Apologies for the state of the comments ;-)
     96 */
     97
     98
     99/*
     100_memcpy:
     101*/
     102ENTRY(_memcpy)
     103        /* Determine copy direction */
     104        cmp     r1, r0
     105        bcc     Lmemcpy_backwards
     106
     107        moveq   r0, #0                  /* Quick abort for len=0 */
     108        moveq   pc, lr
     109
     110        stmdb   sp!, {r0, lr}           /* memcpy() returns dest addr */
     111        subs    r2, r2, #4
     112        blt     Lmemcpy_fl4             /* less than 4 bytes */
     113        ands    r12, r0, #3
     114        bne     Lmemcpy_fdestul         /* oh unaligned destination addr */
     115        ands    r12, r1, #3
     116        bne     Lmemcpy_fsrcul          /* oh unaligned source addr */
     117
     118Lmemcpy_ft8:
     119        /* We have aligned source and destination */
     120        subs    r2, r2, #8
     121        blt     Lmemcpy_fl12            /* less than 12 bytes (4 from above) */
     122        subs    r2, r2, #0x14         
     123        blt     Lmemcpy_fl32            /* less than 32 bytes (12 from above) */
     124        stmdb   sp!, {r4}               /* borrow r4 */
     125
     126        /* blat 32 bytes at a time */
     127        /* XXX for really big copies perhaps we should use more registers */
     128Lmemcpy_floop32:       
     129        ldmia   r1!, {r3, r4, r12, lr}
     130        stmia   r0!, {r3, r4, r12, lr}
     131        ldmia   r1!, {r3, r4, r12, lr}
     132        stmia   r0!, {r3, r4, r12, lr}
     133        subs    r2, r2, #0x20         
     134        bge     Lmemcpy_floop32
     135
     136        cmn     r2, #0x10
     137        ldmgeia r1!, {r3, r4, r12, lr}  /* blat a remaining 16 bytes */
     138        stmgeia r0!, {r3, r4, r12, lr}
     139        subge   r2, r2, #0x10         
     140        ldmia   sp!, {r4}               /* return r4 */
     141
     142Lmemcpy_fl32:
     143        adds    r2, r2, #0x14         
     144
     145        /* blat 12 bytes at a time */
     146Lmemcpy_floop12:
     147        ldmgeia r1!, {r3, r12, lr}
     148        stmgeia r0!, {r3, r12, lr}
     149        subges  r2, r2, #0x0c         
     150        bge     Lmemcpy_floop12
     151
     152Lmemcpy_fl12:
     153        adds    r2, r2, #8
     154        blt     Lmemcpy_fl4
     155
     156        subs    r2, r2, #4
     157        ldrlt   r3, [r1], #4
     158        strlt   r3, [r0], #4
     159        ldmgeia r1!, {r3, r12}
     160        stmgeia r0!, {r3, r12}
     161        subge   r2, r2, #4
     162
     163Lmemcpy_fl4:
     164        /* less than 4 bytes to go */
     165        adds    r2, r2, #4
     166        ldmeqia sp!, {r0, pc}           /* done */
     167
     168        /* copy the crud byte at a time */
     169        cmp     r2, #2
     170        ldrb    r3, [r1], #1
     171        strb    r3, [r0], #1
     172        ldrgeb  r3, [r1], #1
     173        strgeb  r3, [r0], #1
     174        ldrgtb  r3, [r1], #1
     175        strgtb  r3, [r0], #1
     176        ldmia   sp!, {r0, pc}
     177
     178        /* erg - unaligned destination */
     179Lmemcpy_fdestul:
     180        rsb     r12, r12, #4
     181        cmp     r12, #2
     182
     183        /* align destination with byte copies */
     184        ldrb    r3, [r1], #1
     185        strb    r3, [r0], #1
     186        ldrgeb  r3, [r1], #1
     187        strgeb  r3, [r0], #1
     188        ldrgtb  r3, [r1], #1
     189        strgtb  r3, [r0], #1
     190        subs    r2, r2, r12
     191        blt     Lmemcpy_fl4             /* less the 4 bytes */
     192
     193        ands    r12, r1, #3
     194        beq     Lmemcpy_ft8             /* we have an aligned source */
     195
     196        /* erg - unaligned source */
     197        /* This is where it gets nasty ... */
     198Lmemcpy_fsrcul:
     199        bic     r1, r1, #3
     200        ldr     lr, [r1], #4
     201        cmp     r12, #2
     202        bgt     Lmemcpy_fsrcul3
     203        beq     Lmemcpy_fsrcul2
     204        cmp     r2, #0x0c           
     205        blt     Lmemcpy_fsrcul1loop4
     206        sub     r2, r2, #0x0c         
     207        stmdb   sp!, {r4, r5}
     208
     209Lmemcpy_fsrcul1loop16:
     210        mov     r3, lr, lsr #8
     211        ldmia   r1!, {r4, r5, r12, lr}
     212        orr     r3, r3, r4, lsl #24
     213        mov     r4, r4, lsr #8
     214        orr     r4, r4, r5, lsl #24
     215        mov     r5, r5, lsr #8
     216        orr     r5, r5, r12, lsl #24
     217        mov     r12, r12, lsr #8
     218        orr     r12, r12, lr, lsl #24
     219        stmia   r0!, {r3-r5, r12}
     220        subs    r2, r2, #0x10         
     221        bge     Lmemcpy_fsrcul1loop16
     222        ldmia   sp!, {r4, r5}
     223        adds    r2, r2, #0x0c         
     224        blt     Lmemcpy_fsrcul1l4
     225
     226Lmemcpy_fsrcul1loop4:
     227        mov     r12, lr, lsr #8
     228        ldr     lr, [r1], #4
     229        orr     r12, r12, lr, lsl #24
     230        str     r12, [r0], #4
     231        subs    r2, r2, #4
     232        bge     Lmemcpy_fsrcul1loop4
     233
     234Lmemcpy_fsrcul1l4:
     235        sub     r1, r1, #3
     236        b       Lmemcpy_fl4
     237
     238Lmemcpy_fsrcul2:
     239        cmp     r2, #0x0c           
     240        blt     Lmemcpy_fsrcul2loop4
     241        sub     r2, r2, #0x0c         
     242        stmdb   sp!, {r4, r5}
     243
     244Lmemcpy_fsrcul2loop16:
     245        mov     r3, lr, lsr #16
     246        ldmia   r1!, {r4, r5, r12, lr}
     247        orr     r3, r3, r4, lsl #16
     248        mov     r4, r4, lsr #16
     249        orr     r4, r4, r5, lsl #16
     250        mov     r5, r5, lsr #16
     251        orr     r5, r5, r12, lsl #16
     252        mov     r12, r12, lsr #16
     253        orr     r12, r12, lr, lsl #16
     254        stmia   r0!, {r3-r5, r12}
     255        subs    r2, r2, #0x10         
     256        bge     Lmemcpy_fsrcul2loop16
     257        ldmia   sp!, {r4, r5}
     258        adds    r2, r2, #0x0c         
     259        blt     Lmemcpy_fsrcul2l4
     260
     261Lmemcpy_fsrcul2loop4:
     262        mov     r12, lr, lsr #16
     263        ldr     lr, [r1], #4
     264        orr     r12, r12, lr, lsl #16
     265        str     r12, [r0], #4
     266        subs    r2, r2, #4
     267        bge     Lmemcpy_fsrcul2loop4
     268
     269Lmemcpy_fsrcul2l4:
     270        sub     r1, r1, #2
     271        b       Lmemcpy_fl4
     272
     273Lmemcpy_fsrcul3:
     274        cmp     r2, #0x0c           
     275        blt     Lmemcpy_fsrcul3loop4
     276        sub     r2, r2, #0x0c         
     277        stmdb   sp!, {r4, r5}
     278
     279Lmemcpy_fsrcul3loop16:
     280        mov     r3, lr, lsr #24
     281        ldmia   r1!, {r4, r5, r12, lr}
     282        orr     r3, r3, r4, lsl #8
     283        mov     r4, r4, lsr #24
     284        orr     r4, r4, r5, lsl #8
     285        mov     r5, r5, lsr #24
     286        orr     r5, r5, r12, lsl #8
     287        mov     r12, r12, lsr #24
     288        orr     r12, r12, lr, lsl #8
     289        stmia   r0!, {r3-r5, r12}
     290        subs    r2, r2, #0x10         
     291        bge     Lmemcpy_fsrcul3loop16
     292        ldmia   sp!, {r4, r5}
     293        adds    r2, r2, #0x0c         
     294        blt     Lmemcpy_fsrcul3l4
     295
     296Lmemcpy_fsrcul3loop4:
     297        mov     r12, lr, lsr #24
     298        ldr     lr, [r1], #4
     299        orr     r12, r12, lr, lsl #8
     300        str     r12, [r0], #4
     301        subs    r2, r2, #4
     302        bge     Lmemcpy_fsrcul3loop4
     303
     304Lmemcpy_fsrcul3l4:
     305        sub     r1, r1, #1
     306        b       Lmemcpy_fl4
     307
     308Lmemcpy_backwards:
     309        add     r1, r1, r2
     310        add     r0, r0, r2
     311        subs    r2, r2, #4
     312        blt     Lmemcpy_bl4             /* less than 4 bytes */
     313        ands    r12, r0, #3
     314        bne     Lmemcpy_bdestul         /* oh unaligned destination addr */
     315        ands    r12, r1, #3
     316        bne     Lmemcpy_bsrcul          /* oh unaligned source addr */
     317
     318Lmemcpy_bt8:
     319        /* We have aligned source and destination */
     320        subs    r2, r2, #8
     321        blt     Lmemcpy_bl12            /* less than 12 bytes (4 from above) */
     322        stmdb   sp!, {r4, lr}
     323        subs    r2, r2, #0x14           /* less than 32 bytes (12 from above) */
     324        blt     Lmemcpy_bl32
     325
     326        /* blat 32 bytes at a time */
     327        /* XXX for really big copies perhaps we should use more registers */
     328Lmemcpy_bloop32:
     329        ldmdb   r1!, {r3, r4, r12, lr}
     330        stmdb   r0!, {r3, r4, r12, lr}
     331        ldmdb   r1!, {r3, r4, r12, lr}
     332        stmdb   r0!, {r3, r4, r12, lr}
     333        subs    r2, r2, #0x20         
     334        bge     Lmemcpy_bloop32
     335
     336Lmemcpy_bl32:
     337        cmn     r2, #0x10           
     338        ldmgedb r1!, {r3, r4, r12, lr}  /* blat a remaining 16 bytes */
     339        stmgedb r0!, {r3, r4, r12, lr}
     340        subge   r2, r2, #0x10         
     341        adds    r2, r2, #0x14         
     342        ldmgedb r1!, {r3, r12, lr}      /* blat a remaining 12 bytes */
     343        stmgedb r0!, {r3, r12, lr}
     344        subge   r2, r2, #0x0c         
     345        ldmia   sp!, {r4, lr}
     346
     347Lmemcpy_bl12:
     348        adds    r2, r2, #8
     349        blt     Lmemcpy_bl4
     350        subs    r2, r2, #4
     351        ldrlt   r3, [r1, #-4]!
     352        strlt   r3, [r0, #-4]!
     353        ldmgedb r1!, {r3, r12}
     354        stmgedb r0!, {r3, r12}
     355        subge   r2, r2, #4
     356
     357Lmemcpy_bl4:
     358        /* less than 4 bytes to go */
     359        adds    r2, r2, #4
     360        moveq   pc, lr                  /* done */
     361
     362        /* copy the crud byte at a time */
     363        cmp     r2, #2
     364        ldrb    r3, [r1, #-1]!
     365        strb    r3, [r0, #-1]!
     366        ldrgeb  r3, [r1, #-1]!
     367        strgeb  r3, [r0, #-1]!
     368        ldrgtb  r3, [r1, #-1]!
     369        strgtb  r3, [r0, #-1]!
     370        mov     pc, lr
     371
     372        /* erg - unaligned destination */
     373Lmemcpy_bdestul:
     374        cmp     r12, #2
     375
     376        /* align destination with byte copies */
     377        ldrb    r3, [r1, #-1]!
     378        strb    r3, [r0, #-1]!
     379        ldrgeb  r3, [r1, #-1]!
     380        strgeb  r3, [r0, #-1]!
     381        ldrgtb  r3, [r1, #-1]!
     382        strgtb  r3, [r0, #-1]!
     383        subs    r2, r2, r12
     384        blt     Lmemcpy_bl4             /* less than 4 bytes to go */
     385        ands    r12, r1, #3
     386        beq     Lmemcpy_bt8             /* we have an aligned source */
     387
     388        /* erg - unaligned source */
     389        /* This is where it gets nasty ... */
     390Lmemcpy_bsrcul:
     391        bic     r1, r1, #3
     392        ldr     r3, [r1, #0]
     393        cmp     r12, #2
     394        blt     Lmemcpy_bsrcul1
     395        beq     Lmemcpy_bsrcul2
     396        cmp     r2, #0x0c           
     397        blt     Lmemcpy_bsrcul3loop4
     398        sub     r2, r2, #0x0c         
     399        stmdb   sp!, {r4, r5, lr}
     400
     401Lmemcpy_bsrcul3loop16:
     402        mov     lr, r3, lsl #8
     403        ldmdb   r1!, {r3-r5, r12}
     404        orr     lr, lr, r12, lsr #24
     405        mov     r12, r12, lsl #8
     406        orr     r12, r12, r5, lsr #24
     407        mov     r5, r5, lsl #8
     408        orr     r5, r5, r4, lsr #24
     409        mov     r4, r4, lsl #8
     410        orr     r4, r4, r3, lsr #24
     411        stmdb   r0!, {r4, r5, r12, lr}
     412        subs    r2, r2, #0x10         
     413        bge     Lmemcpy_bsrcul3loop16
     414        ldmia   sp!, {r4, r5, lr}
     415        adds    r2, r2, #0x0c         
     416        blt     Lmemcpy_bsrcul3l4
     417
     418Lmemcpy_bsrcul3loop4:
     419        mov     r12, r3, lsl #8
     420        ldr     r3, [r1, #-4]!
     421        orr     r12, r12, r3, lsr #24
     422        str     r12, [r0, #-4]!
     423        subs    r2, r2, #4
     424        bge     Lmemcpy_bsrcul3loop4
     425
     426Lmemcpy_bsrcul3l4:
     427        add     r1, r1, #3
     428        b       Lmemcpy_bl4
     429
     430Lmemcpy_bsrcul2:
     431        cmp     r2, #0x0c           
     432        blt     Lmemcpy_bsrcul2loop4
     433        sub     r2, r2, #0x0c         
     434        stmdb   sp!, {r4, r5, lr}
     435
     436Lmemcpy_bsrcul2loop16:
     437        mov     lr, r3, lsl #16
     438        ldmdb   r1!, {r3-r5, r12}
     439        orr     lr, lr, r12, lsr #16
     440        mov     r12, r12, lsl #16
     441        orr     r12, r12, r5, lsr #16
     442        mov     r5, r5, lsl #16
     443        orr     r5, r5, r4, lsr #16
     444        mov     r4, r4, lsl #16
     445        orr     r4, r4, r3, lsr #16
     446        stmdb   r0!, {r4, r5, r12, lr}
     447        subs    r2, r2, #0x10         
     448        bge     Lmemcpy_bsrcul2loop16
     449        ldmia   sp!, {r4, r5, lr}
     450        adds    r2, r2, #0x0c         
     451        blt     Lmemcpy_bsrcul2l4
     452
     453Lmemcpy_bsrcul2loop4:
     454        mov     r12, r3, lsl #16
     455        ldr     r3, [r1, #-4]!
     456        orr     r12, r12, r3, lsr #16
     457        str     r12, [r0, #-4]!
     458        subs    r2, r2, #4
     459        bge     Lmemcpy_bsrcul2loop4
     460
     461Lmemcpy_bsrcul2l4:
     462        add     r1, r1, #2
     463        b       Lmemcpy_bl4
     464
     465Lmemcpy_bsrcul1:
     466        cmp     r2, #0x0c           
     467        blt     Lmemcpy_bsrcul1loop4
     468        sub     r2, r2, #0x0c         
     469        stmdb   sp!, {r4, r5, lr}
     470
     471Lmemcpy_bsrcul1loop32:
     472        mov     lr, r3, lsl #24
     473        ldmdb   r1!, {r3-r5, r12}
     474        orr     lr, lr, r12, lsr #8
     475        mov     r12, r12, lsl #24
     476        orr     r12, r12, r5, lsr #8
     477        mov     r5, r5, lsl #24
     478        orr     r5, r5, r4, lsr #8
     479        mov     r4, r4, lsl #24
     480        orr     r4, r4, r3, lsr #8
     481        stmdb   r0!, {r4, r5, r12, lr}
     482        subs    r2, r2, #0x10         
     483        bge     Lmemcpy_bsrcul1loop32
     484        ldmia   sp!, {r4, r5, lr}
     485        adds    r2, r2, #0x0c         
     486        blt     Lmemcpy_bsrcul1l4
     487
     488Lmemcpy_bsrcul1loop4:
     489        mov     r12, r3, lsl #24
     490        ldr     r3, [r1, #-4]!
     491        orr     r12, r12, r3, lsr #8
     492        str     r12, [r0, #-4]!
     493        subs    r2, r2, #4
     494        bge     Lmemcpy_bsrcul1loop4
     495
     496Lmemcpy_bsrcul1l4:
     497        add     r1, r1, #1
     498        b       Lmemcpy_bl4
     499       
  • newlib-1.11.0/newlib/libc/sys/rtems/crt0.c

    diff -uNr /usr1/rtems/work-tools/original/newlib-1.11.0/newlib/libc/sys/rtems/crt0.c newlib-1.11.0/newlib/libc/sys/rtems/crt0.c
    old new  
    4141  int __FIXUP_START__;  int __FIXUP_END__;
    4242  int __EXCEPT_START__; int __EXCEPT_END__;
    4343  int __init;           int __fini;
     44  int __CTOR_LIST__;    int __CTOR_END__;
     45  int __DTOR_LIST__;    int __DTOR_END__;
    4446#endif
    4547
    4648/* The SH expects certain symbols to be defined in the linker script. */
     
    6163  asm ( "\$global\$:");
    6264*/
    6365
     66  asm (".text");
     67  asm (".global");
     68  asm (".EXPORT $$dyncall,ENTRY");
     69  asm ("$$dyncall:");
    6470  int atexit(void (*function)(void)) { return 0; }
    6571#endif
    6672
  • newlib-1.11.0/newlib/libc/sys/rtems/include/limits.h

    diff -uNr /usr1/rtems/work-tools/original/newlib-1.11.0/newlib/libc/sys/rtems/include/limits.h newlib-1.11.0/newlib/libc/sys/rtems/include/limits.h
    old new  
    1414#include_next <limits.h>
    1515#endif
    1616
     17#include <sys/syslimits.h>
     18
    1719#ifndef __POSIX_LIMITS_h
    1820#define __POSIX_LIMITS_h
    1921
     
    5759#define AIO_LISTIO_MAX          2
    5860#define AIO_MAX                 1
    5961#define AIO_PRIO_DELTA_MAX      0
    60 #define ARG_MAX                 4096
    61 #define CHILD_MAX               6
    6262#define DELAYTIMER_MAX          32
    6363#define MQ_OPEN_MAX             8
    6464#define MQ_PRIO_MAX             32
    65 #define OPEN_MAX                16
    6665#define PAGESIZE                1
    6766#define RTSIG_MAX               8
    6867#define SEM_NSEMS_MAX           256
     
    7372#define TZNAME_MAX              3
    7473
    7574/*
    76  *  Pathname Variables
    77  */
    78 
    79 #define LINK_MAX                8
    80 #define MAX_CANON               255
    81 #define MAX_INPUT               255
    82 #define NAME_MAX                255
    83 #define PATH_MAX                255
    84 #define PIPE_BUF                512
    85 
    86 /*
    8775 *  Invariant values
    8876 */
    8977
  • newlib-1.11.0/newlib/libc/sys/rtems/sys/param.h

    diff -uNr /usr1/rtems/work-tools/original/newlib-1.11.0/newlib/libc/sys/rtems/sys/param.h newlib-1.11.0/newlib/libc/sys/rtems/sys/param.h
    old new  
    4242#ifndef _SYS_PARAM_H_
    4343#define _SYS_PARAM_H_
    4444
     45/* from newlib's <sys/param.h> */
     46
     47#include <sys/config.h>
     48
     49#ifndef BIG_ENDIAN
     50#define BIG_ENDIAN 4321
     51#endif
     52#ifndef LITTLE_ENDIAN
     53#define LITTLE_ENDIAN 1234
     54#endif
     55
     56# define HZ (60)
     57# define PATHSIZE (1024)
     58
     59#ifndef BYTE_ORDER
     60#ifdef __IEEE_LITTLE_ENDIAN
     61#define BYTE_ORDER LITTLE_ENDIAN
     62#else
     63#define BYTE_ORDER BIG_ENDIAN
     64#endif
     65#endif
     66
     67/* end of from newlib's <sys/param.h> */
     68
    4569#include <unistd.h>
    4670
    4771#define BSD     199506          /* System version (year & month). */
  • newlib-1.11.0/newlib/libc/sys/rtems/sys/syslimits.h

    diff -uNr /usr1/rtems/work-tools/original/newlib-1.11.0/newlib/libc/sys/rtems/sys/syslimits.h newlib-1.11.0/newlib/libc/sys/rtems/sys/syslimits.h
    old new  
    3737#ifndef _SYS_SYSLIMITS_H_
    3838#define _SYS_SYSLIMITS_H_
    3939
    40 #if !defined(__rtems__)
    41 #define ARG_MAX                 65536   /* max bytes for an exec function */
    42 #endif
    43 
    44 #if !defined(__rtems__)
     40#define ARG_MAX                  4096   /* max bytes for an exec function */
    4541#ifndef CHILD_MAX
    46 #define CHILD_MAX                  40   /* max simultaneous processes */
    47 #endif
    48 #endif
    49 
    50 #if !defined(__rtems__)
    51 #define LINK_MAX                32767   /* max file link count */
     42#define CHILD_MAX                   6   /* max simultaneous processes */
    5243#endif
    53 
     44#define LINK_MAX                    8   /* max file link count */
    5445#define MAX_CANON                 255   /* max bytes in term canon input line */
    55 
    5646#define MAX_INPUT                 255   /* max bytes in terminal input */
    57 
    58 #if !defined(__rtems__)
    5947#define NAME_MAX                  255   /* max bytes in a file name */
    60 #endif
    61 
    6248#define NGROUPS_MAX                16   /* max supplemental group id's */
    63 
    64 #if !defined(__rtems__)
    6549#ifndef OPEN_MAX
    6650#define OPEN_MAX                   64   /* max open files per process */
    6751#endif
    68 #endif
    69 
    70 #if !defined(__rtems__)
    71 #define PATH_MAX                 1024   /* max bytes in pathname */
    72 #endif
    73 
     52#define PATH_MAX                  255   /* max bytes in pathname */
    7453#define PIPE_BUF                  512   /* max bytes for atomic pipe writes */
    75 
     54#define IOV_MAX                  1024   /* max elements in i/o vector */
    7655#define BC_BASE_MAX                99   /* max ibase/obase values in bc(1) */
    7756#define BC_DIM_MAX               2048   /* max array elements in bc(1) */
    7857#define BC_SCALE_MAX               99   /* max scale value in bc(1) */