[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 6/9] target/riscv/cpu: Share RISCVCPUConfig with disassembler
From: |
Christoph Muellner |
Subject: |
[PATCH 6/9] target/riscv/cpu: Share RISCVCPUConfig with disassembler |
Date: |
Tue, 30 May 2023 15:18:40 +0200 |
From: Christoph Müllner <christoph.muellner@vrull.eu>
The disassembler needs the available extensions in order
to properly decode instructions in case of overlapping
encodings (e.g. for vendor extensions).
Let's use the field 'disassemble_info::private_data' to store
our RISCVCPUConfig pointer.
Signed-off-by: Christoph Müllner <christoph.muellner@vrull.eu>
---
target/riscv/cpu.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c
index 5b7818dbd1..6f0cd9a0bb 100644
--- a/target/riscv/cpu.c
+++ b/target/riscv/cpu.c
@@ -819,6 +819,9 @@ static void riscv_cpu_disas_set_info(CPUState *s,
disassemble_info *info)
{
RISCVCPU *cpu = RISCV_CPU(s);
CPURISCVState *env = &cpu->env;
+ RISCVCPUConfig *cfg = &cpu->cfg;
+
+ info->private_data = cfg;
switch (env->xl) {
case MXL_RV32:
--
2.40.1
- [PATCH 0/9] disas/riscv: Add vendor extension support, Christoph Muellner, 2023/05/30
- [PATCH 1/9] target/riscv: Use xl instead of mxl for disassemble, Christoph Muellner, 2023/05/30
- [PATCH 2/9] target/riscv: Factor out RISCVCPUConfig from cpu.h, Christoph Muellner, 2023/05/30
- [PATCH 5/9] disas/riscv: Encapsulate opcode_data into decode, Christoph Muellner, 2023/05/30
- [PATCH 7/9] disas/riscv: Provide infrastructure for vendor extensions, Christoph Muellner, 2023/05/30
- [PATCH 8/9] disas/riscv: Add support for XVentanaCondOps, Christoph Muellner, 2023/05/30
- [PATCH 4/9] disas/riscv: Make rv_op_illegal a shared enum value, Christoph Muellner, 2023/05/30
- [PATCH 9/9] disas/riscv: Add support for XThead* instructions, Christoph Muellner, 2023/05/30
- [PATCH 3/9] disas/riscv: Move types/constants to new header file, Christoph Muellner, 2023/05/30
- [PATCH 6/9] target/riscv/cpu: Share RISCVCPUConfig with disassembler,
Christoph Muellner <=