mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-07 01:33:56 -06:00
cpu: Introduce CPUState::gdb_num_regs and CPUClass::gdb_num_core_regs
CPUState::gdb_num_regs replaces num_g_regs. CPUClass::gdb_num_core_regs replaces NUM_CORE_REGS. Allows building gdb_register_coprocessor() for xtensa, too. As a side effect this should fix coprocessor register numbering for SMP. Acked-by: Michael Walle <michael@walle.cc> (for lm32) Acked-by: Max Filippov <jcmvbkbc@gmail.com> (for xtensa) Signed-off-by: Andreas Färber <afaerber@suse.de>
This commit is contained in:
parent
19a77215f1
commit
a0e372f0c4
18 changed files with 66 additions and 65 deletions
|
@ -226,6 +226,14 @@ static void cpu_common_realizefn(DeviceState *dev, Error **errp)
|
|||
}
|
||||
}
|
||||
|
||||
static void cpu_common_initfn(Object *obj)
|
||||
{
|
||||
CPUState *cpu = CPU(obj);
|
||||
CPUClass *cc = CPU_GET_CLASS(obj);
|
||||
|
||||
cpu->gdb_num_regs = cc->gdb_num_core_regs;
|
||||
}
|
||||
|
||||
static int64_t cpu_common_get_arch_id(CPUState *cpu)
|
||||
{
|
||||
return cpu->cpu_index;
|
||||
|
@ -253,6 +261,7 @@ static const TypeInfo cpu_type_info = {
|
|||
.name = TYPE_CPU,
|
||||
.parent = TYPE_DEVICE,
|
||||
.instance_size = sizeof(CPUState),
|
||||
.instance_init = cpu_common_initfn,
|
||||
.abstract = true,
|
||||
.class_size = sizeof(CPUClass),
|
||||
.class_init = cpu_class_init,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue