static void rtas_write_pci_config(sPAPREnvironment *spapr,

                                  uint32_t token, uint32_t nargs,

                                  target_ulong args,

                                  uint32_t nret, target_ulong rets)

{

    uint32_t val, size, addr;

    PCIDevice *dev = find_dev(spapr, 0, rtas_ld(args, 0));



    if (!dev) {

        rtas_st(rets, 0, -1);

        return;

    }

    val = rtas_ld(args, 2);

    size = rtas_ld(args, 1);

    addr = rtas_pci_cfgaddr(rtas_ld(args, 0));

    pci_default_write_config(dev, addr, val, size);

    rtas_st(rets, 0, 0);

}

static void rtas_write_pci_config(sPAPREnvironment *spapr,

                                  uint32_t token, uint32_t nargs,

                                  target_ulong args,

                                  uint32_t nret, target_ulong rets)

{

    uint32_t val, size, addr;

    PCIDevice *dev = find_dev(spapr, 0, rtas_ld(args, 0));



    if (!dev) {

        rtas_st(rets, 0, -1);

        return;

    }

    val = rtas_ld(args, 2);

    size = rtas_ld(args, 1);

    addr = rtas_pci_cfgaddr(rtas_ld(args, 0));

    pci_default_write_config(dev, addr, val, size);

    rtas_st(rets, 0, 0);

}

    pci_default_write_config(dev, addr, val, size);     pci_default_write_config(dev, addr, val, size);
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)

{

    uint32_t val, size, addr;

    PCIDevice *dev = find_dev(VAR_0, 0, rtas_ld(VAR_3, 0));



    if (!dev) {

        rtas_st(VAR_5, 0, -1);

        return;

    }

    val = rtas_ld(VAR_3, 2);

    size = rtas_ld(VAR_3, 1);

    addr = rtas_pci_cfgaddr(rtas_ld(VAR_3, 0));

    pci_default_write_config(dev, addr, val, size);

    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)
{ uint32_t val, size, addr; PCIDevice *dev = find_dev(VAR_0, 0, rtas_ld(VAR_3, 0)); if (!dev) { rtas_st(VAR_5, 0, -1); return; } val = rtas_ld(VAR_3, 2); size = rtas_ld(VAR_3, 1); addr = rtas_pci_cfgaddr(rtas_ld(VAR_3, 0)); pci_default_write_config(dev, addr, val, size); rtas_st(VAR_5, 0, 0); }