[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 28/37] bsd-user/arm/target_arch_elf.h: arm get_hwcap2 impl
From: |
Warner Losh |
Subject: |
[PULL 28/37] bsd-user/arm/target_arch_elf.h: arm get_hwcap2 impl |
Date: |
Sat, 8 Jan 2022 00:37:28 -0700 |
Implement the extended HW capabilities for HWCAP2.
Signed-off-by: Kyle Evans <kevans@FreeBSD.org>
Signed-off-by: Warner Losh <imp@bsdimp.com>
Reviewed-by: Kyle Evans <kevans@FreeBSD.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
---
bsd-user/arm/target_arch_elf.h | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/bsd-user/arm/target_arch_elf.h b/bsd-user/arm/target_arch_elf.h
index 02d25b89264..4a0215d02ed 100644
--- a/bsd-user/arm/target_arch_elf.h
+++ b/bsd-user/arm/target_arch_elf.h
@@ -32,6 +32,7 @@
#define ELF_EXEC_PAGESIZE 4096
#define ELF_HWCAP get_elf_hwcap()
+#define ELF_HWCAP2 get_elf_hwcap2()
#define GET_FEATURE(feat, hwcap) \
do { if (arm_feature(&cpu->env, feat)) { hwcaps |= hwcap; } } while (0)
@@ -64,6 +65,14 @@ enum {
ARM_HWCAP_ARM_EVTSTRM = 1 << 21,
};
+enum {
+ ARM_HWCAP2_ARM_AES = 1 << 0,
+ ARM_HWCAP2_ARM_PMULL = 1 << 1,
+ ARM_HWCAP2_ARM_SHA1 = 1 << 2,
+ ARM_HWCAP2_ARM_SHA2 = 1 << 3,
+ ARM_HWCAP2_ARM_CRC32 = 1 << 4,
+};
+
static uint32_t get_elf_hwcap(void)
{
ARMCPU *cpu = ARM_CPU(thread_cpu);
@@ -100,6 +109,19 @@ static uint32_t get_elf_hwcap(void)
return hwcaps;
}
+static uint32_t get_elf_hwcap2(void)
+{
+ ARMCPU *cpu = ARM_CPU(thread_cpu);
+ uint32_t hwcaps = 0;
+
+ GET_FEATURE_ID(aa32_aes, ARM_HWCAP2_ARM_AES);
+ GET_FEATURE_ID(aa32_pmull, ARM_HWCAP2_ARM_PMULL);
+ GET_FEATURE_ID(aa32_sha1, ARM_HWCAP2_ARM_SHA1);
+ GET_FEATURE_ID(aa32_sha2, ARM_HWCAP2_ARM_SHA2);
+ GET_FEATURE_ID(aa32_crc32, ARM_HWCAP2_ARM_CRC32);
+ return hwcaps;
+}
+
#undef GET_FEATURE
#undef GET_FEATURE_ID
--
2.33.1
- [PULL 16/37] bsd-user/arm/target_arch_cpu.h: CPU Loop definitions, (continued)
- [PULL 16/37] bsd-user/arm/target_arch_cpu.h: CPU Loop definitions, Warner Losh, 2022/01/08
- [PULL 15/37] bsd-user/arm/target_arch_cpu.c: Target specific TLS routines, Warner Losh, 2022/01/08
- [PULL 21/37] bsd-user/arm/target_arch_cpu.h: Implement system call dispatch, Warner Losh, 2022/01/08
- [PULL 23/37] bsd-user/arm/target_arch_vmparam.h: Parameters for arm address space, Warner Losh, 2022/01/08
- [PULL 17/37] bsd-user/arm/target_arch_cpu.h: Implement target_cpu_clone_regs, Warner Losh, 2022/01/08
- [PULL 22/37] bsd-user/arm/target_arch_reg.h: Implement core dump register copying, Warner Losh, 2022/01/08
- [PULL 10/37] bsd-user/x86_64/target_arch_signal.h: Fill in mcontext_t, Warner Losh, 2022/01/08
- [PULL 24/37] bsd-user/arm/target_arch_sigtramp.h: Signal Trampoline for arm, Warner Losh, 2022/01/08
- [PULL 31/37] bsd-user/arm/target_arch_signal.h: Define size of *context_t, Warner Losh, 2022/01/08
- [PULL 30/37] bsd-user/arm/target_arch_signal.h: arm machine context and trapframe for signals, Warner Losh, 2022/01/08
- [PULL 28/37] bsd-user/arm/target_arch_elf.h: arm get_hwcap2 impl,
Warner Losh <=
- [PULL 29/37] bsd-user/arm/target_arch_signal.h: arm specific signal registers and stack, Warner Losh, 2022/01/08
- [PULL 33/37] bsd-user/arm/signal.c: arm get_mcontext, Warner Losh, 2022/01/08
- [PULL 34/37] bsd-user/arm/signal.c: arm set_mcontext, Warner Losh, 2022/01/08
- [PULL 37/37] bsd-user: add arm target build, Warner Losh, 2022/01/08
- [PULL 32/37] bsd-user/arm/signal.c: arm set_sigtramp_args, Warner Losh, 2022/01/08
- [PULL 36/37] bsd-user/freebsd/target_os_ucontext.h: Require TARGET_*CONTEXT_SIZE, Warner Losh, 2022/01/08
- [PULL 03/37] bsd-user: create a per-arch signal.c file, Warner Losh, 2022/01/08
- Re: [PULL 00/37] Bsd user arm patches, Richard Henderson, 2022/01/08