cpu: Add wrapper for the set_pc() hook

Add a wrapper around the CPUClass::set_pc() hook.

Backports commit 2991b8904730d663f12ad42e35798ecc22fe151c from qemu
This commit is contained in:
Peter Crosthwaite 2018-02-14 15:04:35 -05:00 committed by Lioncash
parent e51f8c9f6f
commit 6279dfc113
No known key found for this signature in database
GPG Key ID: 4E3C3CC1031BA9C7

View File

@ -537,6 +537,20 @@ static inline void cpu_unaligned_access(CPUState *cpu, vaddr addr,
}
#endif
/**
* cpu_set_pc:
* @cpu: The CPU to set the program counter for.
* @addr: Program counter value.
*
* Sets the program counter for a CPU.
*/
static inline void cpu_set_pc(CPUState *cpu, vaddr addr)
{
CPUClass *cc = CPU_GET_CLASS(cpu->uc, cpu);
cc->set_pc(cpu, addr);
}
/**
* cpu_reset_interrupt:
* @cpu: The CPU to clear the interrupt on.