From c7c77516828e9a116fd7c2f72bb781cfaf72919f Mon Sep 17 00:00:00 2001 From: michael-roe <2479665+michael-roe@users.noreply.github.com> Date: Thu, 21 Jul 2022 20:58:04 +0100 Subject: Add macros for RISCV hwcaps (#246) Co-authored-by: Michael Roe --- include/internal/hwcaps.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/include/internal/hwcaps.h b/include/internal/hwcaps.h index 3f45aed..f916b81 100644 --- a/include/internal/hwcaps.h +++ b/include/internal/hwcaps.h @@ -176,6 +176,17 @@ CPU_FEATURES_START_CPP_NAMESPACE #define PPC_FEATURE2_HTM_NO_SUSPEND 0x00080000 #endif +// https://elixir.bootlin.com/linux/latest/source/arch/riscv/include/uapi/asm/hwcap.h +#define RISCV_HWCAP_A (1UL << ('A' - 'A')) +#define RISCV_HWCAP_C (1UL << ('C' - 'A')) +#define RISCV_HWCAP_D (1UL << ('D' - 'A')) +#define RISCV_HWCAP_E (1UL << ('E' - 'A')) +#define RISCV_HWCAP_F (1UL << ('F' - 'A')) +#define RISCV_HWCAP_I (1UL << ('I' - 'A')) +#define RISCV_HWCAP_M (1UL << ('M' - 'A')) +#define RISCV_HWCAP_V (1UL << ('V' - 'A')) +#define RISCV_HWCAP_Q (1UL << ('Q' - 'A')) + typedef struct { unsigned long hwcaps; unsigned long hwcaps2; -- cgit v1.2.3