This is the mail archive of the newlib@sources.redhat.com mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Time functions in newlib



----- Original Message -----
From: "J. Johnston" <jjohnstn@cygnus.com>
To: "Lewin A.R.W. Edwards" <ledwards@digi-frame.com>
Cc: "Cliff Tsai" <clifftsai@axisoft.com>; <newlib@sources.redhat.com>
Sent: Thursday, July 12, 2001 4:01 AM
Subject: Re: Time functions in newlib


> "Lewin A.R.W. Edwards" wrote:
> >
> > Hi Cliff,
> >
> > > > I'm working with a custom ARM7 platform, and I'm basically linking
with
> > > > newlib only to get access to a few math functions that are inserted
> > > > * time-based functions, e.g. clock()? Is there a global tick count
> > >variable
> > > > I can just increment in an ISR?
> > >
> > >For clock(),you need a libgloss function:times(),
> > >That is dependent on your hardware.
> >
> > Libgloss isn't supported on arm-unknown-elf, or at least the newlib
> > configure script tells me it isn't.
> >
>
> Arm is one of those relics where the syscalls were originally put in the
libc/sys directory.  You
> will find the syscalls defined in newlib/libc/sys/arm/syscalls.c.  There
is an _times routine
> supplied which uses an SWI call.
>
> > > > functions. How do I tell newlib where its heap begins and ends? (In
my
> > >
> > >Specify the heap begin and end in the linker script,
> >
> > Er, but what are the names of the symbols? :)
> >
>
> The syscalls.c file also supplies an _sbrk routine which supports malloc.
It is looking for the
> "end" symbol (end of bss) and increments forward from that symbol until it
meets the stack pointer.
>
> -- Jeff J.

That't good,I also define a "start" symbol in my linker scipt,and check if
the allocated memory exceeds the range(start to end) in sbrk.If yes return
a -ENOMEM...

Cliff



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]