Message ID | 20250121114056.53949-11-philmd@linaro.org |
---|---|
State | New |
Headers | show |
Series | cpus: Prefer cached CpuClass over CPU_GET_CLASS() macro | expand |
On 21/1/25 12:40, Philippe Mathieu-Daudé wrote: > CpuState caches its CPUClass since commit 6fbdff87062 > ("cpu: cache CPUClass in CPUState for hot code paths"), > use it. > > Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> > --- > target/microblaze/gdbstub.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/target/microblaze/gdbstub.c b/target/microblaze/gdbstub.c > index 09d74e164d0..8b08ed5cb49 100644 > --- a/target/microblaze/gdbstub.c > +++ b/target/microblaze/gdbstub.c > @@ -110,11 +110,10 @@ int mb_cpu_gdb_read_stack_protect(CPUState *cs, GByteArray *mem_buf, int n) > > int mb_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n) > { > - CPUClass *cc = CPU_GET_CLASS(cs); > CPUMBState *env = cpu_env(cs); > uint32_t tmp; > > - if (n > cc->gdb_num_core_regs) { > + if (n > cs->cc->gdb_num_core_regs) { > return 0; > } Apparently gdb_write_register() deals with that, so we can remove.
diff --git a/target/microblaze/gdbstub.c b/target/microblaze/gdbstub.c index 09d74e164d0..8b08ed5cb49 100644 --- a/target/microblaze/gdbstub.c +++ b/target/microblaze/gdbstub.c @@ -110,11 +110,10 @@ int mb_cpu_gdb_read_stack_protect(CPUState *cs, GByteArray *mem_buf, int n) int mb_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n) { - CPUClass *cc = CPU_GET_CLASS(cs); CPUMBState *env = cpu_env(cs); uint32_t tmp; - if (n > cc->gdb_num_core_regs) { + if (n > cs->cc->gdb_num_core_regs) { return 0; }
CpuState caches its CPUClass since commit 6fbdff87062 ("cpu: cache CPUClass in CPUState for hot code paths"), use it. Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> --- target/microblaze/gdbstub.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)