static void ppcuic_set_irq (void *opaque, int irq_num, int level)

{

    ppcuic_t *uic;

    uint32_t mask, sr;



    uic = opaque;

    mask = 1 << (31-irq_num);

    LOG_UIC("%s: irq %d level %d uicsr %08" PRIx32

                " mask %08" PRIx32 " => %08" PRIx32 " %08" PRIx32 "\n",

                __func__, irq_num, level,

                uic->uicsr, mask, uic->uicsr & mask, level << irq_num);

    if (irq_num < 0 || irq_num > 31)

        return;

    sr = uic->uicsr;



    /* Update status register */

    if (uic->uictr & mask) {

        /* Edge sensitive interrupt */

        if (level == 1)

            uic->uicsr |= mask;

    } else {

        /* Level sensitive interrupt */

        if (level == 1) {

            uic->uicsr |= mask;

            uic->level |= mask;

        } else {

            uic->uicsr &= ~mask;

            uic->level &= ~mask;

        }

    }

    LOG_UIC("%s: irq %d level %d sr %" PRIx32 " => "

                "%08" PRIx32 "\n", __func__, irq_num, level, uic->uicsr, sr);

    if (sr != uic->uicsr)

        ppcuic_trigger_irq(uic);

}

static void ppcuic_set_irq (void *opaque, int irq_num, int level)

{

    ppcuic_t *uic;

    uint32_t mask, sr;



    uic = opaque;

    mask = 1 << (31-irq_num);

    LOG_UIC("%s: irq %d level %d uicsr %08" PRIx32

                " mask %08" PRIx32 " => %08" PRIx32 " %08" PRIx32 "\n",

                __func__, irq_num, level,

                uic->uicsr, mask, uic->uicsr & mask, level << irq_num);

    if (irq_num < 0 || irq_num > 31)

        return;

    sr = uic->uicsr;



    

    if (uic->uictr & mask) {

        

        if (level == 1)

            uic->uicsr |= mask;

    } else {

        

        if (level == 1) {

            uic->uicsr |= mask;

            uic->level |= mask;

        } else {

            uic->uicsr &= ~mask;

            uic->level &= ~mask;

        }

    }

    LOG_UIC("%s: irq %d level %d sr %" PRIx32 " => "

                "%08" PRIx32 "\n", __func__, irq_num, level, uic->uicsr, sr);

    if (sr != uic->uicsr)

        ppcuic_trigger_irq(uic);

}

    mask = 1 << (31-irq_num);
static void FUNC_0 (void *VAR_0, int VAR_1, int VAR_2)

{

    ppcuic_t *uic;

    uint32_t mask, sr;



    uic = VAR_0;

    mask = 1 << (31-VAR_1);

    LOG_UIC("%s: irq %d VAR_2 %d uicsr %08" PRIx32

                " mask %08" PRIx32 " => %08" PRIx32 " %08" PRIx32 "\n",

                __func__, VAR_1, VAR_2,

                uic->uicsr, mask, uic->uicsr & mask, VAR_2 << VAR_1);

    if (VAR_1 < 0 || VAR_1 > 31)

        return;

    sr = uic->uicsr;



    

    if (uic->uictr & mask) {

        

        if (VAR_2 == 1)

            uic->uicsr |= mask;

    } else {

        

        if (VAR_2 == 1) {

            uic->uicsr |= mask;

            uic->VAR_2 |= mask;

        } else {

            uic->uicsr &= ~mask;

            uic->VAR_2 &= ~mask;

        }

    }

    LOG_UIC("%s: irq %d VAR_2 %d sr %" PRIx32 " => "

                "%08" PRIx32 "\n", __func__, VAR_1, VAR_2, uic->uicsr, sr);

    if (sr != uic->uicsr)

        ppcuic_trigger_irq(uic);

}

static void FUNC_0 (void *VAR_0, int VAR_1, int VAR_2)
{ ppcuic_t *uic; uint32_t mask, sr; uic = VAR_0; mask = 1 << (31-VAR_1); LOG_UIC("%s: irq %d VAR_2 %d uicsr %08" PRIx32
" mask %08" PRIx32 " => %08" PRIx32 " %08" PRIx32 "\n",
__func__, VAR_1, VAR_2,
uic->uicsr, mask, uic->uicsr & mask, VAR_2 << VAR_1); if (VAR_1 < 0 || VAR_1 > 31)
return; sr = uic->uicsr; if (uic->uictr & mask) { if (VAR_2 == 1)
uic->uicsr |= mask; } else { if (VAR_2 == 1) { uic->uicsr |= mask; uic->VAR_2 |= mask; } else { uic->uicsr &= ~mask; uic->VAR_2 &= ~mask; } } LOG_UIC("%s: irq %d VAR_2 %d sr %" PRIx32 " => "
"%08" PRIx32 "\n", __func__, VAR_1, VAR_2, uic->uicsr, sr); if (sr != uic->uicsr)
ppcuic_trigger_irq(uic); }