Skip to content

Add Linux riscv64 HWCAP defines #3590

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion libc-test/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3407,7 +3407,7 @@ fn test_linux(target: &str) {
// Include linux headers at the end:
headers! {
cfg:
[loongarch64]: "asm/hwcap.h",
[loongarch64 || 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 @@ -71,3 +71,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