void cpu_reset(CPUSPARCState *env)

{

    tlb_flush(env, 1);

    env->cwp = 0;

    env->wim = 1;

    env->regwptr = env->regbase + (env->cwp * 16);

#if defined(CONFIG_USER_ONLY)

    env->user_mode_only = 1;

#ifdef TARGET_SPARC64

    env->cleanwin = env->nwindows - 2;

    env->cansave = env->nwindows - 2;

    env->pstate = PS_RMO | PS_PEF | PS_IE;

    env->asi = 0x82; // Primary no-fault

#endif

#else

    env->psret = 0;

    env->psrs = 1;

    env->psrps = 1;

#ifdef TARGET_SPARC64

    env->pstate = PS_PRIV;

    env->hpstate = HS_PRIV;

    env->pc = 0x1fff0000020ULL; // XXX should be different for system_reset

    env->tsptr = &env->ts[env->tl];

#else

    env->pc = 0;

    env->mmuregs[0] &= ~(MMU_E | MMU_NF);

    env->mmuregs[0] |= env->mmu_bm;

#endif

    env->npc = env->pc + 4;

#endif

}

void cpu_reset(CPUSPARCState *env)

{

    tlb_flush(env, 1);

    env->cwp = 0;

    env->wim = 1;

    env->regwptr = env->regbase + (env->cwp * 16);

#if defined(CONFIG_USER_ONLY)

    env->user_mode_only = 1;

#ifdef TARGET_SPARC64

    env->cleanwin = env->nwindows - 2;

    env->cansave = env->nwindows - 2;

    env->pstate = PS_RMO | PS_PEF | PS_IE;

    env->asi = 0x82; 

#endif

#else

    env->psret = 0;

    env->psrs = 1;

    env->psrps = 1;

#ifdef TARGET_SPARC64

    env->pstate = PS_PRIV;

    env->hpstate = HS_PRIV;

    env->pc = 0x1fff0000020ULL; 

    env->tsptr = &env->ts[env->tl];

#else

    env->pc = 0;

    env->mmuregs[0] &= ~(MMU_E | MMU_NF);

    env->mmuregs[0] |= env->mmu_bm;

#endif

    env->npc = env->pc + 4;

#endif

}

void FUNC_0(CPUSPARCState *VAR_0)

{

    tlb_flush(VAR_0, 1);

    VAR_0->cwp = 0;

    VAR_0->wim = 1;

    VAR_0->regwptr = VAR_0->regbase + (VAR_0->cwp * 16);

#if defined(CONFIG_USER_ONLY)

    VAR_0->user_mode_only = 1;

#ifdef TARGET_SPARC64

    VAR_0->cleanwin = VAR_0->nwindows - 2;

    VAR_0->cansave = VAR_0->nwindows - 2;

    VAR_0->pstate = PS_RMO | PS_PEF | PS_IE;

    VAR_0->asi = 0x82; 

#endif

#else

    VAR_0->psret = 0;

    VAR_0->psrs = 1;

    VAR_0->psrps = 1;

#ifdef TARGET_SPARC64

    VAR_0->pstate = PS_PRIV;

    VAR_0->hpstate = HS_PRIV;

    VAR_0->pc = 0x1fff0000020ULL; 

    VAR_0->tsptr = &VAR_0->ts[VAR_0->tl];

#else

    VAR_0->pc = 0;

    VAR_0->mmuregs[0] &= ~(MMU_E | MMU_NF);

    VAR_0->mmuregs[0] |= VAR_0->mmu_bm;

#endif

    VAR_0->npc = VAR_0->pc + 4;

#endif

}

void FUNC_0(CPUSPARCState *VAR_0)
{ tlb_flush(VAR_0, 1); VAR_0->cwp = 0; VAR_0->wim = 1; VAR_0->regwptr = VAR_0->regbase + (VAR_0->cwp * 16); #if defined(CONFIG_USER_ONLY)
VAR_0->user_mode_only = 1; #ifdef TARGET_SPARC64
VAR_0->cleanwin = VAR_0->nwindows - 2; VAR_0->cansave = VAR_0->nwindows - 2; VAR_0->pstate = PS_RMO | PS_PEF | PS_IE; VAR_0->asi = 0x82; #endif
#else
VAR_0->psret = 0; VAR_0->psrs = 1; VAR_0->psrps = 1; #ifdef TARGET_SPARC64
VAR_0->pstate = PS_PRIV; VAR_0->hpstate = HS_PRIV; VAR_0->pc = 0x1fff0000020ULL; VAR_0->tsptr = &VAR_0->ts[VAR_0->tl]; #else
VAR_0->pc = 0; VAR_0->mmuregs[0] &= ~(MMU_E | MMU_NF); VAR_0->mmuregs[0] |= VAR_0->mmu_bm; #endif
VAR_0->npc = VAR_0->pc + 4; #endif
}