Skip to content

Commit ae698a1

Browse files
committed
Auto merge of #2172 - tarcieri:musl-hwcaps, r=joshtriplett
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)?
2 parents d02ce7f + 20b2b2c commit ae698a1

File tree

2 files changed

+34
-32
lines changed

2 files changed

+34
-32
lines changed

libc-test/semver/TODO-linux.txt

-32
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,6 @@
11
# The following symbols are not not available in some combinations of
22
# musl/gnu/android and/or architecture.
33
BOTHER
4-
HWCAP_AES
5-
HWCAP_ASIMD
6-
HWCAP_ASIMDDP
7-
HWCAP_ASIMDFHM
8-
HWCAP_ASIMDHP
9-
HWCAP_ASIMDRDM
10-
HWCAP_ATOMICS
11-
HWCAP_CPUID
12-
HWCAP_CRC32
13-
HWCAP_DCPOP
14-
HWCAP_DIT
15-
HWCAP_EVTSTRM
16-
HWCAP_FCMA
17-
HWCAP_FLAGM
18-
HWCAP_FP
19-
HWCAP_FPHP
20-
HWCAP_ILRCPC
21-
HWCAP_JSCVT
22-
HWCAP_LRCPC
23-
HWCAP_PACA
24-
HWCAP_PACG
25-
HWCAP_PMULL
26-
HWCAP_SB
27-
HWCAP_SHA1
28-
HWCAP_SHA2
29-
HWCAP_SHA3
30-
HWCAP_SHA512
31-
HWCAP_SM3
32-
HWCAP_SM4
33-
HWCAP_SSBS
34-
HWCAP_SVE
35-
HWCAP_USCAT
364
KEYCTL_CAPABILITIES
375
KEYCTL_CAPS0_BIG_KEY
386
KEYCTL_CAPS0_CAPABILITIES

src/unix/linux_like/linux/musl/b64/aarch64/mod.rs

+34
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,40 @@ pub const ENOTRECOVERABLE: ::c_int = 131;
160160
pub const ERFKILL: ::c_int = 132;
161161
pub const EHWPOISON: ::c_int = 133;
162162

163+
// bits/hwcap.h
164+
pub const HWCAP_FP: ::c_ulong = 1 << 0;
165+
pub const HWCAP_ASIMD: ::c_ulong = 1 << 1;
166+
pub const HWCAP_EVTSTRM: ::c_ulong = 1 << 2;
167+
pub const HWCAP_AES: ::c_ulong = 1 << 3;
168+
pub const HWCAP_PMULL: ::c_ulong = 1 << 4;
169+
pub const HWCAP_SHA1: ::c_ulong = 1 << 5;
170+
pub const HWCAP_SHA2: ::c_ulong = 1 << 6;
171+
pub const HWCAP_CRC32: ::c_ulong = 1 << 7;
172+
pub const HWCAP_ATOMICS: ::c_ulong = 1 << 8;
173+
pub const HWCAP_FPHP: ::c_ulong = 1 << 9;
174+
pub const HWCAP_ASIMDHP: ::c_ulong = 1 << 10;
175+
pub const HWCAP_CPUID: ::c_ulong = 1 << 11;
176+
pub const HWCAP_ASIMDRDM: ::c_ulong = 1 << 12;
177+
pub const HWCAP_JSCVT: ::c_ulong = 1 << 13;
178+
pub const HWCAP_FCMA: ::c_ulong = 1 << 14;
179+
pub const HWCAP_LRCPC: ::c_ulong = 1 << 15;
180+
pub const HWCAP_DCPOP: ::c_ulong = 1 << 16;
181+
pub const HWCAP_SHA3: ::c_ulong = 1 << 17;
182+
pub const HWCAP_SM3: ::c_ulong = 1 << 18;
183+
pub const HWCAP_SM4: ::c_ulong = 1 << 19;
184+
pub const HWCAP_ASIMDDP: ::c_ulong = 1 << 20;
185+
pub const HWCAP_SHA512: ::c_ulong = 1 << 21;
186+
pub const HWCAP_SVE: ::c_ulong = 1 << 22;
187+
pub const HWCAP_ASIMDFHM: ::c_ulong = 1 << 23;
188+
pub const HWCAP_DIT: ::c_ulong = 1 << 24;
189+
pub const HWCAP_USCAT: ::c_ulong = 1 << 25;
190+
pub const HWCAP_ILRCPC: ::c_ulong = 1 << 26;
191+
pub const HWCAP_FLAGM: ::c_ulong = 1 << 27;
192+
pub const HWCAP_SSBS: ::c_ulong = 1 << 28;
193+
pub const HWCAP_SB: ::c_ulong = 1 << 29;
194+
pub const HWCAP_PACA: ::c_ulong = 1 << 30;
195+
pub const HWCAP_PACG: ::c_ulong = 1 << 31;
196+
163197
pub const MAP_ANON: ::c_int = 0x0020;
164198
pub const MAP_GROWSDOWN: ::c_int = 0x0100;
165199
pub const MAP_DENYWRITE: ::c_int = 0x0800;

0 commit comments

Comments
 (0)