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 1/2] BZ#13743: PowerPC - Add a new header for platformspecific functions


On Thu, 2012-03-08 at 09:58 -0500, Carlos O'Donell wrote:
> On Thu, Mar 8, 2012 at 8:52 AM, Thomas Schwinge <thomas@codesourcery.com> wrote:
> > On Thu, 8 Mar 2012 06:34:57 -0500, Ulrich Drepper <drepper@gmail.com> wrote:
> >> On Wed, Mar 7, 2012 at 09:16, Steven Munroe <munroesj@linux.vnet.ibm.com> wrote:
> >> > Now if you think only PowerPC has these issue, consider all the random
> >> > attempts to use the rdtsc instruction you might have seen, and how
> >> > useful it would be to have one well defined and correct version every
> >> > one could use.
> >>
> >> If this is a fair comparison then it is also clear that this
> >> discussion is completely misplaced here.  Something as trivial as
> >> rdtsc should be handled in the same way as said instruction is: in a
> >> header in gcc.  This way you also reach programmers who are not using
> >> glibc  but instead gcc on other platforms.
> >>
> >> Since this was brought up on the glibc list I have to assume there is
> >> more to it.  And that means your argumentation is deliberately
> >> misleading.
> >
> > I also wondered about these two issues: why is this to be part of the
> > sysdeps/unix/sysv/linux/ hierarchy, given there is nothing Linux-specific
> > to it (as far as I can tell), and why is this to be in glibc at all,
> > given there is nothing libc-specific to it (as far as I can tell)?  I
> > likewise would assume to find such a generic ``ISA helper header'' as
> > part of the compiler itself.
> 
> The IBM team have not said that it is *not* Linux specific, so we should
> ask them.
> 
> There may very well be something Linux-specific, for example on HPPA
> we have a cr16 that we can use for hp-timing, but it's only usable on
> an OS that synchronizes it among all CPUs that are online. While reading
> cr16 is easy, the setup is much more difficult and not mandated by any
> ISA.
> 
The timebnase is just one example we are working more.

The timebase is not a linux specific feature but other OSes do proved
simple C/C++ access to the timebase via headers.

Other examples like program priority register and priority adjustment
ops do need to be coordinated with the kernel (PPC save/restore).

We could split the Linux specific from the platform general cases. But I
don't why we would need to make this complicated.

If you really insist we could have ./sys/platform.h
from ./sysdeps/powerpc/ that includes ./bits/platform.h from
sysdeps/unix/sysv/linux/

> Regarding the GCC vs. GLIBC header split decision, I've summarized my
> opinion, and the points made in this conversation so far:

It is more work to get a builtin and perhaps that could be long term
goal, but many items start a simple headers with macros and then migrate
into gcc builtins after the general utility is accepted.

> http://sourceware.org/glibc/wiki/PlatformHeaders
> 
> Please comment.
> 
> Cheers,
> Carlos.
> 


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