static void IRQ_local_pipe(OpenPICState *opp, int n_CPU, int n_IRQ)

{

    IRQDest *dst;

    IRQSource *src;

    int priority;



    dst = &opp->dst[n_CPU];

    src = &opp->src[n_IRQ];



    if (src->output != OPENPIC_OUTPUT_INT) {

        /* On Freescale MPIC, critical interrupts ignore priority,

         * IACK, EOI, etc.  Before MPIC v4.1 they also ignore

         * masking.

         */

        src->ivpr |= IVPR_ACTIVITY_MASK;

        DPRINTF("%s: Raise OpenPIC output %d cpu %d irq %d\n",

                __func__, src->output, n_CPU, n_IRQ);

        qemu_irq_raise(opp->dst[n_CPU].irqs[src->output]);

        return;

    }



    priority = IVPR_PRIORITY(src->ivpr);

    if (priority <= dst->ctpr) {

        /* Too low priority */

        DPRINTF("%s: IRQ %d has too low priority on CPU %d\n",

                __func__, n_IRQ, n_CPU);

        return;

    }

    if (IRQ_testbit(&dst->raised, n_IRQ)) {

        /* Interrupt miss */

        DPRINTF("%s: IRQ %d was missed on CPU %d\n",

                __func__, n_IRQ, n_CPU);

        return;

    }

    src->ivpr |= IVPR_ACTIVITY_MASK;

    IRQ_setbit(&dst->raised, n_IRQ);

    if (priority < dst->raised.priority) {

        /* An higher priority IRQ is already raised */

        DPRINTF("%s: IRQ %d is hidden by raised IRQ %d on CPU %d\n",

                __func__, n_IRQ, dst->raised.next, n_CPU);

        return;

    }

    IRQ_check(opp, &dst->raised);

    if (IRQ_get_next(opp, &dst->servicing) != -1 &&

        priority <= dst->servicing.priority) {

        DPRINTF("%s: IRQ %d is hidden by servicing IRQ %d on CPU %d\n",

                __func__, n_IRQ, dst->servicing.next, n_CPU);

        /* Already servicing a higher priority IRQ */

        return;

    }

    DPRINTF("Raise OpenPIC INT output cpu %d irq %d\n", n_CPU, n_IRQ);

    qemu_irq_raise(opp->dst[n_CPU].irqs[OPENPIC_OUTPUT_INT]);

}

static void IRQ_local_pipe(OpenPICState *opp, int n_CPU, int n_IRQ)

{

    IRQDest *dst;

    IRQSource *src;

    int priority;



    dst = &opp->dst[n_CPU];

    src = &opp->src[n_IRQ];



    if (src->output != OPENPIC_OUTPUT_INT) {

        







        src->ivpr |= IVPR_ACTIVITY_MASK;

        DPRINTF("%s: Raise OpenPIC output %d cpu %d irq %d\n",

                __func__, src->output, n_CPU, n_IRQ);

        qemu_irq_raise(opp->dst[n_CPU].irqs[src->output]);

        return;

    }



    priority = IVPR_PRIORITY(src->ivpr);

    if (priority <= dst->ctpr) {

        

        DPRINTF("%s: IRQ %d has too low priority on CPU %d\n",

                __func__, n_IRQ, n_CPU);

        return;

    }

    if (IRQ_testbit(&dst->raised, n_IRQ)) {

        

        DPRINTF("%s: IRQ %d was missed on CPU %d\n",

                __func__, n_IRQ, n_CPU);

        return;

    }

    src->ivpr |= IVPR_ACTIVITY_MASK;

    IRQ_setbit(&dst->raised, n_IRQ);

    if (priority < dst->raised.priority) {

        

        DPRINTF("%s: IRQ %d is hidden by raised IRQ %d on CPU %d\n",

                __func__, n_IRQ, dst->raised.next, n_CPU);

        return;

    }

    IRQ_check(opp, &dst->raised);

    if (IRQ_get_next(opp, &dst->servicing) != -1 &&

        priority <= dst->servicing.priority) {

        DPRINTF("%s: IRQ %d is hidden by servicing IRQ %d on CPU %d\n",

                __func__, n_IRQ, dst->servicing.next, n_CPU);

        

        return;

    }

    DPRINTF("Raise OpenPIC INT output cpu %d irq %d\n", n_CPU, n_IRQ);

    qemu_irq_raise(opp->dst[n_CPU].irqs[OPENPIC_OUTPUT_INT]);

}

