From 21db322aeff7d6a34a6ff20d1169c30485be50dd Mon Sep 17 00:00:00 2001 From: Yangyu Chen Date: Wed, 4 Sep 2024 23:53:35 +0800 Subject: [PATCH] Add fields definition of mcounteren and mcountinhibit --- encoding.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/encoding.h b/encoding.h index 63d59013..955459b5 100644 --- a/encoding.h +++ b/encoding.h @@ -214,6 +214,17 @@ #define MHPMEVENTH_MINH 0x40000000 #define MHPMEVENTH_OF 0x80000000 +#define MCOUNTEREN_CY_SHIFT 0 +#define MCOUNTEREN_TIME_SHIFT 1 +#define MCOUNTEREN_IR_SHIFT 2 + +#define MCOUNTEREN_CY (1U << MCOUNTEREN_CY_SHIFT) +#define MCOUNTEREN_TIME (1U << MCOUNTEREN_TIME_SHIFT) +#define MCOUNTEREN_IR (1U << MCOUNTEREN_IR_SHIFT) + +#define MCOUNTINHIBIT_CY MCOUNTEREN_CY +#define MCOUNTINHIBIT_IR MCOUNTEREN_IR + #define HENVCFG_FIOM 0x00000001 #define HENVCFG_LPE 0x00000004 #define HENVCFG_SSE 0x00000008