Skip to content

Commit f9aa12d

Browse files
authored
Merge pull request #3850 from tgross35/backport-android-constants
[0.2] Backport android constants
2 parents c809c58 + 6be814d commit f9aa12d

File tree

13 files changed

+181
-26
lines changed

13 files changed

+181
-26
lines changed

libc-test/semver/android-aarch64.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
AT_SYSINFO_EHDR
2+
AT_VECTOR_SIZE_ARCH
13
HWCAP2_DCPODP
24
HWCAP2_FLAGM2
35
HWCAP2_FRINT

libc-test/semver/android-arm.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
AT_SYSINFO_EHDR
12
NGREG
23
PTRACE_GETFPREGS
34
PTRACE_GETREGS

libc-test/semver/android-i686.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
AT_SYSINFO
2+
AT_SYSINFO_EHDR
3+
AT_VECTOR_SIZE_ARCH
4+
SYS_memfd_secret
15
__c_anonymous_uc_sigmask
26
__c_anonymous_uc_sigmask_with_padding
37
time64_t

libc-test/semver/android-riscv64.txt

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
AT_SYSINFO_EHDR
2+
AT_VECTOR_SIZE_ARCH
3+
HWCAP2_AFP
4+
HWCAP2_BF16
5+
HWCAP2_BTI
6+
HWCAP2_DCPODP
7+
HWCAP2_DGH
8+
HWCAP2_EBF16
9+
HWCAP2_ECV
10+
HWCAP2_FLAGM2
11+
HWCAP2_FRINT
12+
HWCAP2_I8MM
13+
HWCAP2_MTE
14+
HWCAP2_MTE3
15+
HWCAP2_RNG
16+
HWCAP2_RPRES
17+
HWCAP2_SME
18+
HWCAP2_SME_B16F32
19+
HWCAP2_SME_F16F32
20+
HWCAP2_SME_F32F32
21+
HWCAP2_SME_F64F64
22+
HWCAP2_SME_FA64
23+
HWCAP2_SME_I16I64
24+
HWCAP2_SME_I8I32
25+
HWCAP2_SVE2
26+
HWCAP2_SVEAES
27+
HWCAP2_SVEBF16
28+
HWCAP2_SVEBITPERM
29+
HWCAP2_SVEF32MM
30+
HWCAP2_SVEF64MM
31+
HWCAP2_SVEI8MM
32+
HWCAP2_SVEPMULL
33+
HWCAP2_SVESHA3
34+
HWCAP2_SVESM4
35+
HWCAP2_SVE_EBF16
36+
HWCAP2_WFXT
37+
HWCAP_AES
38+
HWCAP_ASIMD
39+
HWCAP_ASIMDDP
40+
HWCAP_ASIMDFHM
41+
HWCAP_ASIMDHP
42+
HWCAP_ASIMDRDM
43+
HWCAP_ATOMICS
44+
HWCAP_CPUID
45+
HWCAP_CRC32
46+
HWCAP_DCPOP
47+
HWCAP_DIT
48+
HWCAP_EVTSTRM
49+
HWCAP_FCMA
50+
HWCAP_FLAGM
51+
HWCAP_FP
52+
HWCAP_FPHP
53+
HWCAP_ILRCPC
54+
HWCAP_JSCVT
55+
HWCAP_LRCPC
56+
HWCAP_PACA
57+
HWCAP_PACG
58+
HWCAP_PMULL
59+
HWCAP_SB
60+
HWCAP_SHA1
61+
HWCAP_SHA2
62+
HWCAP_SHA3
63+
HWCAP_SHA512
64+
HWCAP_SM3
65+
HWCAP_SM4
66+
HWCAP_SSBS
67+
HWCAP_SVE
68+
HWCAP_USCAT
69+
PROT_BTI
70+
PROT_MTE
71+
SYS_accept
72+
SYS_arch_specific_syscall
73+
SYS_fcntl
74+
SYS_getrlimit
75+
SYS_memfd_secret
76+
SYS_migrate_pages
77+
SYS_msgctl
78+
SYS_msgget
79+
SYS_msgrcv
80+
SYS_msgsnd
81+
SYS_semctl
82+
SYS_semget
83+
SYS_semop
84+
SYS_semtimedop
85+
SYS_shmat
86+
SYS_shmctl
87+
SYS_shmdt
88+
SYS_shmget
89+
SYS_sync_file_range
90+
SYS_syscalls

libc-test/semver/android-x86_64.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
AT_SYSINFO_EHDR
2+
AT_VECTOR_SIZE_ARCH
13
EFLAGS
24
FS_BASE
35
GS_BASE

