static void rtas_set_tce_bypass(sPAPREnvironment *spapr, uint32_t token,

                                uint32_t nargs, target_ulong args,

                                uint32_t nret, target_ulong rets)

{

    VIOsPAPRBus *bus = spapr->vio_bus;

    VIOsPAPRDevice *dev;

    uint32_t unit, enable;



    if (nargs != 2) {

        rtas_st(rets, 0, -3);

        return;

    }

    unit = rtas_ld(args, 0);

    enable = rtas_ld(args, 1);

    dev = spapr_vio_find_by_reg(bus, unit);

    if (!dev) {

        rtas_st(rets, 0, -3);

        return;

    }

    if (enable) {

        dev->flags |= VIO_PAPR_FLAG_DMA_BYPASS;

    } else {

        dev->flags &= ~VIO_PAPR_FLAG_DMA_BYPASS;

    }



    rtas_st(rets, 0, 0);

}

static void rtas_set_tce_bypass(sPAPREnvironment *spapr, uint32_t token,

                                uint32_t nargs, target_ulong args,

                                uint32_t nret, target_ulong rets)

{

    VIOsPAPRBus *bus = spapr->vio_bus;

    VIOsPAPRDevice *dev;

    uint32_t unit, enable;



    if (nargs != 2) {

        rtas_st(rets, 0, -3);

        return;

    }

    unit = rtas_ld(args, 0);

    enable = rtas_ld(args, 1);

    dev = spapr_vio_find_by_reg(bus, unit);

    if (!dev) {

        rtas_st(rets, 0, -3);

        return;

    }

    if (enable) {

        dev->flags |= VIO_PAPR_FLAG_DMA_BYPASS;

    } else {

        dev->flags &= ~VIO_PAPR_FLAG_DMA_BYPASS;

    }



    rtas_st(rets, 0, 0);

}

    if (!dev) {         dev->flags |= VIO_PAPR_FLAG_DMA_BYPASS;         dev->flags &= ~VIO_PAPR_FLAG_DMA_BYPASS;
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)

{

    VIOsPAPRBus *bus = VAR_0->vio_bus;

    VIOsPAPRDevice *dev;

    uint32_t unit, enable;



    if (VAR_2 != 2) {

        rtas_st(VAR_5, 0, -3);

        return;

    }

    unit = rtas_ld(VAR_3, 0);

    enable = rtas_ld(VAR_3, 1);

    dev = spapr_vio_find_by_reg(bus, unit);

    if (!dev) {

        rtas_st(VAR_5, 0, -3);

        return;

    }

    if (enable) {

        dev->flags |= VIO_PAPR_FLAG_DMA_BYPASS;

    } else {

        dev->flags &= ~VIO_PAPR_FLAG_DMA_BYPASS;

    }



    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)
{ VIOsPAPRBus *bus = VAR_0->vio_bus; VIOsPAPRDevice *dev; uint32_t unit, enable; if (VAR_2 != 2) { rtas_st(VAR_5, 0, -3); return; } unit = rtas_ld(VAR_3, 0); enable = rtas_ld(VAR_3, 1); dev = spapr_vio_find_by_reg(bus, unit); if (!dev) { rtas_st(VAR_5, 0, -3); return; } if (enable) { dev->flags |= VIO_PAPR_FLAG_DMA_BYPASS; } else { dev->flags &= ~VIO_PAPR_FLAG_DMA_BYPASS; } rtas_st(VAR_5, 0, 0); }