Andrew Lunn wrote: > On Fri, Oct 05, 2007 at 12:53:32PM +0400, Sergei Organov wrote: >> "srinivas naga vutukuri" <[EMAIL PROTECTED]> writes: >> >>> Dear All, >>> >>> I just want to know that is there any problem of using the >>> newlib optimised C library routines in side the Dsr (suppose if the >>> Dsr calls for every 10ms space). >>> >>> I am using xscale (ixp425) tool chain, and newlib is part of the >>> tool chain. So obviously this piece of code might have been used when >>> i call memset inside my application code of eCos >> When you just use memset in eCos application, most probably it will be >> taken not from newlib, but from eCos own C library. You can easily check >> what is linked by searching for 'memset' in the map file generated by the >> linker. In my case 'memset' is taken from >> ecos/install/lib/libtarget.a(infra_memset.o). > > The newlib library is not used for anything in eCos. My understanding > is that newlib is just there in order to get the toolchain to compile.
Correct, although RedBoot *can* be configured to support stand-alone programs built using newlib only (no eCos code involved). Normal eCos applications don't use newlib in any way. > One other comment is that sometimes the compiler will use its builtin > implementations of simple functions like memset, etc. This is > especially true when it has fixed parameters, eg memset(&foo, 0, > 4). The compile will just use a couple of machine instructions, rather > than making a function call. True, but this does depend on the hardware (architecture) - GCC does things differently on each. Effort was made to make sure that the eCos source tree itself always has its own implementation of any routines used by the compiler. This was done so that we could control all aspects of the resulting code. > A general rule of thumb for DSR. Don't call any functions which could > block. string functions should be safe. > > Andrew > -- ------------------------------------------------------------ Gary Thomas | Consulting for the MLB Associates | Embedded world ------------------------------------------------------------ -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss
