int kvmppc_get_hypercall(CPUPPCState *env, uint8_t *buf, int buf_len)

{

    uint32_t *hc = (uint32_t*)buf;

    struct kvm_ppc_pvinfo pvinfo;



    if (!kvmppc_get_pvinfo(env, &pvinfo)) {

        memcpy(buf, pvinfo.hcall, buf_len);

        return 0;

    }



    /*

     * Fallback to always fail hypercalls regardless of endianness:

     *

     *     tdi 0,r0,72 (becomes b .+8 in wrong endian, nop in good endian)

     *     li r3, -1

     *     b .+8       (becomes nop in wrong endian)

     *     bswap32(li r3, -1)

     */



    hc[0] = cpu_to_be32(0x08000048);

    hc[1] = cpu_to_be32(0x3860ffff);

    hc[2] = cpu_to_be32(0x48000008);

    hc[3] = cpu_to_be32(bswap32(0x3860ffff));



    return 0;

}

int kvmppc_get_hypercall(CPUPPCState *env, uint8_t *buf, int buf_len)

{

    uint32_t *hc = (uint32_t*)buf;

    struct kvm_ppc_pvinfo pvinfo;



    if (!kvmppc_get_pvinfo(env, &pvinfo)) {

        memcpy(buf, pvinfo.hcall, buf_len);

        return 0;

    }



    

















    hc[0] = cpu_to_be32(0x08000048);

    hc[1] = cpu_to_be32(0x3860ffff);

    hc[2] = cpu_to_be32(0x48000008);

    hc[3] = cpu_to_be32(bswap32(0x3860ffff));



    return 0;

}

    return 0;
int FUNC_0(CPUPPCState *VAR_0, uint8_t *VAR_1, int VAR_2)

{

    uint32_t *hc = (uint32_t*)VAR_1;

    struct kvm_ppc_pvinfo VAR_3;



    if (!kvmppc_get_pvinfo(VAR_0, &VAR_3)) {

        memcpy(VAR_1, VAR_3.hcall, VAR_2);

        return 0;

    }



    

















    hc[0] = cpu_to_be32(0x08000048);

    hc[1] = cpu_to_be32(0x3860ffff);

    hc[2] = cpu_to_be32(0x48000008);

    hc[3] = cpu_to_be32(bswap32(0x3860ffff));



    return 0;

}

int FUNC_0(CPUPPCState *VAR_0, uint8_t *VAR_1, int VAR_2)
{ uint32_t *hc = (uint32_t*)VAR_1; struct kvm_ppc_pvinfo VAR_3; if (!kvmppc_get_pvinfo(VAR_0, &VAR_3)) { memcpy(VAR_1, VAR_3.hcall, VAR_2); return 0; } hc[0] = cpu_to_be32(0x08000048); hc[1] = cpu_to_be32(0x3860ffff); hc[2] = cpu_to_be32(0x48000008); hc[3] = cpu_to_be32(bswap32(0x3860ffff)); return 0; }