static int kvm_get_debugregs(CPUState *env)

{

#ifdef KVM_CAP_DEBUGREGS

    struct kvm_debugregs dbgregs;

    int i, ret;



    if (!kvm_has_debugregs()) {

        return 0;

    }



    ret = kvm_vcpu_ioctl(env, KVM_GET_DEBUGREGS, &dbgregs);

    if (ret < 0) {

       return ret;

    }

    for (i = 0; i < 4; i++) {

        env->dr[i] = dbgregs.db[i];

    }

    env->dr[4] = env->dr[6] = dbgregs.dr6;

    env->dr[5] = env->dr[7] = dbgregs.dr7;

#endif



    return 0;

}

static int kvm_get_debugregs(CPUState *env)

{

#ifdef KVM_CAP_DEBUGREGS

    struct kvm_debugregs dbgregs;

    int i, ret;



    if (!kvm_has_debugregs()) {

        return 0;

    }



    ret = kvm_vcpu_ioctl(env, KVM_GET_DEBUGREGS, &dbgregs);

    if (ret < 0) {

       return ret;

    }

    for (i = 0; i < 4; i++) {

        env->dr[i] = dbgregs.db[i];

    }

    env->dr[4] = env->dr[6] = dbgregs.dr6;

    env->dr[5] = env->dr[7] = dbgregs.dr7;

#endif



    return 0;

}

static int FUNC_0(CPUState *VAR_0)

{

#ifdef KVM_CAP_DEBUGREGS

    struct kvm_debugregs dbgregs;

    int i, ret;



    if (!kvm_has_debugregs()) {

        return 0;

    }



    ret = kvm_vcpu_ioctl(VAR_0, KVM_GET_DEBUGREGS, &dbgregs);

    if (ret < 0) {

       return ret;

    }

    for (i = 0; i < 4; i++) {

        VAR_0->dr[i] = dbgregs.db[i];

    }

    VAR_0->dr[4] = VAR_0->dr[6] = dbgregs.dr6;

    VAR_0->dr[5] = VAR_0->dr[7] = dbgregs.dr7;

#endif



    return 0;

}

static int FUNC_0(CPUState *VAR_0)
{ #ifdef KVM_CAP_DEBUGREGS
struct kvm_debugregs dbgregs; int i, ret; if (!kvm_has_debugregs()) { return 0; } ret = kvm_vcpu_ioctl(VAR_0, KVM_GET_DEBUGREGS, &dbgregs); if (ret < 0) { return ret; } for (i = 0; i < 4; i++) { VAR_0->dr[i] = dbgregs.db[i]; } VAR_0->dr[4] = VAR_0->dr[6] = dbgregs.dr6; VAR_0->dr[5] = VAR_0->dr[7] = dbgregs.dr7; #endif
return 0; }