[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v8 15/68] target/nios2: Add NUM_GP_REGS and NUM_CP_REGS
From: |
Richard Henderson |
Subject: |
[PATCH v8 15/68] target/nios2: Add NUM_GP_REGS and NUM_CP_REGS |
Date: |
Fri, 22 Apr 2022 09:51:45 -0700 |
From: Amir Gonnen <amir.gonnen@neuroblade.ai>
Split NUM_CORE_REGS into components that can be used elsewhere.
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Amir Gonnen <amir.gonnen@neuroblade.ai>
Message-Id: <20220303153906.2024748-3-amir.gonnen@neuroblade.ai>
[rth: Split out of a larger patch for shadow register sets.]
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20220421151735.31996-16-richard.henderson@linaro.org>
---
target/nios2/cpu.h | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/target/nios2/cpu.h b/target/nios2/cpu.h
index 3198c17213..09dc38a4e7 100644
--- a/target/nios2/cpu.h
+++ b/target/nios2/cpu.h
@@ -56,9 +56,11 @@ struct Nios2CPUClass {
#define EXCEPTION_ADDRESS 0x00000004
#define FAST_TLB_MISS_ADDRESS 0x00000008
+#define NUM_GP_REGS 32
+#define NUM_CR_REGS 32
/* GP regs + CR regs + PC */
-#define NUM_CORE_REGS (32 + 32 + 1)
+#define NUM_CORE_REGS (NUM_GP_REGS + NUM_CR_REGS + 1)
/* General purpose register aliases */
#define R_ZERO 0
@@ -79,7 +81,7 @@ struct Nios2CPUClass {
#define R_RA 31
/* Control register aliases */
-#define CR_BASE 32
+#define CR_BASE NUM_GP_REGS
#define CR_STATUS (CR_BASE + 0)
#define CR_STATUS_PIE (1 << 0)
#define CR_STATUS_U (1 << 1)
--
2.34.1
- [PATCH v8 11/68] target/nios2: Build helper.c for system only, (continued)
- [PATCH v8 11/68] target/nios2: Build helper.c for system only, Richard Henderson, 2022/04/22
- [PATCH v8 12/68] linux-user/nios2: Use force_sig_fault for EXCP_DEBUG, Richard Henderson, 2022/04/22
- [PATCH v8 14/68] target/nios2: Stop generating code if gen_check_supervisor fails, Richard Henderson, 2022/04/22
- [PATCH v8 13/68] target/nios2: Check supervisor on eret, Richard Henderson, 2022/04/22
- [PATCH v8 16/68] target/nios2: Split PC out of env->regs[], Richard Henderson, 2022/04/22
- [PATCH v8 18/68] target/nios2: Fix BRET instruction, Richard Henderson, 2022/04/22
- [PATCH v8 19/68] target/nios2: Do not create TCGv for control registers, Richard Henderson, 2022/04/22
- [PATCH v8 20/68] linux-user/nios2: Only initialize SP and PC in target_cpu_copy_regs, Richard Henderson, 2022/04/22
- [PATCH v8 21/68] target/nios2: Remove cpu_interrupts_enabled, Richard Henderson, 2022/04/22
- [PATCH v8 24/68] target/nios2: Use hw/registerfields.h for CR_STATUS fields, Richard Henderson, 2022/04/22
- [PATCH v8 15/68] target/nios2: Add NUM_GP_REGS and NUM_CP_REGS,
Richard Henderson <=
- [PATCH v8 17/68] target/nios2: Split out helper for eret instruction, Richard Henderson, 2022/04/22
- [PATCH v8 23/68] target/nios2: Clean up nios2_cpu_dump_state, Richard Henderson, 2022/04/22
- [PATCH v8 22/68] target/nios2: Split control registers away from general registers, Richard Henderson, 2022/04/22
- [PATCH v8 25/68] target/nios2: Use hw/registerfields.h for CR_EXCEPTION fields, Richard Henderson, 2022/04/22
- [PATCH v8 26/68] target/nios2: Use hw/registerfields.h for CR_TLBADDR fields, Richard Henderson, 2022/04/22
- [PATCH v8 27/68] target/nios2: Use hw/registerfields.h for CR_TLBACC fields, Richard Henderson, 2022/04/22
- [PATCH v8 28/68] target/nios2: Rename CR_TLBMISC_WR to CR_TLBMISC_WE, Richard Henderson, 2022/04/22
- [PATCH v8 29/68] target/nios2: Use hw/registerfields.h for CR_TLBMISC fields, Richard Henderson, 2022/04/22
- [PATCH v8 30/68] target/nios2: Move R_FOO and CR_BAR into enumerations, Richard Henderson, 2022/04/22
- [PATCH v8 31/68] target/nios2: Create EXCP_SEMIHOST for semi-hosting, Richard Henderson, 2022/04/22