summaryrefslogtreecommitdiff
path: root/target/i386/tcg/misc_helper.c
diff options
context:
space:
mode:
authorClaudio Fontana <cfontana@suse.de>2020-12-12 16:55:15 +0100
committerEduardo Habkost <ehabkost@redhat.com>2020-12-16 15:50:33 -0500
commit69483f3115102638f7bb139cfa240938de854192 (patch)
tree5a5d235e1d837996fb30905536c82ba4f15cd478 /target/i386/tcg/misc_helper.c
parented69e8314d403d1bfa8c0210f850ffe69bb89dbe (diff)
downloadqemu-69483f3115102638f7bb139cfa240938de854192.zip
i386: tcg: remove inline from cpu_load_eflags
make it a regular function. Suggested-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Claudio Fontana <cfontana@suse.de> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20201212155530.23098-9-cfontana@suse.de> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Diffstat (limited to 'target/i386/tcg/misc_helper.c')
-rw-r--r--target/i386/tcg/misc_helper.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/target/i386/tcg/misc_helper.c b/target/i386/tcg/misc_helper.c
index c99370e5e3..0bd6c95749 100644
--- a/target/i386/tcg/misc_helper.c
+++ b/target/i386/tcg/misc_helper.c
@@ -26,6 +26,19 @@
#include "exec/address-spaces.h"
#include "helper-tcg.h"
+/*
+ * NOTE: the translator must set DisasContext.cc_op to CC_OP_EFLAGS
+ * after generating a call to a helper that uses this.
+ */
+void cpu_load_eflags(CPUX86State *env, int eflags, int update_mask)
+{
+ CC_SRC = eflags & (CC_O | CC_S | CC_Z | CC_A | CC_P | CC_C);
+ CC_OP = CC_OP_EFLAGS;
+ env->df = 1 - (2 * ((eflags >> 10) & 1));
+ env->eflags = (env->eflags & ~update_mask) |
+ (eflags & update_mask) | 0x2;
+}
+
void helper_outb(CPUX86State *env, uint32_t port, uint32_t data)
{
#ifdef CONFIG_USER_ONLY