From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34828) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YvvyV-0007du-FH for qemu-devel@nongnu.org; Fri, 22 May 2015 19:03:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YvvyQ-00060l-It for qemu-devel@nongnu.org; Fri, 22 May 2015 19:03:31 -0400 Received: from mail.uni-paderborn.de ([131.234.142.9]:41054) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YvvyQ-00060C-98 for qemu-devel@nongnu.org; Fri, 22 May 2015 19:03:26 -0400 Message-ID: <555FB5B8.50609@mail.uni-paderborn.de> Date: Sat, 23 May 2015 01:03:20 +0200 From: Bastian Koppelmann MIME-Version: 1.0 References: In-Reply-To: Content-Type: multipart/alternative; boundary="------------030803040005010207030908" Subject: Re: [Qemu-devel] How Qemu timer interrupts code emulation? List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Nguyen Anh Quynh , Peter Maydell Cc: "qemu-devel@nongnu.org" This is a multi-part message in MIME format. --------------030803040005010207030908 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit On 05/22/2015 06:26 PM, Nguyen Anh Quynh wrote: > > > On Sat, May 23, 2015 at 12:13 AM, Peter Maydell > > wrote: > > On 22 May 2015 at 16:36, Jun Koi > wrote: > > In general, we would have timer & code execution run in parallel, > > No code has to actually run when there's an active timer; > the event loop thread mostly sits blocked waiting for > something interesting to happen (io or a timer firing). > When it does then the event loop thread will call the > generic timer code, which will call the callback function > for that timer. Typically this is inside the device model > for whatever timer the hardware you're modelling is. It > will then (assuming it really wants to create a simulated > interrupt) call qemu_irq_set() > > > What is the exact name of this function? There is no such qemu_irq_set() > in the latest 2.3.0 source. > Peter just got it switched around, it's qemu_set_irq() in include/hw/irq.h. Cheers, Bastian --------------030803040005010207030908 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 7bit

On 05/22/2015 06:26 PM, Nguyen Anh Quynh wrote:


On Sat, May 23, 2015 at 12:13 AM, Peter Maydell <peter.maydell@linaro.org> wrote:
On 22 May 2015 at 16:36, Jun Koi <junkoi2004@gmail.com> wrote:
> In general, we would have timer & code execution run in parallel,

No code has to actually run when there's an active timer;
the event loop thread mostly sits blocked waiting for
something interesting to happen (io or a timer firing).
When it does then the event loop thread will call the
generic timer code, which will call the callback function
for that timer. Typically this is inside the device model
for whatever timer the hardware you're modelling is. It
will then (assuming it really wants to create a simulated
interrupt) call qemu_irq_set()

What is the exact name of this function? There is no such qemu_irq_set()
in the latest 2.3.0 source.

Peter just got it switched around, it's qemu_set_irq() in include/hw/irq.h.

Cheers,
Bastian

--------------030803040005010207030908--