libc-test/semver/android.txt

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,13 +136,39 @@ ATF_NETMASK
136136
ATF_PERM
137137
ATF_PUBL
138138
ATF_USETRAILERS
139+
AT_BASE
140+
AT_BASE_PLATFORM
141+
AT_CLKTCK
142+
AT_EGID
139143
AT_EMPTY_PATH
144+
AT_ENTRY
145+
AT_EUID
146+
AT_EXECFD
147+
AT_EXECFN
140148
AT_FDCWD
149+
AT_FLAGS
150+
AT_GID
151+
AT_HWCAP
152+
AT_HWCAP2
153+
AT_IGNORE
154+
AT_MINSIGSTKSZ
155+
AT_NOTELF
141156
AT_NO_AUTOMOUNT
157+
AT_NULL
158+
AT_PAGESZ
159+
AT_PHDR
160+
AT_PHENT
161+
AT_PHNUM
162+
AT_PLATFORM
163+
AT_RANDOM
142164
AT_RECURSIVE
143165
AT_REMOVEDIR
166+
AT_RSEQ_ALIGN
167+
AT_RSEQ_FEATURE_SIZE
168+
AT_SECURE
144169
AT_SYMLINK_FOLLOW
145170
AT_SYMLINK_NOFOLLOW
171+
AT_UID
146172
B0
147173
B1000000
148174
B110

src/unix/linux_like/android/b32/arm.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -533,6 +533,9 @@ pub const REG_R15: ::c_int = 15;
533533

534534
pub const NGREG: ::c_int = 18;
535535

