Skip to content

Commit d39aa2f

Browse files
committed
Fix libc-tests for loongarch64 hwcaps
1 parent 56fdd6c commit d39aa2f

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
@@ -3316,6 +3316,7 @@ fn test_linux(target: &str) {
33163316
let gnueabihf = target.contains("gnueabihf");
33173317
let x86_64_gnux32 = target.contains("gnux32") && x86_64;
33183318
let riscv64 = target.contains("riscv64");
3319+
let loongarch64 = target.contains("loongarch64");
33193320
let uclibc = target.contains("uclibc");
33203321

33213322
let mut cfg = ctest_cfg();
@@ -3437,6 +3438,7 @@ fn test_linux(target: &str) {
34373438
// Include linux headers at the end:
34383439
headers! {
34393440
cfg:
3441+
[loongarch64]: "asm/hwcap.h",
34403442
"asm/mman.h",
34413443
[gnu]: "linux/aio_abi.h",
34423444
"linux/can.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
@@ -256,20 +256,20 @@ pub const PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP: ::pthread_mutex_t = pthread_mut
256256
],
257257
};
258258

259-
pub const HWCAP_CPUCFG: ::c_ulong = 1 << 0;
260-
pub const HWCAP_LAM: ::c_ulong = 1 << 1;
261-
pub const HWCAP_UAL: ::c_ulong = 1 << 2;
262-
pub const HWCAP_FPU: ::c_ulong = 1 << 3;
263-
pub const HWCAP_LSX: ::c_ulong = 1 << 4;
264-
pub const HWCAP_LASX: ::c_ulong = 1 << 5;
265-
pub const HWCAP_CRC32: ::c_ulong = 1 << 6;
266-
pub const HWCAP_COMPLEX: ::c_ulong = 1 << 7;
267-
pub const HWCAP_CRYPTO: ::c_ulong = 1 << 8;
268-
pub const HWCAP_LVZ: ::c_ulong = 1 << 9;
269-
pub const HWCAP_LBT_X86: ::c_ulong = 1 << 10;
270-
pub const HWCAP_LBT_ARM: ::c_ulong = 1 << 11;
271-
pub const HWCAP_LBT_MIPS: ::c_ulong = 1 << 12;
272-
pub const HWCAP_PTW: ::c_ulong = 1 << 13;
259+
pub const HWCAP_LOONGARCH_CPUCFG: ::c_ulong = 1 << 0;
260+
pub const HWCAP_LOONGARCH_LAM: ::c_ulong = 1 << 1;
261+
pub const HWCAP_LOONGARCH_UAL: ::c_ulong = 1 << 2;
262+
pub const HWCAP_LOONGARCH_FPU: ::c_ulong = 1 << 3;
263+
pub const HWCAP_LOONGARCH_LSX: ::c_ulong = 1 << 4;
264+
pub const HWCAP_LOONGARCH_LASX: ::c_ulong = 1 << 5;
265+
pub const HWCAP_LOONGARCH_CRC32: ::c_ulong = 1 << 6;
266+
pub const HWCAP_LOONGARCH_COMPLEX: ::c_ulong = 1 << 7;
267+
pub const HWCAP_LOONGARCH_CRYPTO: ::c_ulong = 1 << 8;
268+
pub const HWCAP_LOONGARCH_LVZ: ::c_ulong = 1 << 9;
269+
pub const HWCAP_LOONGARCH_LBT_X86: ::c_ulong = 1 << 10;
270+
pub const HWCAP_LOONGARCH_LBT_ARM: ::c_ulong = 1 << 11;
271+
pub const HWCAP_LOONGARCH_LBT_MIPS: ::c_ulong = 1 << 12;
272+
pub const HWCAP_LOONGARCH_PTW: ::c_ulong = 1 << 13;
273273

274274
pub const SYS_io_setup: ::c_long = 0;
275275
pub const SYS_io_destroy: ::c_long = 1;

0 commit comments

Comments
 (0)