Skip to content

Commit f94afd8

Browse files
committed
Fix libc-tests for loongarch64 hwcaps
1 parent 947a185 commit f94afd8

File tree

2 files changed

+16
-14
lines changed

2 files changed

+16
-14
lines changed

libc-test/build.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3344,6 +3344,7 @@ fn test_linux(target: &str) {
33443344
let gnueabihf = target.contains("gnueabihf");
33453345
let x86_64_gnux32 = target.contains("gnux32") && x86_64;
33463346
let riscv64 = target.contains("riscv64");
3347+
let loongarch64 = target.contains("loongarch64");
33473348
let uclibc = target.contains("uclibc");
33483349

33493350
let mut cfg = ctest_cfg();
@@ -3466,6 +3467,7 @@ fn test_linux(target: &str) {
34663467
// Include linux headers at the end:
34673468
headers! {
34683469
cfg:
3470+
[loongarch64]: "asm/hwcap.h",
34693471
[riscv64]: "asm/hwcap.h",
34703472
"asm/mman.h",
34713473
[gnu]: "linux/aio_abi.h",

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

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -264,20 +264,20 @@ align_const! {
264264
};
265265
}
266266

267-
pub const HWCAP_CPUCFG: ::c_ulong = 1 << 0;
268-
pub const HWCAP_LAM: ::c_ulong = 1 << 1;
269-
pub const HWCAP_UAL: ::c_ulong = 1 << 2;
270-
pub const HWCAP_FPU: ::c_ulong = 1 << 3;
271-
pub const HWCAP_LSX: ::c_ulong = 1 << 4;
272-
pub const HWCAP_LASX: ::c_ulong = 1 << 5;
273-
pub const HWCAP_CRC32: ::c_ulong = 1 << 6;
274-
pub const HWCAP_COMPLEX: ::c_ulong = 1 << 7;
275-
pub const HWCAP_CRYPTO: ::c_ulong = 1 << 8;
276-
pub const HWCAP_LVZ: ::c_ulong = 1 << 9;
277-
pub const HWCAP_LBT_X86: ::c_ulong = 1 << 10;
278-
pub const HWCAP_LBT_ARM: ::c_ulong = 1 << 11;
279-
pub const HWCAP_LBT_MIPS: ::c_ulong = 1 << 12;
280-
pub const HWCAP_PTW: ::c_ulong = 1 << 13;
267+
pub const HWCAP_LOONGARCH_CPUCFG: ::c_ulong = 1 << 0;
268+
pub const HWCAP_LOONGARCH_LAM: ::c_ulong = 1 << 1;
269+
pub const HWCAP_LOONGARCH_UAL: ::c_ulong = 1 << 2;
270+
pub const HWCAP_LOONGARCH_FPU: ::c_ulong = 1 << 3;
271+
pub const HWCAP_LOONGARCH_LSX: ::c_ulong = 1 << 4;
272+
pub const HWCAP_LOONGARCH_LASX: ::c_ulong = 1 << 5;
273+
pub const HWCAP_LOONGARCH_CRC32: ::c_ulong = 1 << 6;
274+
pub const HWCAP_LOONGARCH_COMPLEX: ::c_ulong = 1 << 7;
275+
pub const HWCAP_LOONGARCH_CRYPTO: ::c_ulong = 1 << 8;
276+
pub const HWCAP_LOONGARCH_LVZ: ::c_ulong = 1 << 9;
277+
pub const HWCAP_LOONGARCH_LBT_X86: ::c_ulong = 1 << 10;
278+
pub const HWCAP_LOONGARCH_LBT_ARM: ::c_ulong = 1 << 11;
279+
pub const HWCAP_LOONGARCH_LBT_MIPS: ::c_ulong = 1 << 12;
280+
pub const HWCAP_LOONGARCH_PTW: ::c_ulong = 1 << 13;
281281

282282
pub const SYS_io_setup: ::c_long = 0;
283283
pub const SYS_io_destroy: ::c_long = 1;

0 commit comments

Comments
 (0)