Disassembler is not expected to alter the CPU config.
Besides, all other RISC-V methods takes a const RISCVCPUConfig.
Make the @cfg field of the rv_decode structure const, passing
a const pointer to disasm_inst().
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-ID: <
20260202222412.24923-6-philmd@linaro.org>
/* disassemble instruction */
static GString *disasm_inst(rv_isa isa, uint64_t pc, rv_inst inst,
- RISCVCPUConfig *cfg)
+ const RISCVCPUConfig *cfg)
{
rv_decode dec = { 0 };
dec.pc = pc;
}
g_autoptr(GString) str =
- disasm_inst(isa, memaddr, inst, (RISCVCPUConfig *)info->target_info);
+ disasm_inst(isa, memaddr, inst,
+ (const RISCVCPUConfig *)info->target_info);
(*info->fprintf_func)(info->stream, "%s", str->str);
return len;
} rv_opcode_data;
typedef struct {
- RISCVCPUConfig *cfg;
+ const RISCVCPUConfig *cfg;
uint64_t pc;
uint64_t inst;
const rv_opcode_data *opcode_data;