mirror of
https://github.com/qemu/qemu.git
synced 2024-11-26 12:23:36 +08:00
cpu: Introduce cpu_class_set_parent_reset()
Similarly to what we already do with qdev, use a helper to overload the reset QOM methods of the parent in children classes, for clarity. Signed-off-by: Greg Kurz <groug@kaod.org> Reviewed-by: David Gibson <david@gibson.dropbear.id.au> Reviewed-by: Alistair Francis <alistair.francis@wdc.com> Reviewed-by: Cornelia Huck <cohuck@redhat.com> Acked-by: David Hildenbrand <david@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <157650847239.354886.2782881118916307978.stgit@bahia.lan> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
3e08b2b9cb
commit
ef0a6249a8
@ -239,6 +239,14 @@ void cpu_dump_statistics(CPUState *cpu, int flags)
|
||||
}
|
||||
}
|
||||
|
||||
void cpu_class_set_parent_reset(CPUClass *cc,
|
||||
void (*child_reset)(CPUState *cpu),
|
||||
void (**parent_reset)(CPUState *cpu))
|
||||
{
|
||||
*parent_reset = cc->reset;
|
||||
cc->reset = child_reset;
|
||||
}
|
||||
|
||||
void cpu_reset(CPUState *cpu)
|
||||
{
|
||||
CPUClass *klass = CPU_GET_CLASS(cpu);
|
||||
|
@ -1135,6 +1135,10 @@ void cpu_exec_unrealizefn(CPUState *cpu);
|
||||
*/
|
||||
bool target_words_bigendian(void);
|
||||
|
||||
void cpu_class_set_parent_reset(CPUClass *cc,
|
||||
void (*child_reset)(CPUState *cpu),
|
||||
void (**parent_reset)(CPUState *cpu));
|
||||
|
||||
#ifdef NEED_CPU_H
|
||||
|
||||
#ifdef CONFIG_SOFTMMU
|
||||
|
Loading…
Reference in New Issue
Block a user