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]

[PATCH 0/4] Export AT_HWCAP from libc.


While it's certainly possible to recover AT_HWCAP from /proc/auxv,
it's definitely inconvenient.  I'm working on a second gcc support
library which needs this info, and I think it's high time to just
add an interface which may be autoconfigured.

As far as I know there are only 3 targets for which an interface
like this is largely irrelevant because all the info is available
via user-space insns: i386 (cpuid), alpha (amask) and s390 (stfle).
That said, I see no point in *preventing* this one symbol from
being exported on those targets.  Even there they can still be
useful (e.g. s390, in determining that stfle itself actually exists
w/o sigill handlers).

I've included an empty <bits/hwcap.h> so as not to break the build
for any target that hasn't filled these in.  I've filled in values
for s390, sparc, and powerpc based on existing usage.

The sparc/powerpc headers logically belong under linux/, as these
bits are (afaik) picked at random by the kernel and not architected
(as with cpuid bits).  But they were already being defined in the
non-os-specific sysdep.h file, so it clearly can't hurt to let them
stay there.  To avoid duplicating the defines, sysdep.h uses the new
header.

Bike-shedding on the name __libc_hwcap, anyone?

"Tested" on x86_64; I've not yet build the relevant crosses.
If approved I'll submit a <bits/hwcap.h> for ARM as well.

Ok?


r~


Richard Henderson (4):
  Add <sys/hwcap.h> and associated __libc_hwcap function.
  s390: Add <bits/hwcap.h>.
  sparc: Add <bits/hwcap.h>
  powerpc: Add <bits/hwcap.h>

 misc/Makefile                             |    4 +-
 misc/Versions                             |    3 ++
 misc/bits/hwcap.h                         |   23 ++++++++++++
 misc/hwcap.c                              |   27 +++++++++++++++
 misc/sys/hwcap.h                          |   32 +++++++++++++++++
 sysdeps/powerpc/bits/hwcap.h              |   53 +++++++++++++++++++++++++++++
 sysdeps/powerpc/sysdep.h                  |   29 ++--------------
 sysdeps/sparc/bits/hwcap.h                |   47 +++++++++++++++++++++++++
 sysdeps/sparc/sysdep.h                    |   29 +---------------
 sysdeps/unix/sysv/linux/s390/bits/hwcap.h |   36 +++++++++++++++++++
 10 files changed, 228 insertions(+), 55 deletions(-)
 create mode 100644 misc/bits/hwcap.h
 create mode 100644 misc/hwcap.c
 create mode 100644 misc/sys/hwcap.h
 create mode 100644 sysdeps/powerpc/bits/hwcap.h
 create mode 100644 sysdeps/sparc/bits/hwcap.h
 create mode 100644 sysdeps/unix/sysv/linux/s390/bits/hwcap.h

-- 
1.7.7.6


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