diff options
author | Blue Swirl <blauwirbel@gmail.com> | 2012-09-02 07:33:36 +0000 |
---|---|---|
committer | Alexander Graf <agraf@suse.de> | 2012-09-10 13:38:32 +0200 |
commit | 449c0d70b6d5692bafd8b028e2a8a4e0ed7076fe (patch) | |
tree | 65a172cf5d2753840a02cca2198b3e75a4c7941a /target-s390x/mem_helper.c | |
parent | aea1e885b2b59cf93d0db9356fd5bb6cb1780f01 (diff) |
target-s390x: avoid AREG0 for FPU helpers
Make FPU helpers take a parameter for CPUState instead
of relying on global env.
Introduce temporary wrappers for FPU load and store ops.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'target-s390x/mem_helper.c')
-rw-r--r-- | target-s390x/mem_helper.c | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/target-s390x/mem_helper.c b/target-s390x/mem_helper.c index ba05e65cd8..3f8b3bab77 100644 --- a/target-s390x/mem_helper.c +++ b/target-s390x/mem_helper.c @@ -1188,3 +1188,52 @@ uint32_t HELPER(lra)(uint64_t addr, uint32_t r1) } #endif + +/* temporary wrappers */ +#if defined(CONFIG_USER_ONLY) +#define ldub_data(addr) ldub_raw(addr) +#define lduw_data(addr) lduw_raw(addr) +#define ldl_data(addr) ldl_raw(addr) +#define ldq_data(addr) ldq_raw(addr) + +#define stb_data(addr, data) stb_raw(addr, data) +#define stw_data(addr, data) stw_raw(addr, data) +#define stl_data(addr, data) stl_raw(addr, data) +#define stq_data(addr, data) stq_raw(addr, data) +#endif + +#define WRAP_LD(rettype, fn) \ + rettype cpu_ ## fn(CPUS390XState *env1, target_ulong addr) \ + { \ + CPUS390XState *saved_env; \ + rettype ret; \ + \ + saved_env = env; \ + env = env1; \ + ret = fn(addr); \ + env = saved_env; \ + return ret; \ + } + +WRAP_LD(uint32_t, ldub_data) +WRAP_LD(uint32_t, lduw_data) +WRAP_LD(uint32_t, ldl_data) +WRAP_LD(uint64_t, ldq_data) +#undef WRAP_LD + +#define WRAP_ST(datatype, fn) \ + void cpu_ ## fn(CPUS390XState *env1, target_ulong addr, datatype val) \ + { \ + CPUS390XState *saved_env; \ + \ + saved_env = env; \ + env = env1; \ + fn(addr, val); \ + env = saved_env; \ + } + +WRAP_ST(uint32_t, stb_data) +WRAP_ST(uint32_t, stw_data) +WRAP_ST(uint32_t, stl_data) +WRAP_ST(uint64_t, stq_data) +#undef WRAP_ST |