V4: [PATCH] x86: Install <sys/platform/x86.h> [BZ #26124]

H.J. Lu hjl.tools@gmail.com
Wed Jun 24 21:10:19 GMT 2020


On Wed, Jun 24, 2020 at 1:04 PM Adhemerval Zanella via Libc-alpha
<libc-alpha@sourceware.org> wrote:
>
>
>
> On 24/06/2020 11:33, Florian Weimer via Libc-alpha wrote:
> > * H. J. Lu:
> >
> >> Here is the updated patch with
> >>
> >>  -- Macro: int HAS_CPU_FEATURE (NAME)
> >>      This macro returns a nonzero value (true) if the processor has the
> >>      feature NAME.
> >>
> >>  -- Macro: int CPU_FEATURE_USABLE (NAME)
> >>      This macro returns a nonzero value (true) if the processor has the
> >>      feature NAME and the feature is supported by the operating system.
> >
> > This is indeed less confusing.  Thanks.
> >
> > I'm still convinced we have a real use case for HAS_CPU_FEATURE.
> >
> > Does anyone else want to comment on this?
> >
> > Thanks,
> > Florian
> >
>
> Should we provide it only for __USE_GNU (_GNU_SOURCE)? And I guess that cpuid

Do we do that for other <sys/platform/XXX.h> files?

> is not expected to be extendable. The macro API is not my favorite way of

We can expand the cpuid array.  We just need to add an alias to
__x86_get_cpu_features
with a new symbol version.

> doing it, but it looks ok.

I will check it in tomorrow if there are no further comments.

Thanks.

-- 
H.J.


More information about the Libc-alpha mailing list