Skip to content

Commit

Permalink
Merge pull request #3580 from Xeonacid/riscv64-hwcap
Browse files Browse the repository at this point in the history
Add Linux riscv64 HWCAP defines (libc-0.2)
  • Loading branch information
JohnTitor authored Feb 18, 2024
2 parents 3171906 + 614cfe1 commit 16827f2
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions libc-test/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3448,6 +3448,7 @@ fn test_linux(target: &str) {
// Include linux headers at the end:
headers! {
cfg:
[riscv64]: "asm/hwcap.h",
"asm/mman.h",
[gnu]: "linux/aio_abi.h",
"linux/can.h",
Expand Down
7 changes: 7 additions & 0 deletions libc-test/semver/linux-riscv64gc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,10 @@ TIOCSRS485
flock64
fsblkcnt64_t
fsfilcnt64_t
COMPAT_HWCAP_ISA_I
COMPAT_HWCAP_ISA_M
COMPAT_HWCAP_ISA_A
COMPAT_HWCAP_ISA_F
COMPAT_HWCAP_ISA_D
COMPAT_HWCAP_ISA_C
COMPAT_HWCAP_ISA_V
8 changes: 8 additions & 0 deletions src/unix/linux_like/linux/gnu/b64/riscv64/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,14 @@ pub const REG_A0: usize = 10;
pub const REG_S2: usize = 18;
pub const REG_NARGS: usize = 8;

pub const COMPAT_HWCAP_ISA_I: ::c_ulong = 1 << (b'I' - b'A');
pub const COMPAT_HWCAP_ISA_M: ::c_ulong = 1 << (b'M' - b'A');
pub const COMPAT_HWCAP_ISA_A: ::c_ulong = 1 << (b'A' - b'A');
pub const COMPAT_HWCAP_ISA_F: ::c_ulong = 1 << (b'F' - b'A');
pub const COMPAT_HWCAP_ISA_D: ::c_ulong = 1 << (b'D' - b'A');
pub const COMPAT_HWCAP_ISA_C: ::c_ulong = 1 << (b'C' - b'A');
pub const COMPAT_HWCAP_ISA_V: ::c_ulong = 1 << (b'V' - b'A');

pub const SYS_read: ::c_long = 63;
pub const SYS_write: ::c_long = 64;
pub const SYS_close: ::c_long = 57;
Expand Down

0 comments on commit 16827f2

Please sign in to comment.