This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] hp-timing for ppc32/64


On Wed, 2005-10-12 at 09:36 -0500, Steve Munroe wrote:
> libc-alpha-owner@sources.redhat.com wrote on 10/11/2005 07:11:30 PM:
> 
> > On Mon, 2005-10-10 at 17:18 -0500, Steve Munroe wrote:
> > 
> > > This patch adds hp-timing for powerpc32 and powerpc64.
> > 
> > A couple of questions here:
> > 
> >  - Do you have any provision to deal with ppc32 CPUs that do not provide
> > the TB but different timing mecanisms ? Should we add a CPU feature bit
> > exposed by the kernel to userland ?
> > 
> Which CPUs don't implement the timebase. It is a required element of the 
> PowerPC architecture (not optional).

At least 601 and 403GX. I've just submitted a kernel patch that adds a
feature bit "NO_TB" that indicates that there is no standard timebase on
the CPU. The idea here is that older kernels don't have it, so you just
proceed with your code and too bad if you have the wrong CPU, but on
newer kernels, you'll be able to detect that bit and bail out
gracefully.

> >  - I haven't read/found the hp-timing spec yet, but are we supposed to
> > be able to convert between hp-timing values/diffs & actual time units
> > (like nanoseconds or so) ? That would require to know the TB calibration
> > values, which is currently not exposed by the kernel in any way you are
> > supposed to use in userland afaik. I could add a vDSO entry point for
> > that though (and to a ppc32 vDSO which will happen soon).
> > 
> 
> hp-timing returns the raw timebase which is analogous to the Intel "Time 
> Stamp Counter". There is no requirement convert to clock time or 
> nanoseconds. This is used for internal timing of the loader and internal 
> libc test.
> 
> However clock_gettime(CLOCK_PROCESS_CPUTIME_ID) may use hp-timing if 
> __get_clockfreq() is available. The other implementations read and parse 
> /proc/cpuinfo. But it would be useful to get the timebase value directly 
> from vdso instead!

I will add that.

Ben.

> Steven J. Munroe
> Linux on Power Toolchain Architect
> IBM Corporation, Linux Technology Center


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