]> xenbits.xensource.com Git - qemu-xen.git/commitdiff
cpu: Add wrapper for the set_pc() hook
authorPeter Crosthwaite <crosthwaitepeter@gmail.com>
Wed, 24 Jun 2015 03:19:20 +0000 (20:19 -0700)
committerAndreas Färber <afaerber@suse.de>
Thu, 9 Jul 2015 13:20:40 +0000 (15:20 +0200)
Add a wrapper around the CPUClass::set_pc() hook.

Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
include/qom/cpu.h

index 39930426677d64c8f9b2e7fe3aeec257ea61832f..b120574df09d09a60fe629cd90a06b1767b94a05 100644 (file)
@@ -601,6 +601,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);
+
+    cc->set_pc(cpu, addr);
+}
+
 /**
  * cpu_reset_interrupt:
  * @cpu: The CPU to clear the interrupt on.