static inline void write_IRQreg (openpic_t *opp, int n_IRQ,

                                 uint32_t reg, uint32_t val)

{

    uint32_t tmp;



    switch (reg) {

    case IRQ_IPVP:

        /* NOTE: not fully accurate for special IRQs, but simple and

           sufficient */

        /* ACTIVITY bit is read-only */

        opp->src[n_IRQ].ipvp =

            (opp->src[n_IRQ].ipvp & 0x40000000) |

            (val & 0x800F00FF);

        openpic_update_irq(opp, n_IRQ);

        DPRINTF("Set IPVP %d to 0x%08x -> 0x%08x\n",

                n_IRQ, val, opp->src[n_IRQ].ipvp);

        break;

    case IRQ_IDE:

        tmp = val & 0xC0000000;

        tmp |= val & ((1 << MAX_CPU) - 1);

        opp->src[n_IRQ].ide = tmp;

        DPRINTF("Set IDE %d to 0x%08x\n", n_IRQ, opp->src[n_IRQ].ide);

        break;

    }

}

static inline void write_IRQreg (openpic_t *opp, int n_IRQ,

                                 uint32_t reg, uint32_t val)

{

    uint32_t tmp;



    switch (reg) {

    case IRQ_IPVP:

        



        

        opp->src[n_IRQ].ipvp =

            (opp->src[n_IRQ].ipvp & 0x40000000) |

            (val & 0x800F00FF);

        openpic_update_irq(opp, n_IRQ);

        DPRINTF("Set IPVP %d to 0x%08x -> 0x%08x\n",

                n_IRQ, val, opp->src[n_IRQ].ipvp);

        break;

    case IRQ_IDE:

        tmp = val & 0xC0000000;

        tmp |= val & ((1 << MAX_CPU) - 1);

        opp->src[n_IRQ].ide = tmp;

        DPRINTF("Set IDE %d to 0x%08x\n", n_IRQ, opp->src[n_IRQ].ide);

        break;

    }

}

        tmp |= val & ((1 << MAX_CPU) - 1);
static inline void FUNC_0 (openpic_t *VAR_0, int VAR_1,

                                 uint32_t VAR_2, uint32_t VAR_3)

{

    uint32_t tmp;



    switch (VAR_2) {

    case IRQ_IPVP:

        



        

        VAR_0->src[VAR_1].ipvp =

            (VAR_0->src[VAR_1].ipvp & 0x40000000) |

            (VAR_3 & 0x800F00FF);

        openpic_update_irq(VAR_0, VAR_1);

        DPRINTF("Set IPVP %d to 0x%08x -> 0x%08x\n",

                VAR_1, VAR_3, VAR_0->src[VAR_1].ipvp);

        break;

    case IRQ_IDE:

        tmp = VAR_3 & 0xC0000000;

        tmp |= VAR_3 & ((1 << MAX_CPU) - 1);

        VAR_0->src[VAR_1].ide = tmp;

        DPRINTF("Set IDE %d to 0x%08x\n", VAR_1, VAR_0->src[VAR_1].ide);

        break;

    }

}

static inline void FUNC_0 (openpic_t *VAR_0, int VAR_1,
uint32_t VAR_2, uint32_t VAR_3)
{ uint32_t tmp; switch (VAR_2) { case IRQ_IPVP:
VAR_0->src[VAR_1].ipvp =
(VAR_0->src[VAR_1].ipvp & 0x40000000) |
(VAR_3 & 0x800F00FF); openpic_update_irq(VAR_0, VAR_1); DPRINTF("Set IPVP %d to 0x%08x -> 0x%08x\n",
VAR_1, VAR_3, VAR_0->src[VAR_1].ipvp); break; case IRQ_IDE:
tmp = VAR_3 & 0xC0000000; tmp |= VAR_3 & ((1 << MAX_CPU) - 1); VAR_0->src[VAR_1].ide = tmp; DPRINTF("Set IDE %d to 0x%08x\n", VAR_1, VAR_0->src[VAR_1].ide); break; } }