@@ -17,6 +17,7 @@
* License along with this library; if not, see <http://www.gnu.org/licenses/>
*/
#include "hw.h"
+#include "pc.h"
#include "apic.h"
#include "ioapic.h"
#include "qemu-timer.h"
@@ -1143,6 +1144,9 @@ static SysBusDeviceInfo apic_info = {
static void apic_register_devices(void)
{
+ register_target_get_irq_delivered(apic_get_irq_delivered);
+ register_target_reset_irq_delivered(apic_reset_irq_delivered);
+
sysbus_register_withprop(&apic_info);
}
@@ -7,6 +7,19 @@
#include "fdc.h"
#include "net.h"
+extern int (*target_get_irq_delivered)(void);
+extern void (*target_reset_irq_delivered)(void);
+
+static inline void register_target_get_irq_delivered(int (*func)(void))
+{
+ target_get_irq_delivered = func;
+}
+
+static inline void register_target_reset_irq_delivered(void (*func)(void))
+{
+ target_reset_irq_delivered = func;
+}
+
/* PC-style peripherals (also used by other machines). */
/* serial.c */
@@ -232,6 +232,19 @@ const char *prom_envs[MAX_PROM_ENVS];
const char *nvram = NULL;
int boot_menu;
+static int target_get_irq_delivered_stub(void)
+{
+ return 1;
+}
+
+static void target_reset_irq_delivered_stub(void)
+{
+ return;
+}
+
+int (*target_get_irq_delivered)(void) = target_get_irq_delivered_stub;
+void (*target_reset_irq_delivered)(void) = target_reset_irq_delivered_stub;
+
typedef struct FWBootEntry FWBootEntry;
struct FWBootEntry {
'target_get_irq_delivered' and 'target_reset_irq_delivered' point to functions that are called by update_irq() to detect coalesced interrupts. Initially they point to stub functions which pretend successful interrupt injection. apic code calls two registration functions to replace the stubs with apic_get_irq_delivered() and apic_reset_irq_delivered(). This change can be replaced if a generic feedback infrastructure to track coalesced IRQs for periodic, clock providing devices becomes available. Signed-off-by: Ulrich Obergfell <uobergfe@redhat.com> --- hw/apic.c | 4 ++++ hw/pc.h | 13 +++++++++++++ vl.c | 13 +++++++++++++ 3 files changed, 30 insertions(+), 0 deletions(-)