mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 00:03:54 -06:00
cpus: Prefer cached CpuClass over CPU_GET_CLASS() macro
CpuState caches its CPUClass since commit 6fbdff8706
("cpu: cache CPUClass in CPUState for hot code paths"),
use it.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20250122093028.52416-5-philmd@linaro.org>
This commit is contained in:
parent
43610f3184
commit
30e76638eb
4 changed files with 33 additions and 61 deletions
|
@ -40,9 +40,7 @@ CPUState *cpu_by_arch_id(int64_t id)
|
|||
CPUState *cpu;
|
||||
|
||||
CPU_FOREACH(cpu) {
|
||||
CPUClass *cc = CPU_GET_CLASS(cpu);
|
||||
|
||||
if (cc->get_arch_id(cpu) == id) {
|
||||
if (cpu->cc->get_arch_id(cpu) == id) {
|
||||
return cpu;
|
||||
}
|
||||
}
|
||||
|
@ -101,11 +99,9 @@ static int cpu_common_gdb_write_register(CPUState *cpu, uint8_t *buf, int reg)
|
|||
|
||||
void cpu_dump_state(CPUState *cpu, FILE *f, int flags)
|
||||
{
|
||||
CPUClass *cc = CPU_GET_CLASS(cpu);
|
||||
|
||||
if (cc->dump_state) {
|
||||
if (cpu->cc->dump_state) {
|
||||
cpu_synchronize_state(cpu);
|
||||
cc->dump_state(cpu, f, flags);
|
||||
cpu->cc->dump_state(cpu, f, flags);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -119,11 +115,10 @@ void cpu_reset(CPUState *cpu)
|
|||
static void cpu_common_reset_hold(Object *obj, ResetType type)
|
||||
{
|
||||
CPUState *cpu = CPU(obj);
|
||||
CPUClass *cc = CPU_GET_CLASS(cpu);
|
||||
|
||||
if (qemu_loglevel_mask(CPU_LOG_RESET)) {
|
||||
qemu_log("CPU Reset (CPU %d)\n", cpu->cpu_index);
|
||||
log_cpu_state(cpu, cc->reset_dump_flags);
|
||||
log_cpu_state(cpu, cpu->cc->reset_dump_flags);
|
||||
}
|
||||
|
||||
cpu->interrupt_request = 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue