japaric/steed

Implement a Rust analog to `getauxval(3)`

Opened this issue · 0 comments

ring uses getauxval(AT_HWCAP) and getauxval(AT_HWCAP2) on ARM & AAarch64 (and maybe all platforms eventually) to determine which hardware instructions are available: NEON, ARMv8 crypto instructions, etc. When targetting non-Android ARM/AAarch64 Linux using steed, we need a way to get the same information, ideally using a Rust API instead of a C API.

See http://articles.manugarg.com/aboutelfauxiliaryvectors and http://man7.org/linux/man-pages/man3/getauxval.3.html and the Android implementation:
https://android.googlesource.com/platform/bionic/+/master/libc/bionic/getauxval.cpp
https://android.googlesource.com/platform/bionic/+/master/libc/bionic/libc_init_common.cpp#77