[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 24/68] target/nios2: Use hw/registerfields.h for CR_STATUS fields
From: |
Richard Henderson |
Subject: |
[PULL 24/68] target/nios2: Use hw/registerfields.h for CR_STATUS fields |
Date: |
Tue, 26 Apr 2022 11:18:23 -0700 |
Add all fields; retain the helper macros for single bit fields.
So far there are no uses of the multi-bit status fields.
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20220421151735.31996-25-richard.henderson@linaro.org>
---
target/nios2/cpu.h | 28 +++++++++++++++++++---------
1 file changed, 19 insertions(+), 9 deletions(-)
diff --git a/target/nios2/cpu.h b/target/nios2/cpu.h
index 68ff8033b6..562dca8195 100644
--- a/target/nios2/cpu.h
+++ b/target/nios2/cpu.h
@@ -23,6 +23,7 @@
#include "exec/cpu-defs.h"
#include "hw/core/cpu.h"
+#include "hw/registerfields.h"
#include "qom/object.h"
typedef struct CPUArchState CPUNios2State;
@@ -79,15 +80,24 @@ struct Nios2CPUClass {
/* Control register aliases */
#define CR_STATUS 0
-#define CR_STATUS_PIE (1 << 0)
-#define CR_STATUS_U (1 << 1)
-#define CR_STATUS_EH (1 << 2)
-#define CR_STATUS_IH (1 << 3)
-#define CR_STATUS_IL (63 << 4)
-#define CR_STATUS_CRS (63 << 10)
-#define CR_STATUS_PRS (63 << 16)
-#define CR_STATUS_NMI (1 << 22)
-#define CR_STATUS_RSIE (1 << 23)
+
+FIELD(CR_STATUS, PIE, 0, 1)
+FIELD(CR_STATUS, U, 1, 1)
+FIELD(CR_STATUS, EH, 2, 1)
+FIELD(CR_STATUS, IH, 3, 1)
+FIELD(CR_STATUS, IL, 4, 6)
+FIELD(CR_STATUS, CRS, 10, 6)
+FIELD(CR_STATUS, PRS, 16, 6)
+FIELD(CR_STATUS, NMI, 22, 1)
+FIELD(CR_STATUS, RSIE, 23, 1)
+
+#define CR_STATUS_PIE R_CR_STATUS_PIE_MASK
+#define CR_STATUS_U R_CR_STATUS_U_MASK
+#define CR_STATUS_EH R_CR_STATUS_EH_MASK
+#define CR_STATUS_IH R_CR_STATUS_IH_MASK
+#define CR_STATUS_NMI R_CR_STATUS_NMI_MASK
+#define CR_STATUS_RSIE R_CR_STATUS_RSIE_MASK
+
#define CR_ESTATUS 1
#define CR_BSTATUS 2
#define CR_IENABLE 3
--
2.34.1
- [PULL 25/68] target/nios2: Use hw/registerfields.h for CR_EXCEPTION fields, (continued)
- [PULL 25/68] target/nios2: Use hw/registerfields.h for CR_EXCEPTION fields, Richard Henderson, 2022/04/26
- [PULL 28/68] target/nios2: Rename CR_TLBMISC_WR to CR_TLBMISC_WE, Richard Henderson, 2022/04/26
- [PULL 29/68] target/nios2: Use hw/registerfields.h for CR_TLBMISC fields, Richard Henderson, 2022/04/26
- [PULL 38/68] target/nios2: Implement cpuid, Richard Henderson, 2022/04/26
- [PULL 32/68] target/nios2: Clean up nios2_cpu_do_interrupt, Richard Henderson, 2022/04/26
- [PULL 37/68] target/nios2: Prevent writes to read-only or reserved control fields, Richard Henderson, 2022/04/26
- [PULL 39/68] target/nios2: Implement CR_STATUS.RSIE, Richard Henderson, 2022/04/26
- [PULL 09/68] target/nios2: Remove user-only nios2_cpu_do_interrupt, Richard Henderson, 2022/04/26
- [PULL 15/68] target/nios2: Add NUM_GP_REGS and NUM_CP_REGS, Richard Henderson, 2022/04/26
- [PULL 19/68] target/nios2: Do not create TCGv for control registers, Richard Henderson, 2022/04/26
- [PULL 24/68] target/nios2: Use hw/registerfields.h for CR_STATUS fields,
Richard Henderson <=
- [PULL 27/68] target/nios2: Use hw/registerfields.h for CR_TLBACC fields, Richard Henderson, 2022/04/26
- [PULL 30/68] target/nios2: Move R_FOO and CR_BAR into enumerations, Richard Henderson, 2022/04/26
- [PULL 33/68] target/nios2: Hoist CPU_LOG_INT logging, Richard Henderson, 2022/04/26
- [PULL 34/68] target/nios2: Handle EXCP_UNALIGN and EXCP_UNALIGND, Richard Henderson, 2022/04/26
- [PULL 35/68] target/nios2: Cleanup set of CR_EXCEPTION for do_interrupt, Richard Henderson, 2022/04/26
- [PULL 31/68] target/nios2: Create EXCP_SEMIHOST for semi-hosting, Richard Henderson, 2022/04/26
- [PULL 36/68] target/nios2: Clean up handling of tlbmisc in do_exception, Richard Henderson, 2022/04/26
- [PULL 40/68] target/nios2: Remove CPU_INTERRUPT_NMI, Richard Henderson, 2022/04/26
- [PULL 43/68] target/nios2: Split out named structs for [IRJ]_TYPE, Richard Henderson, 2022/04/26
- [PULL 46/68] target/nios2: Split out helpers for gen_r_math_logic, Richard Henderson, 2022/04/26