This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH 1/2] BZ#13743: PowerPC - Add a new header for platformspecific functions
On Tue, 2012-03-06 at 09:25 -0800, Roland McGrath wrote:
> > I would like to see sys/platform.h become the place for non-standard
> > low-level macros.
>
> The standard place for nonstandard interfaces. Sure, buddy. Whatever.
> Given that they are entirely nonstandard anyway, I'm not sure it makes
> much difference whether they are in some generic-sounding header like
> this or in headers with more specific names.
>
> I'm solidly ambivalent about the utility of a catch-all header for
> random things. I'd say the fact that other systems use this file name
> is between meaningless and negative as a recommendation to use it for
> something that isn't even trying to be compatible with any other system.
>
> In the absence of any common interface (which could even be just one
> other system whose header name and interface we match, as we have done
> before), there is some logic in using individual headers with names as
> specific as possible (e.g. <ppc-timebase.h> here). That makes it much
> clearer for applications to include exactly what they use.
>
Well I could see these files breeding like bunnies:
<ppc-program-priority-registers.h> <ppc-data-stream-control-register.h>
<ppc-data-cache-block-ops.h> <ppc-memory-barriers.h>
<ppc-authority-mask-register.h>
All are problems state operations that can be very useful in high
performance multi-core / multi-thread applications.
https://www.power.org/resources/downloads/PowerISA_V2.06B_V2_PUBLIC.pdf
I suspect we would quickly go back to having a sys/platform.h that
includes all the various specific includes for convenience.