aports/main/musl/loongarch64-add-bits-hwcap.h.patch
Jingyun Hua a231acc663 main/musl: add bits/hwcap.h for loongarch64
ref:https://www.openwall.com/lists/musl/2024/11/15/2
loongarch64 have cpu feature bits defined in linux for AT_HWCAP auxv entry.

Also fix webkit2gtk-4.1 (2.46.3) error:
error: use of undeclared identifier 'HWCAP_LOONGARCH_LSX'
error: use of undeclared identifier 'HWCAP_LOONGARCH_LASX'
2024-11-15 19:14:32 +00:00

37 lines
1.4 KiB
Diff

From c322495ffc8672b06c369a95c74c1e477a3b8304 Mon Sep 17 00:00:00 2001
From: Xing Li <lixing@loongson.cn>
Date: Fri, 15 Nov 2024 14:52:23 +0800
Subject: [PATCH] loongarch64: add bits/hwcap.h
loongarch64 have cpu feature bits defined in linux
for AT_HWCAP auxv entry.
---
arch/loongarch64/bits/hwcap.h | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
create mode 100644 arch/loongarch64/bits/hwcap.h
diff --git a/arch/loongarch64/bits/hwcap.h b/arch/loongarch64/bits/hwcap.h
new file mode 100644
index 00000000..355beda7
--- /dev/null
+++ b/arch/loongarch64/bits/hwcap.h
@@ -0,0 +1,16 @@
+/* The following must match the kernel's <asm/hwcap.h>. */
+/* HWCAP flags */
+#define HWCAP_LOONGARCH_CPUCFG (1 << 0)
+#define HWCAP_LOONGARCH_LAM (1 << 1)
+#define HWCAP_LOONGARCH_UAL (1 << 2)
+#define HWCAP_LOONGARCH_FPU (1 << 3)
+#define HWCAP_LOONGARCH_LSX (1 << 4)
+#define HWCAP_LOONGARCH_LASX (1 << 5)
+#define HWCAP_LOONGARCH_CRC32 (1 << 6)
+#define HWCAP_LOONGARCH_COMPLEX (1 << 7)
+#define HWCAP_LOONGARCH_CRYPTO (1 << 8)
+#define HWCAP_LOONGARCH_LVZ (1 << 9)
+#define HWCAP_LOONGARCH_LBT_X86 (1 << 10)
+#define HWCAP_LOONGARCH_LBT_ARM (1 << 11)
+#define HWCAP_LOONGARCH_LBT_MIPS (1 << 12)
+#define HWCAP_LOONGARCH_PTW (1 << 13)
--
2.27.0