qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 2/3] qtest: new functions for pulsed IRQs


From: Michael Walle
Subject: Re: [Qemu-devel] [PATCH 2/3] qtest: new functions for pulsed IRQs
Date: Wed, 31 Oct 2018 15:30:36 +0100
User-agent: Roundcube Webmail/1.2.3

Am 2018-10-31 11:19, schrieb Paolo Bonzini:
On 18/07/2018 12:48, Michael Walle wrote:
 /**
+ * get_irq_latched:
+ * @num: Interrupt to observe.
+ *
+ * Returns: The latched level of the @num interrupt.
+ */
+static inline bool get_irq_latched(int num)
+{
+    return qtest_get_irq_latched(global_qtest, num);
+}
+
+/**
+ * clear_irq_latch:
+ * @num: Interrupt to operate on.
+ *
+ * Clears the latch of the @num interrupt.
+ */
+static inline void clear_irq_latch(int num)
+{
+    return qtest_clear_irq_latch(global_qtest, num);
+}
+
+/**
  * irq_intercept_in:
  * @string: QOM path of a device.
  *


Just one thing, I think an atomic test-and-clear is a better API.  I
understand that what you have works, because
get_irq_latched+clear_irq_latch don't have any intervening access to the
qtest socket.

Ok thanks, like get_and_clear_irq_latched()? Do you think of we still need the get_irq_latched() to get the state without actually clearing it? I mean my simple test case won't need it, but there might be some cases where you may want peek at the state.

-michael



reply via email to

[Prev in Thread] Current Thread [Next in Thread]