From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45417) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z7bDp-0006H3-3q for qemu-devel@nongnu.org; Tue, 23 Jun 2015 23:19:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z7bDm-0006CX-Ih for qemu-devel@nongnu.org; Tue, 23 Jun 2015 23:19:33 -0400 Received: from mail-pa0-x229.google.com ([2607:f8b0:400e:c03::229]:34593) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z7bDm-0006C8-BY for qemu-devel@nongnu.org; Tue, 23 Jun 2015 23:19:30 -0400 Received: by pabvl15 with SMTP id vl15so19738701pab.1 for ; Tue, 23 Jun 2015 20:19:29 -0700 (PDT) From: Peter Crosthwaite Date: Tue, 23 Jun 2015 20:19:20 -0700 Message-Id: <06c2a347f5ae9b1189cdfceeca8f885bc992c1e7.1435115710.git.crosthwaite.peter@gmail.com> In-Reply-To: References: In-Reply-To: References: Subject: [Qemu-devel] [PATCH qom v3 1/4] cpu: Add wrapper to the set-pc() hook List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, Peter Crosthwaite , afaerber@suse.de, edgar.iglesias@gmail.com Add a wrapper around the CPUClass::set_pc() hook. Signed-off-by: Peter Crosthwaite --- changed since v2: drop "qom" from commit message subject. Add () to functions in commit messages. Drop error argument --- include/qom/cpu.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/include/qom/cpu.h b/include/qom/cpu.h index 39f0f19..5fb1f60 100644 --- a/include/qom/cpu.h +++ b/include/qom/cpu.h @@ -600,6 +600,23 @@ 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. + * + * Set the program counter for a CPU. If there is no available implementation + * no action occurs. + */ +static inline void cpu_set_pc(CPUState *cpu, vaddr addr) +{ + CPUClass *cc = CPU_GET_CLASS(cpu); + + if (cc->set_pc) { + cc->set_pc(cpu, addr); + } +} + +/** * cpu_reset_interrupt: * @cpu: The CPU to clear the interrupt on. * @mask: The interrupt mask to clear. -- 1.9.1