summaryrefslogtreecommitdiffstats
path: root/target-i386/mem_helper.c
diff options
context:
space:
mode:
authorAnthony Liguori2012-08-14 22:19:50 +0200
committerAnthony Liguori2012-08-14 22:19:50 +0200
commit03834e22abafbc8dc4052d46a5ccd6dd135a54a3 (patch)
tree5fd0788233c9a54ff9935c65f35a4047493aa80a /target-i386/mem_helper.c
parentMerge remote-tracking branch 'kraxel/seabios-5a02306' into staging (diff)
parentMerge branch 'linux-user.next' of git://git.linaro.org/people/pmaydell/qemu-arm (diff)
downloadqemu-03834e22abafbc8dc4052d46a5ccd6dd135a54a3.tar.gz
qemu-03834e22abafbc8dc4052d46a5ccd6dd135a54a3.tar.xz
qemu-03834e22abafbc8dc4052d46a5ccd6dd135a54a3.zip
Merge remote-tracking branch 'origin/master' into staging
* origin/master: linux-user: ARM: Ignore immediate value for svc in thumb mode linux-user: Use init_guest_space when -R and -B are specified linux-user: Factor out guest space probing into a function flatload: fix bss clearing linux-user: make host_to_target_cmsg support SO_TIMESTAMP cmsg_type linux-user: make do_setsockopt support SOL_RAW ICMP_FILTER socket option linux-user: pass sockaddr from host to target x86: switch to AREG0 free mode x86: avoid AREG0 in segmentation helpers x86: avoid AREG0 for misc helpers x86: use wrappers for memory access helpers x86: avoid AREG0 for SMM helpers x86: avoid AREG0 for SVM helpers x86: avoid AREG0 for integer helpers x86: avoid AREG0 for condition code helpers x86: avoid AREG0 for FPU helpers linux-user: Move target_to_host_errno_table[] setup out of ioctl loop linux-user: Fix SNDCTL_DSP_MAP{IN, OUT}BUF ioctl definitions linux-user: Fix incorrect TARGET_BLKBSZGET, TARGET_BLKBSZSET
Diffstat (limited to 'target-i386/mem_helper.c')
-rw-r--r--target-i386/mem_helper.c46
1 files changed, 20 insertions, 26 deletions
diff --git a/target-i386/mem_helper.c b/target-i386/mem_helper.c
index 91353c0788..7f99c7cfe3 100644
--- a/target-i386/mem_helper.c
+++ b/target-i386/mem_helper.c
@@ -18,7 +18,6 @@
*/
#include "cpu.h"
-#include "dyngen-exec.h"
#include "helper.h"
#if !defined(CONFIG_USER_ONLY)
@@ -39,19 +38,19 @@ void helper_unlock(void)
spin_unlock(&global_cpu_lock);
}
-void helper_cmpxchg8b(target_ulong a0)
+void helper_cmpxchg8b(CPUX86State *env, target_ulong a0)
{
uint64_t d;
int eflags;
- eflags = helper_cc_compute_all(CC_OP);
- d = ldq(a0);
+ eflags = cpu_cc_compute_all(env, CC_OP);
+ d = cpu_ldq_data(env, a0);
if (d == (((uint64_t)EDX << 32) | (uint32_t)EAX)) {
- stq(a0, ((uint64_t)ECX << 32) | (uint32_t)EBX);
+ cpu_stq_data(env, a0, ((uint64_t)ECX << 32) | (uint32_t)EBX);
eflags |= CC_Z;
} else {
/* always do the store */
- stq(a0, d);
+ cpu_stq_data(env, a0, d);
EDX = (uint32_t)(d >> 32);
EAX = (uint32_t)d;
eflags &= ~CC_Z;
@@ -60,7 +59,7 @@ void helper_cmpxchg8b(target_ulong a0)
}
#ifdef TARGET_X86_64
-void helper_cmpxchg16b(target_ulong a0)
+void helper_cmpxchg16b(CPUX86State *env, target_ulong a0)
{
uint64_t d0, d1;
int eflags;
@@ -68,17 +67,17 @@ void helper_cmpxchg16b(target_ulong a0)
if ((a0 & 0xf) != 0) {
raise_exception(env, EXCP0D_GPF);
}
- eflags = helper_cc_compute_all(CC_OP);
- d0 = ldq(a0);
- d1 = ldq(a0 + 8);
+ eflags = cpu_cc_compute_all(env, CC_OP);
+ d0 = cpu_ldq_data(env, a0);
+ d1 = cpu_ldq_data(env, a0 + 8);
if (d0 == EAX && d1 == EDX) {
- stq(a0, EBX);
- stq(a0 + 8, ECX);
+ cpu_stq_data(env, a0, EBX);
+ cpu_stq_data(env, a0 + 8, ECX);
eflags |= CC_Z;
} else {
/* always do the store */
- stq(a0, d0);
- stq(a0 + 8, d1);
+ cpu_stq_data(env, a0, d0);
+ cpu_stq_data(env, a0 + 8, d1);
EDX = d1;
EAX = d0;
eflags &= ~CC_Z;
@@ -87,24 +86,24 @@ void helper_cmpxchg16b(target_ulong a0)
}
#endif
-void helper_boundw(target_ulong a0, int v)
+void helper_boundw(CPUX86State *env, target_ulong a0, int v)
{
int low, high;
- low = ldsw(a0);
- high = ldsw(a0 + 2);
+ low = cpu_ldsw_data(env, a0);
+ high = cpu_ldsw_data(env, a0 + 2);
v = (int16_t)v;
if (v < low || v > high) {
raise_exception(env, EXCP05_BOUND);
}
}
-void helper_boundl(target_ulong a0, int v)
+void helper_boundl(CPUX86State *env, target_ulong a0, int v)
{
int low, high;
- low = ldl(a0);
- high = ldl(a0 + 4);
+ low = cpu_ldl_data(env, a0);
+ high = cpu_ldl_data(env, a0 + 4);
if (v < low || v > high) {
raise_exception(env, EXCP05_BOUND);
}
@@ -133,15 +132,11 @@ void helper_boundl(target_ulong a0, int v)
NULL, it means that the function was called in C code (i.e. not
from generated code or from helper.c) */
/* XXX: fix it to restore all registers */
-void tlb_fill(CPUX86State *env1, target_ulong addr, int is_write, int mmu_idx,
+void tlb_fill(CPUX86State *env, target_ulong addr, int is_write, int mmu_idx,
uintptr_t retaddr)
{
TranslationBlock *tb;
int ret;
- CPUX86State *saved_env;
-
- saved_env = env;
- env = env1;
ret = cpu_x86_handle_mmu_fault(env, addr, is_write, mmu_idx);
if (ret) {
@@ -156,6 +151,5 @@ void tlb_fill(CPUX86State *env1, target_ulong addr, int is_write, int mmu_idx,
}
raise_exception_err(env, env->exception_index, env->error_code);
}
- env = saved_env;
}
#endif