提交 71a8c019 编写于 作者: T Tom Musta 提交者: Alexander Graf

target-ppc: Add is_user_mode Utility Routine

This patch adds a boolean function is_user_mode that can be re-used
in translation code that is sensitive to the MSR[PR] (user-mode)
state.
Signed-off-by: NTom Musta <tommusta@gmail.com>
Signed-off-by: NAlexander Graf <agraf@suse.de>
上级 38a85337
......@@ -622,6 +622,20 @@ static opc_handler_t invalid_handler = {
.handler = gen_invalid,
};
#if defined(TARGET_PPC64)
/* NOTE: as this time, the only use of is_user_mode() is in 64 bit code. And */
/* so the function is wrapped in the standard 64-bit ifdef in order to */
/* avoid compiler warnings in 32-bit implementations. */
static bool is_user_mode(DisasContext *ctx)
{
#if defined(CONFIG_USER_ONLY)
return true;
#else
return ctx->mem_idx == 0;
#endif
}
#endif
/*** Integer comparison ***/
static inline void gen_op_cmp(TCGv arg0, TCGv arg1, int s, int crf)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册