Skip to content

Commit 16827f2

Browse files
authored
Merge pull request #3580 from Xeonacid/riscv64-hwcap
Add Linux riscv64 HWCAP defines (libc-0.2)
2 parents 3171906 + 614cfe1 commit 16827f2

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

libc-test/build.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3448,6 +3448,7 @@ fn test_linux(target: &str) {
34483448
// Include linux headers at the end:
34493449
headers! {
34503450
cfg:
3451+
[riscv64]: "asm/hwcap.h",
34513452
"asm/mman.h",
34523453
[gnu]: "linux/aio_abi.h",
34533454
"linux/can.h",

libc-test/semver/linux-riscv64gc.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,3 +69,10 @@ TIOCSRS485
6969
flock64
7070
fsblkcnt64_t
7171
fsfilcnt64_t
72+
COMPAT_HWCAP_ISA_I
73+
COMPAT_HWCAP_ISA_M
74+
COMPAT_HWCAP_ISA_A
75+
COMPAT_HWCAP_ISA_F
76+
COMPAT_HWCAP_ISA_D
77+
COMPAT_HWCAP_ISA_C
78+
COMPAT_HWCAP_ISA_V

src/unix/linux_like/linux/gnu/b64/riscv64/mod.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -540,6 +540,14 @@ pub const REG_A0: usize = 10;
540540
pub const REG_S2: usize = 18;
541541
pub const REG_NARGS: usize = 8;
542542

543+
pub const COMPAT_HWCAP_ISA_I: ::c_ulong = 1 << (b'I' - b'A');
544+
pub const COMPAT_HWCAP_ISA_M: ::c_ulong = 1 << (b'M' - b'A');
545+
pub const COMPAT_HWCAP_ISA_A: ::c_ulong = 1 << (b'A' - b'A');
546+
pub const COMPAT_HWCAP_ISA_F: ::c_ulong = 1 << (b'F' - b'A');
547+
pub const COMPAT_HWCAP_ISA_D: ::c_ulong = 1 << (b'D' - b'A');
548+
pub const COMPAT_HWCAP_ISA_C: ::c_ulong = 1 << (b'C' - b'A');
549+
pub const COMPAT_HWCAP_ISA_V: ::c_ulong = 1 << (b'V' - b'A');
550+
543551
pub const SYS_read: ::c_long = 63;
544552
pub const SYS_write: ::c_long = 64;
545553
pub const SYS_close: ::c_long = 57;

0 commit comments

Comments
 (0)