int kvm_arch_handle_exit(CPUPPCState *env, struct kvm_run *run)

{

    int ret;



    switch (run->exit_reason) {

    case KVM_EXIT_DCR:

        if (run->dcr.is_write) {

            dprintf("handle dcr write\n");

            ret = kvmppc_handle_dcr_write(env, run->dcr.dcrn, run->dcr.data);

        } else {

            dprintf("handle dcr read\n");

            ret = kvmppc_handle_dcr_read(env, run->dcr.dcrn, &run->dcr.data);

        }

        break;

    case KVM_EXIT_HLT:

        dprintf("handle halt\n");

        ret = kvmppc_handle_halt(env);

        break;

#ifdef CONFIG_PSERIES

    case KVM_EXIT_PAPR_HCALL:

        dprintf("handle PAPR hypercall\n");

        run->papr_hcall.ret = spapr_hypercall(env, run->papr_hcall.nr,

                                              run->papr_hcall.args);

        ret = 1;

        break;

#endif

    default:

        fprintf(stderr, "KVM: unknown exit reason %d\n", run->exit_reason);

        ret = -1;

        break;

    }



    return ret;

}

int kvm_arch_handle_exit(CPUPPCState *env, struct kvm_run *run)

{

    int ret;



    switch (run->exit_reason) {

    case KVM_EXIT_DCR:

        if (run->dcr.is_write) {

            dprintf("handle dcr write\n");

            ret = kvmppc_handle_dcr_write(env, run->dcr.dcrn, run->dcr.data);

        } else {

            dprintf("handle dcr read\n");

            ret = kvmppc_handle_dcr_read(env, run->dcr.dcrn, &run->dcr.data);

        }

        break;

    case KVM_EXIT_HLT:

        dprintf("handle halt\n");

        ret = kvmppc_handle_halt(env);

        break;

#ifdef CONFIG_PSERIES

    case KVM_EXIT_PAPR_HCALL:

        dprintf("handle PAPR hypercall\n");

        run->papr_hcall.ret = spapr_hypercall(env, run->papr_hcall.nr,

                                              run->papr_hcall.args);

        ret = 1;

        break;

#endif

    default:

        fprintf(stderr, "KVM: unknown exit reason %d\n", run->exit_reason);

        ret = -1;

        break;

    }



    return ret;

}

        ret = 1;
int FUNC_0(CPUPPCState *VAR_0, struct kvm_run *VAR_1)

{

    int VAR_2;



    switch (VAR_1->exit_reason) {

    case KVM_EXIT_DCR:

        if (VAR_1->dcr.is_write) {

            dprintf("handle dcr write\n");

            VAR_2 = kvmppc_handle_dcr_write(VAR_0, VAR_1->dcr.dcrn, VAR_1->dcr.data);

        } else {

            dprintf("handle dcr read\n");

            VAR_2 = kvmppc_handle_dcr_read(VAR_0, VAR_1->dcr.dcrn, &VAR_1->dcr.data);

        }

        break;

    case KVM_EXIT_HLT:

        dprintf("handle halt\n");

        VAR_2 = kvmppc_handle_halt(VAR_0);

        break;

#ifdef CONFIG_PSERIES

    case KVM_EXIT_PAPR_HCALL:

        dprintf("handle PAPR hypercall\n");

        VAR_1->papr_hcall.VAR_2 = spapr_hypercall(VAR_0, VAR_1->papr_hcall.nr,

                                              VAR_1->papr_hcall.args);

        VAR_2 = 1;

        break;

#endif

    default:

        fprintf(stderr, "KVM: unknown exit reason %d\n", VAR_1->exit_reason);

        VAR_2 = -1;

        break;

    }



    return VAR_2;

}

int FUNC_0(CPUPPCState *VAR_0, struct kvm_run *VAR_1)
{ int VAR_2; switch (VAR_1->exit_reason) { case KVM_EXIT_DCR:
if (VAR_1->dcr.is_write) { dprintf("handle dcr write\n"); VAR_2 = kvmppc_handle_dcr_write(VAR_0, VAR_1->dcr.dcrn, VAR_1->dcr.data); } else { dprintf("handle dcr read\n"); VAR_2 = kvmppc_handle_dcr_read(VAR_0, VAR_1->dcr.dcrn, &VAR_1->dcr.data); } break; case KVM_EXIT_HLT:
dprintf("handle halt\n"); VAR_2 = kvmppc_handle_halt(VAR_0); break; #ifdef CONFIG_PSERIES
case KVM_EXIT_PAPR_HCALL:
dprintf("handle PAPR hypercall\n"); VAR_1->papr_hcall.VAR_2 = spapr_hypercall(VAR_0, VAR_1->papr_hcall.nr,
VAR_1->papr_hcall.args); VAR_2 = 1; break; #endif
default:
fprintf(stderr, "KVM: unknown exit reason %d\n", VAR_1->exit_reason); VAR_2 = -1; break; } return VAR_2; }