static void FUNC_0(OpenPICState *VAR_0, int VAR_1, int VAR_2)

{

    IRQDest *dst;

    IRQSource *src;

    int VAR_3;



    dst = &VAR_0->dst[VAR_1];

    src = &VAR_0->src[VAR_2];



    if (src->output != OPENPIC_OUTPUT_INT) {

        







        src->ivpr |= IVPR_ACTIVITY_MASK;

        DPRINTF("%s: Raise OpenPIC output %d cpu %d irq %d\n",

                __func__, src->output, VAR_1, VAR_2);

        qemu_irq_raise(VAR_0->dst[VAR_1].irqs[src->output]);

        return;

    }



    VAR_3 = IVPR_PRIORITY(src->ivpr);

    if (VAR_3 <= dst->ctpr) {

        

        DPRINTF("%s: IRQ %d has too low VAR_3 on CPU %d\n",

                __func__, VAR_2, VAR_1);

        return;

    }

    if (IRQ_testbit(&dst->raised, VAR_2)) {

        

        DPRINTF("%s: IRQ %d was missed on CPU %d\n",

                __func__, VAR_2, VAR_1);

        return;

    }

    src->ivpr |= IVPR_ACTIVITY_MASK;

    IRQ_setbit(&dst->raised, VAR_2);

    if (VAR_3 < dst->raised.VAR_3) {

        

        DPRINTF("%s: IRQ %d is hidden by raised IRQ %d on CPU %d\n",

                __func__, VAR_2, dst->raised.next, VAR_1);

        return;

    }

    IRQ_check(VAR_0, &dst->raised);

    if (IRQ_get_next(VAR_0, &dst->servicing) != -1 &&

        VAR_3 <= dst->servicing.VAR_3) {

        DPRINTF("%s: IRQ %d is hidden by servicing IRQ %d on CPU %d\n",

                __func__, VAR_2, dst->servicing.next, VAR_1);

        

        return;

    }

    DPRINTF("Raise OpenPIC INT output cpu %d irq %d\n", VAR_1, VAR_2);

    qemu_irq_raise(VAR_0->dst[VAR_1].irqs[OPENPIC_OUTPUT_INT]);

}

static void FUNC_0(OpenPICState *VAR_0, int VAR_1, int VAR_2)
{ IRQDest *dst; IRQSource *src; int VAR_3; dst = &VAR_0->dst[VAR_1]; src = &VAR_0->src[VAR_2]; if (src->output != OPENPIC_OUTPUT_INT) { src->ivpr |= IVPR_ACTIVITY_MASK; DPRINTF("%s: Raise OpenPIC output %d cpu %d irq %d\n",
__func__, src->output, VAR_1, VAR_2); qemu_irq_raise(VAR_0->dst[VAR_1].irqs[src->output]); return; } VAR_3 = IVPR_PRIORITY(src->ivpr); if (VAR_3 <= dst->ctpr) { DPRINTF("%s: IRQ %d has too low VAR_3 on CPU %d\n",
__func__, VAR_2, VAR_1); return; } if (IRQ_testbit(&dst->raised, VAR_2)) { DPRINTF("%s: IRQ %d was missed on CPU %d\n",
__func__, VAR_2, VAR_1); return; } src->ivpr |= IVPR_ACTIVITY_MASK; IRQ_setbit(&dst->raised, VAR_2); if (VAR_3 < dst->raised.VAR_3) { DPRINTF("%s: IRQ %d is hidden by raised IRQ %d on CPU %d\n",
__func__, VAR_2, dst->raised.next, VAR_1); return; } IRQ_check(VAR_0, &dst->raised); if (IRQ_get_next(VAR_0, &dst->servicing) != -1 &&
VAR_3 <= dst->servicing.VAR_3) { DPRINTF("%s: IRQ %d is hidden by servicing IRQ %d on CPU %d\n",
__func__, VAR_2, dst->servicing.next, VAR_1); return; } DPRINTF("Raise OpenPIC INT output cpu %d irq %d\n", VAR_1, VAR_2); qemu_irq_raise(VAR_0->dst[VAR_1].irqs[OPENPIC_OUTPUT_INT]); }