public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] Is using the newlib optimised routines in side the Dsr (suppose if the dsr calls for every 10ms space)
@ 2007-10-05  6:04 srinivas naga vutukuri
  2007-10-05  9:08 ` [ECOS] " Sergei Organov
  0 siblings, 1 reply; 7+ messages in thread
From: srinivas naga vutukuri @ 2007-10-05  6:04 UTC (permalink / raw)
  To: ecos-discuss

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

http://sourceware.org/cgi-bin/cvsweb.cgi/src/newlib/libc/machine/xscale/memset.c?rev=1.3&content-type=text/x-cvsweb-markup&cvsroot=src

     What could be the possible difference if i use the direct coding
the routine of

void *
memset(void *sp1, int c, size_t n)
{

      if (n != 0) {
        unsigned char *sp = sp1;
        do {
                *sp++ = (unsigned char)c;
            } while (--n != 0);
      }
     return (sp1);
}


best regards,
srinivas.

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [ECOS]  Re: Is using the newlib optimised routines in side the Dsr (suppose  if the dsr calls for every 10ms space)
  2007-10-05  6:04 [ECOS] Is using the newlib optimised routines in side the Dsr (suppose if the dsr calls for every 10ms space) srinivas naga vutukuri
@ 2007-10-05  9:08 ` Sergei Organov
  2007-10-05 12:12   ` Andrew Lunn
  0 siblings, 1 reply; 7+ messages in thread
From: Sergei Organov @ 2007-10-05  9:08 UTC (permalink / raw)
  To: ecos-discuss

"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).

Anyway, there should be no harm using 'memset' from either newlib or
eCos from DSR, unless there are some xscale-specific issues I'm not
aware of.

-- 
Sergei.


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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [ECOS]  Re: Is using the newlib optimised routines in side the  Dsr (suppose  if the dsr calls for every 10ms space)
  2007-10-05  9:08 ` [ECOS] " Sergei Organov
@ 2007-10-05 12:12   ` Andrew Lunn
  2007-10-05 12:23     ` Gary Thomas
  2007-10-05 14:22     ` Grant Edwards
  0 siblings, 2 replies; 7+ messages in thread
From: Andrew Lunn @ 2007-10-05 12:12 UTC (permalink / raw)
  To: Sergei Organov; +Cc: ecos-discuss

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [ECOS]  Re: Is using the newlib optimised routines in side the   Dsr (suppose  if the dsr calls for every 10ms space)
  2007-10-05 12:12   ` Andrew Lunn
@ 2007-10-05 12:23     ` Gary Thomas
  2007-10-05 14:22     ` Grant Edwards
  1 sibling, 0 replies; 7+ messages in thread
From: Gary Thomas @ 2007-10-05 12:23 UTC (permalink / raw)
  To: Sergei Organov, ecos-discuss

Andrew Lunn wrote:
> 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.

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [ECOS]  Re: Is using the newlib optimised routines in side the  Dsr (suppose  if the dsr calls for every 10ms space)
  2007-10-05 12:12   ` Andrew Lunn
  2007-10-05 12:23     ` Gary Thomas
@ 2007-10-05 14:22     ` Grant Edwards
  2007-10-05 14:51       ` Daniel Néri
  2007-10-05 16:28       ` Sergei Organov
  1 sibling, 2 replies; 7+ messages in thread
From: Grant Edwards @ 2007-10-05 14:22 UTC (permalink / raw)
  To: ecos-discuss

On 2007-10-05, Andrew Lunn <andrew@lunn.ch> wrote:

> 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.

That's something I've never understood.  I use gcc for a
half-dozen non-eCos embedded targets, and never had to use
newlib to get the toolchains to compile.  They've always
compiled fine without it.

What is it about eCos that requires newlib?

-- 
Grant Edwards                   grante             Yow! As President I have
                                  at               to go vacuum my coin
                               visi.com            collection!


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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [ECOS]  Re: Is using the newlib optimised routines in side the  Dsr (suppose  if the dsr calls for every 10ms space)
  2007-10-05 14:22     ` Grant Edwards
@ 2007-10-05 14:51       ` Daniel Néri
  2007-10-05 16:28       ` Sergei Organov
  1 sibling, 0 replies; 7+ messages in thread
From: Daniel Néri @ 2007-10-05 14:51 UTC (permalink / raw)
  To: ecos-discuss

Grant Edwards <grante@visi.com> writes:

> What is it about eCos that requires newlib?

Nothing, in my experience. At least w/ recent versions of GCC.


Regards,
-- 
Daniel Néri <daniel.neri@sigicom.se>
Sigicom AB, Stockholm, Sweden


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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [ECOS]  Re: Is using the newlib optimised routines in side the Dsr (suppose   if the dsr calls for every 10ms space)
  2007-10-05 14:22     ` Grant Edwards
  2007-10-05 14:51       ` Daniel Néri
@ 2007-10-05 16:28       ` Sergei Organov
  1 sibling, 0 replies; 7+ messages in thread
From: Sergei Organov @ 2007-10-05 16:28 UTC (permalink / raw)
  To: ecos-discuss

Grant Edwards <grante@visi.com> writes:

> On 2007-10-05, Andrew Lunn <andrew@lunn.ch> wrote:
>
>> 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.
>
> That's something I've never understood.  I use gcc for a
> half-dozen non-eCos embedded targets, and never had to use
> newlib to get the toolchains to compile.  They've always
> compiled fine without it.

My experience is opposite. I never succeeded to get cross-compiler for
embedded target without a link to newlib tree from withing gcc tree, and
then newlib is compiled and installed along with gcc. Maybe it's fixed
in recent GCCs though.

-- Sergei.


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

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2007-10-05 16:28 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-10-05  6:04 [ECOS] Is using the newlib optimised routines in side the Dsr (suppose if the dsr calls for every 10ms space) srinivas naga vutukuri
2007-10-05  9:08 ` [ECOS] " Sergei Organov
2007-10-05 12:12   ` Andrew Lunn
2007-10-05 12:23     ` Gary Thomas
2007-10-05 14:22     ` Grant Edwards
2007-10-05 14:51       ` Daniel Néri
2007-10-05 16:28       ` Sergei Organov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).