On 9/16/22 08:00, Richard Henderson wrote:
Or, keep the field, because it's usage will be more self-documentary, but copy the value from ctx->mmu_idx and add a comment.

Or, add an inline function like

static inline int priv_level(DisasContext *ctx)
{
#ifdef CONFIG_USER_ONLY
    return PRV_U;
#else
    /* Priv level equals mmu index -- see cpu_mmu_index. */
    return ctx->mmu_idx;
#endif
}

so that usages within a user-only build are compile-time constant and folded 
away.


r~

Reply via email to