From: Jack Lange Date: Sun, 18 Mar 2012 20:42:09 +0000 (-0400) Subject: add in EOI callback X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?p=palacios.git;a=commitdiff_plain;h=b8152adfb5d52ea2f3578b6eb38c32cc51b7269e add in EOI callback --- diff --git a/palacios/src/devices/apic.c b/palacios/src/devices/apic.c index 164970e..3586794 100644 --- a/palacios/src/devices/apic.c +++ b/palacios/src/devices/apic.c @@ -422,6 +422,8 @@ static int activate_apic_irq(struct apic_state * apic, uint32_t irq_num, if (*en_location & flag) { *req_location |= flag; + apic->irq_ack_cbs[irq_num].ack = ack; + apic->irq_ack_cbs[irq_num].private_data = private_data; return 1; } else { PrintDebug("apic %u: core %d: Interrupt not enabled... %.2x\n", @@ -545,7 +547,7 @@ static int get_highest_irr(struct apic_state * apic) { -static int apic_do_eoi(struct apic_state * apic) { +static int apic_do_eoi(struct guest_info * core, struct apic_state * apic) { int isr_irq = get_highest_isr(apic); if (isr_irq != -1) { @@ -558,6 +560,10 @@ static int apic_do_eoi(struct apic_state * apic) { *svc_location &= ~flag; + if (apic->irq_ack_cbs[isr_irq].ack) { + apic->irq_ack_cbs[isr_irq].ack(core, isr_irq, apic->irq_ack_cbs[isr_irq].private_data); + } + #ifdef V3_CONFIG_CRAY_XT if ((isr_irq == 238) || @@ -1466,7 +1472,7 @@ static int apic_write(struct guest_info * core, addr_t guest_addr, void * src, u // Action Registers case EOI_OFFSET: // do eoi - apic_do_eoi(apic); + apic_do_eoi(core, apic); break; case INT_CMD_LO_OFFSET: {