536+
// From NDK's asm/auxvec.h
537+
pub const AT_SYSINFO_EHDR: ::c_ulong = 33;
538+
536539
f! {
537540
// Sadly, Android before 5.0 (API level 21), the accept4 syscall is not
538541
// exposed by the libc. As work-around, we implement it through `syscall`

src/unix/linux_like/android/b32/x86/mod.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -585,6 +585,11 @@ pub const REG_EFL: ::c_int = 16;
585585
pub const REG_UESP: ::c_int = 17;
586586
pub const REG_SS: ::c_int = 18;
587587

588+
// From NDK's asm/auxvec.h
589+
pub const AT_SYSINFO: ::c_ulong = 32;
590+
pub const AT_SYSINFO_EHDR: ::c_ulong = 33;
591+
pub const AT_VECTOR_SIZE_ARCH: ::c_ulong = 3;
592+
588593
// socketcall values from linux/net.h (only the needed ones, and not public)
589594
const SYS_ACCEPT4: ::c_int = 18;
590595

src/unix/linux_like/android/b64/aarch64/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,10 @@ pub const SYS_syscalls: ::c_long = 436;
417417
pub const PROT_BTI: ::c_int = 0x10;
418418
pub const PROT_MTE: ::c_int = 0x20;
419419

420+
// From NDK's asm/auxvec.h
421+
pub const AT_SYSINFO_EHDR: ::c_ulong = 33;
422+
pub const AT_VECTOR_SIZE_ARCH: ::c_ulong = 2;
423+
420424
cfg_if! {
421425
if #[cfg(libc_align)] {
422426
mod align;

src/unix/linux_like/android/b64/mod.rs

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -264,32 +264,6 @@ pub const RTLD_GLOBAL: ::c_int = 0x00100;
264264
pub const RTLD_NOW: ::c_int = 2;
265265
pub const RTLD_DEFAULT: *mut ::c_void = 0i64 as *mut ::c_void;
266266

267-
// From NDK's linux/auxvec.h
268-
pub const AT_NULL: ::c_ulong = 0;
269-
pub const AT_IGNORE: ::c_ulong = 1;
270-
pub const AT_EXECFD: ::c_ulong = 2;
271-
pub const AT_PHDR: ::c_ulong = 3;
272-
pub const AT_PHENT: ::c_ulong = 4;
273-
pub const AT_PHNUM: ::c_ulong = 5;
274-
pub const AT_PAGESZ: ::c_ulong = 6;
275-
pub const AT_BASE: ::c_ulong = 7;
276-
pub const AT_FLAGS: ::c_ulong = 8;
277-
pub const AT_ENTRY: ::c_ulong = 9;
278-
pub const AT_NOTELF: ::c_ulong = 10;
279-
pub const AT_UID: ::c_ulong = 11;
280-
pub const AT_EUID: ::c_ulong = 12;
281-
pub const AT_GID: ::c_ulong = 13;
282-
pub const AT_EGID: ::c_ulong = 14;
283-
pub const AT_PLATFORM: ::c_ulong = 15;
284-
pub const AT_HWCAP: ::c_ulong = 16;
285-
pub const AT_CLKTCK: ::c_ulong = 17;
286-
pub const AT_SECURE: ::c_ulong = 23;
287-
pub const AT_BASE_PLATFORM: ::c_ulong = 24;
288-
pub const AT_RANDOM: ::c_ulong = 25;
289-
pub const AT_HWCAP2: ::c_ulong = 26;
290-
pub const AT_EXECFN: ::c_ulong = 31;
291-
pub const AT_MINSIGSTKSZ: ::c_ulong = 51;
292-
293267
pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t {
294268
value: 0,
295269
__reserved: [0; 36],

src/unix/linux_like/android/b64/riscv64/mod.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,18 @@ pub const SYS_fsmount: ::c_long = 432;
345345
pub const SYS_fspick: ::c_long = 433;
346346
pub const SYS_syscalls: ::c_long = 436;
347347

348+
// From NDK's asm/auxvec.h
349+
pub const AT_SYSINFO_EHDR: ::c_ulong = 33;
350+
pub const AT_L1I_CACHESIZE: ::c_ulong = 40;
351+
pub const AT_L1I_CACHEGEOMETRY: ::c_ulong = 41;
352+
pub const AT_L1D_CACHESIZE: ::c_ulong = 42;
353+
pub const AT_L1D_CACHEGEOMETRY: ::c_ulong = 43;
354+
pub const AT_L2_CACHESIZE: ::c_ulong = 44;
355+
pub const AT_L2_CACHEGEOMETRY: ::c_ulong = 45;
356+
pub const AT_L3_CACHESIZE: ::c_ulong = 46;
357+
pub const AT_L3_CACHEGEOMETRY: ::c_ulong = 47;
358+
pub const AT_VECTOR_SIZE_ARCH: ::c_ulong = 9;
359+
348360
cfg_if! {
349361
if #[cfg(libc_align)] {
350362
mod align;

src/unix/linux_like/android/b64/x86_64/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -794,6 +794,10 @@ pub const REG_TRAPNO: ::c_int = 20;
794794
pub const REG_OLDMASK: ::c_int = 21;
795795
pub const REG_CR2: ::c_int = 22;
796796

797+
// From NDK's asm/auxvec.h
798+
pub const AT_SYSINFO_EHDR: ::c_ulong = 33;
799+
pub const AT_VECTOR_SIZE_ARCH: ::c_ulong = 3;
800+
797801
cfg_if! {
798802
if #[cfg(libc_align)] {
799803
mod align;

src/unix/linux_like/android/mod.rs

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3535,6 +3535,34 @@ pub const KLOG_CONSOLE_LEVEL: ::c_int = 8;
35353535
pub const KLOG_SIZE_UNREAD: ::c_int = 9;
35363536
pub const KLOG_SIZE_BUFFER: ::c_int = 10;
35373537

3538+
// From NDK's linux/auxvec.h
3539+
pub const AT_NULL: ::c_ulong = 0;
3540+
pub const AT_IGNORE: ::c_ulong = 1;
3541+
pub const AT_EXECFD: ::c_ulong = 2;
3542+
pub const AT_PHDR: ::c_ulong = 3;
3543+
pub const AT_PHENT: ::c_ulong = 4;
3544+
pub const AT_PHNUM: ::c_ulong = 5;
3545+
pub const AT_PAGESZ: ::c_ulong = 6;
3546+
pub const AT_BASE: ::c_ulong = 7;
3547+
pub const AT_FLAGS: ::c_ulong = 8;
3548+
pub const AT_ENTRY: ::c_ulong = 9;
3549+
pub const AT_NOTELF: ::c_ulong = 10;
3550+
pub const AT_UID: ::c_ulong = 11;
3551+
pub const AT_EUID: ::c_ulong = 12;
3552+
pub const AT_GID: ::c_ulong = 13;
3553+
pub const AT_EGID: ::c_ulong = 14;
3554+
pub const AT_PLATFORM: ::c_ulong = 15;
3555+
pub const AT_HWCAP: ::c_ulong = 16;
3556+
pub const AT_CLKTCK: ::c_ulong = 17;
3557+
pub const AT_SECURE: ::c_ulong = 23;
3558+
pub const AT_BASE_PLATFORM: ::c_ulong = 24;
3559+
pub const AT_RANDOM: ::c_ulong = 25;
3560+
pub const AT_HWCAP2: ::c_ulong = 26;
3561+
pub const AT_RSEQ_FEATURE_SIZE: ::c_ulong = 27;
3562+
pub const AT_RSEQ_ALIGN: ::c_ulong = 28;
3563+
pub const AT_EXECFN: ::c_ulong = 31;
3564+
pub const AT_MINSIGSTKSZ: ::c_ulong = 51;
3565+
35383566
// Most `*_SUPER_MAGIC` constants are defined at the `linux_like` level; the
35393567
// following are only available on newer Linux versions than the versions
35403568
// currently used in CI in some configurations, so we define them here.

0 commit comments

Comments
 (0)