Skip to content

Commit

Permalink
Auto merge of #2172 - tarcieri:musl-hwcaps, r=Amanieu
Browse files Browse the repository at this point in the history
musl: add missing AArch64 HWCAP_* consts

Closes #2171.

I effectively just copied and pasted these from #1638 after confirming that they are identical to musl's [aarch64/bits/hwcap.h](https://github.com/bminor/musl/blob/4433115/arch/aarch64/bits/hwcap.h) and that musl's `getauxval()` also takes a `c_ulong`.

It seems like if these are added it would address some of [`TODO-linux.txt`](https://github.com/rust-lang/libc/blob/ed1399a/libc-test/semver/TODO-linux.txt)?
  • Loading branch information
bors committed May 13, 2021
2 parents d02ce7f + 20b2b2c commit 393a80d
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 32 deletions.
32 changes: 0 additions & 32 deletions libc-test/semver/TODO-linux.txt
Original file line number Diff line number Diff line change
@@ -1,38 +1,6 @@
# The following symbols are not not available in some combinations of
# musl/gnu/android and/or architecture.
BOTHER
HWCAP_AES
HWCAP_ASIMD
HWCAP_ASIMDDP
HWCAP_ASIMDFHM
HWCAP_ASIMDHP
HWCAP_ASIMDRDM
HWCAP_ATOMICS
HWCAP_CPUID
HWCAP_CRC32
HWCAP_DCPOP
HWCAP_DIT
HWCAP_EVTSTRM
HWCAP_FCMA
HWCAP_FLAGM
HWCAP_FP
HWCAP_FPHP
HWCAP_ILRCPC
HWCAP_JSCVT
HWCAP_LRCPC
HWCAP_PACA
HWCAP_PACG
HWCAP_PMULL
HWCAP_SB
HWCAP_SHA1
HWCAP_SHA2
HWCAP_SHA3
HWCAP_SHA512
HWCAP_SM3
HWCAP_SM4
HWCAP_SSBS
HWCAP_SVE
HWCAP_USCAT
KEYCTL_CAPABILITIES
KEYCTL_CAPS0_BIG_KEY
KEYCTL_CAPS0_CAPABILITIES
Expand Down
34 changes: 34 additions & 0 deletions src/unix/linux_like/linux/musl/b64/aarch64/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,40 @@ pub const ENOTRECOVERABLE: ::c_int = 131;
pub const ERFKILL: ::c_int = 132;
pub const EHWPOISON: ::c_int = 133;

// bits/hwcap.h
pub const HWCAP_FP: ::c_ulong = 1 << 0;
pub const HWCAP_ASIMD: ::c_ulong = 1 << 1;
pub const HWCAP_EVTSTRM: ::c_ulong = 1 << 2;
pub const HWCAP_AES: ::c_ulong = 1 << 3;
pub const HWCAP_PMULL: ::c_ulong = 1 << 4;
pub const HWCAP_SHA1: ::c_ulong = 1 << 5;
pub const HWCAP_SHA2: ::c_ulong = 1 << 6;
pub const HWCAP_CRC32: ::c_ulong = 1 << 7;
pub const HWCAP_ATOMICS: ::c_ulong = 1 << 8;
pub const HWCAP_FPHP: ::c_ulong = 1 << 9;
pub const HWCAP_ASIMDHP: ::c_ulong = 1 << 10;
pub const HWCAP_CPUID: ::c_ulong = 1 << 11;
pub const HWCAP_ASIMDRDM: ::c_ulong = 1 << 12;
pub const HWCAP_JSCVT: ::c_ulong = 1 << 13;
pub const HWCAP_FCMA: ::c_ulong = 1 << 14;
pub const HWCAP_LRCPC: ::c_ulong = 1 << 15;
pub const HWCAP_DCPOP: ::c_ulong = 1 << 16;
pub const HWCAP_SHA3: ::c_ulong = 1 << 17;
pub const HWCAP_SM3: ::c_ulong = 1 << 18;
pub const HWCAP_SM4: ::c_ulong = 1 << 19;
pub const HWCAP_ASIMDDP: ::c_ulong = 1 << 20;
pub const HWCAP_SHA512: ::c_ulong = 1 << 21;
pub const HWCAP_SVE: ::c_ulong = 1 << 22;
pub const HWCAP_ASIMDFHM: ::c_ulong = 1 << 23;
pub const HWCAP_DIT: ::c_ulong = 1 << 24;
pub const HWCAP_USCAT: ::c_ulong = 1 << 25;
pub const HWCAP_ILRCPC: ::c_ulong = 1 << 26;
pub const HWCAP_FLAGM: ::c_ulong = 1 << 27;
pub const HWCAP_SSBS: ::c_ulong = 1 << 28;
pub const HWCAP_SB: ::c_ulong = 1 << 29;
pub const HWCAP_PACA: ::c_ulong = 1 << 30;
pub const HWCAP_PACG: ::c_ulong = 1 << 31;

pub const MAP_ANON: ::c_int = 0x0020;
pub const MAP_GROWSDOWN: ::c_int = 0x0100;
pub const MAP_DENYWRITE: ::c_int = 0x0800;
Expand Down

0 comments on commit 393a80d

Please sign in to comment.