[ECOS] Re: Is using the newlib optimised routines in side the Dsr (suppose if the dsr calls for every 10ms space)

Andrew Lunn andrew@lunn.ch
Fri Oct 5 12:12:00 GMT 2007


On Fri, Oct 05, 2007 at 12:53:32PM +0400, Sergei Organov wrote:
> "srinivas naga vutukuri" <srinivas.vutukuri@gmail.com> 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.

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.

A general rule of thumb for DSR. Don't call any functions which could
block. string functions should be safe.

       Andrew

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss



More information about the Ecos-discuss mailing list