static void rtas_ibm_read_pci_config(sPAPREnvironment *spapr,

                                     uint32_t token, uint32_t nargs,

                                     target_ulong args,

                                     uint32_t nret, target_ulong rets)

{

    uint64_t buid;

    uint32_t size, addr;



    if ((nargs != 4) || (nret != 2)) {

        rtas_st(rets, 0, -1);

        return;

    }



    buid = ((uint64_t)rtas_ld(args, 1) << 32) | rtas_ld(args, 2);

    size = rtas_ld(args, 3);

    addr = rtas_ld(args, 0);



    finish_read_pci_config(spapr, buid, addr, size, rets);

}

static void rtas_ibm_read_pci_config(sPAPREnvironment *spapr,

                                     uint32_t token, uint32_t nargs,

                                     target_ulong args,

                                     uint32_t nret, target_ulong rets)

{

    uint64_t buid;

    uint32_t size, addr;



    if ((nargs != 4) || (nret != 2)) {

        rtas_st(rets, 0, -1);

        return;

    }



    buid = ((uint64_t)rtas_ld(args, 1) << 32) | rtas_ld(args, 2);

    size = rtas_ld(args, 3);

    addr = rtas_ld(args, 0);



    finish_read_pci_config(spapr, buid, addr, size, rets);

}

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)

{

    uint64_t buid;

    uint32_t size, addr;



    if ((VAR_2 != 4) || (VAR_4 != 2)) {

        rtas_st(VAR_5, 0, -1);

        return;

    }



    buid = ((uint64_t)rtas_ld(VAR_3, 1) << 32) | rtas_ld(VAR_3, 2);

    size = rtas_ld(VAR_3, 3);

    addr = rtas_ld(VAR_3, 0);



    finish_read_pci_config(VAR_0, buid, addr, size, VAR_5);

}

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)
{ uint64_t buid; uint32_t size, addr; if ((VAR_2 != 4) || (VAR_4 != 2)) { rtas_st(VAR_5, 0, -1); return; } buid = ((uint64_t)rtas_ld(VAR_3, 1) << 32) | rtas_ld(VAR_3, 2); size = rtas_ld(VAR_3, 3); addr = rtas_ld(VAR_3, 0); finish_read_pci_config(VAR_0, buid, addr, size, VAR_5); }