[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [V3 PATCH 5/9] target-ppc: Add is_user_mode Utility Routine
From: |
Tom Musta |
Subject: |
[Qemu-devel] [V3 PATCH 5/9] target-ppc: Add is_user_mode Utility Routine |
Date: |
Mon, 10 Feb 2014 11:26:57 -0600 |
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: Tom Musta <address@hidden>
---
target-ppc/translate.c | 14 ++++++++++++++
1 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/target-ppc/translate.c b/target-ppc/translate.c
index b89b4ba..6ec4127 100644
--- a/target-ppc/translate.c
+++ b/target-ppc/translate.c
@@ -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)
--
1.7.1
- [Qemu-devel] [V3 PATCH 0/9] target-ppc: Base ISA V2.07 for Power8, Tom Musta, 2014/02/10
- [Qemu-devel] [V3 PATCH 2/9] target-ppc: Add Target Address SPR (TAR) to Power8, Tom Musta, 2014/02/10
- [Qemu-devel] [V3 PATCH 3/9] target-ppc: Add bctar Instruction, Tom Musta, 2014/02/10
- [Qemu-devel] [V3 PATCH 1/9] target-ppc: Add Flag for bctar, Tom Musta, 2014/02/10
- [Qemu-devel] [V3 PATCH 4/9] target-ppc: Add Flag for ISA 2.07 Load/Store Quadword Instructions, Tom Musta, 2014/02/10
- [Qemu-devel] [V3 PATCH 7/9] target-ppc: Store Quadword, Tom Musta, 2014/02/10
- [Qemu-devel] [V3 PATCH 8/9] target-ppc: Add Load Quadword and Reserve, Tom Musta, 2014/02/10
- [Qemu-devel] [V3 PATCH 5/9] target-ppc: Add is_user_mode Utility Routine,
Tom Musta <=
- [Qemu-devel] [V3 PATCH 6/9] target-ppc: Load Quadword, Tom Musta, 2014/02/10
- [Qemu-devel] [V3 PATCH 9/9] target-ppc: Add Store Quadword Conditional, Tom Musta, 2014/02/10
- Re: [Qemu-devel] [Qemu-ppc] [V3 PATCH 0/9] target-ppc: Base ISA V2.07 for Power8, Alexander Graf, 2014/02/20