static void rtas_set_xive(sPAPREnvironment *spapr, uint32_t token,

                          uint32_t nargs, target_ulong args,

                          uint32_t nret, target_ulong rets)

{

    struct ics_state *ics = spapr->icp->ics;

    uint32_t nr, server, priority;



    if ((nargs != 3) || (nret != 1)) {

        rtas_st(rets, 0, -3);

        return;

    }



    nr = rtas_ld(args, 0);

    server = rtas_ld(args, 1);

    priority = rtas_ld(args, 2);



    if (!ics_valid_irq(ics, nr) || (server >= ics->icp->nr_servers)

        || (priority > 0xff)) {

        rtas_st(rets, 0, -3);

        return;

    }



    ics_write_xive(ics, nr, server, priority, priority);



    rtas_st(rets, 0, 0); /* Success */

}

static void rtas_set_xive(sPAPREnvironment *spapr, uint32_t token,

                          uint32_t nargs, target_ulong args,

                          uint32_t nret, target_ulong rets)

{

    struct ics_state *ics = spapr->icp->ics;

    uint32_t nr, server, priority;



    if ((nargs != 3) || (nret != 1)) {

        rtas_st(rets, 0, -3);

        return;

    }



    nr = rtas_ld(args, 0);

    server = rtas_ld(args, 1);

    priority = rtas_ld(args, 2);



    if (!ics_valid_irq(ics, nr) || (server >= ics->icp->nr_servers)

        || (priority > 0xff)) {

        rtas_st(rets, 0, -3);

        return;

    }



    ics_write_xive(ics, nr, server, priority, priority);



    rtas_st(rets, 0, 0); 

}

static void FUNC_0(sPAPREnvironment *VAR_0, uint32_t VAR_1,

                          uint32_t VAR_2, target_ulong VAR_3,

                          uint32_t VAR_4, target_ulong VAR_5)

{

    struct ics_state *VAR_6 = VAR_0->icp->VAR_6;

    uint32_t nr, server, priority;



    if ((VAR_2 != 3) || (VAR_4 != 1)) {

        rtas_st(VAR_5, 0, -3);

        return;

    }



    nr = rtas_ld(VAR_3, 0);

    server = rtas_ld(VAR_3, 1);

    priority = rtas_ld(VAR_3, 2);



    if (!ics_valid_irq(VAR_6, nr) || (server >= VAR_6->icp->nr_servers)

        || (priority > 0xff)) {

        rtas_st(VAR_5, 0, -3);

        return;

    }



    ics_write_xive(VAR_6, nr, server, priority, priority);



    rtas_st(VAR_5, 0, 0); 

}

static void FUNC_0(sPAPREnvironment *VAR_0, uint32_t VAR_1,
uint32_t VAR_2, target_ulong VAR_3,
uint32_t VAR_4, target_ulong VAR_5)
{ struct ics_state *VAR_6 = VAR_0->icp->VAR_6; uint32_t nr, server, priority; if ((VAR_2 != 3) || (VAR_4 != 1)) { rtas_st(VAR_5, 0, -3); return; } nr = rtas_ld(VAR_3, 0); server = rtas_ld(VAR_3, 1); priority = rtas_ld(VAR_3, 2); if (!ics_valid_irq(VAR_6, nr) || (server >= VAR_6->icp->nr_servers)
|| (priority > 0xff)) { rtas_st(VAR_5, 0, -3); return; } ics_write_xive(VAR_6, nr, server, priority, priority); rtas_st(VAR_5, 0, 0); }