static void ppc_hash64_set_dsi(CPUState *cs, CPUPPCState *env, uint64_t dar,

                               uint64_t dsisr)

{

    bool vpm;



    if (msr_dr) {

        vpm = !!(env->spr[SPR_LPCR] & LPCR_VPM1);

    } else {

        vpm = !!(env->spr[SPR_LPCR] & LPCR_VPM0);

    }

    if (vpm && !msr_hv) {

        cs->exception_index = POWERPC_EXCP_HDSI;

        env->spr[SPR_HDAR] = dar;

        env->spr[SPR_HDSISR] = dsisr;

    } else {

        cs->exception_index = POWERPC_EXCP_DSI;

        env->spr[SPR_DAR] = dar;

        env->spr[SPR_DSISR] = dsisr;

   }

    env->error_code = 0;

}

static void ppc_hash64_set_dsi(CPUState *cs, CPUPPCState *env, uint64_t dar,

                               uint64_t dsisr)

{

    bool vpm;



    if (msr_dr) {

        vpm = !!(env->spr[SPR_LPCR] & LPCR_VPM1);

    } else {

        vpm = !!(env->spr[SPR_LPCR] & LPCR_VPM0);

    }

    if (vpm && !msr_hv) {

        cs->exception_index = POWERPC_EXCP_HDSI;

        env->spr[SPR_HDAR] = dar;

        env->spr[SPR_HDSISR] = dsisr;

    } else {

        cs->exception_index = POWERPC_EXCP_DSI;

        env->spr[SPR_DAR] = dar;

        env->spr[SPR_DSISR] = dsisr;

   }

    env->error_code = 0;

}

static void FUNC_0(CPUState *VAR_0, CPUPPCState *VAR_1, uint64_t VAR_2,

                               uint64_t VAR_3)

{

    bool vpm;



    if (msr_dr) {

        vpm = !!(VAR_1->spr[SPR_LPCR] & LPCR_VPM1);

    } else {

        vpm = !!(VAR_1->spr[SPR_LPCR] & LPCR_VPM0);

    }

    if (vpm && !msr_hv) {

        VAR_0->exception_index = POWERPC_EXCP_HDSI;

        VAR_1->spr[SPR_HDAR] = VAR_2;

        VAR_1->spr[SPR_HDSISR] = VAR_3;

    } else {

        VAR_0->exception_index = POWERPC_EXCP_DSI;

        VAR_1->spr[SPR_DAR] = VAR_2;

        VAR_1->spr[SPR_DSISR] = VAR_3;

   }

    VAR_1->error_code = 0;

}

static void FUNC_0(CPUState *VAR_0, CPUPPCState *VAR_1, uint64_t VAR_2,
uint64_t VAR_3)
{ bool vpm; if (msr_dr) { vpm = !!(VAR_1->spr[SPR_LPCR] & LPCR_VPM1); } else { vpm = !!(VAR_1->spr[SPR_LPCR] & LPCR_VPM0); } if (vpm && !msr_hv) { VAR_0->exception_index = POWERPC_EXCP_HDSI; VAR_1->spr[SPR_HDAR] = VAR_2; VAR_1->spr[SPR_HDSISR] = VAR_3; } else { VAR_0->exception_index = POWERPC_EXCP_DSI; VAR_1->spr[SPR_DAR] = VAR_2; VAR_1->spr[SPR_DSISR] = VAR_3; } VAR_1->error_code = 0; }