summaryrefslogtreecommitdiff
path: root/target-alpha/op_helper.c
diff options
context:
space:
mode:
authorRichard Henderson <rth@twiddle.net>2009-12-09 15:56:29 -0800
committerAurelien Jarno <aurelien@aurel32.net>2009-12-13 20:32:36 +0100
commitba0e276db4b51bd2255a5d5ff8902c70d32ade40 (patch)
tree7366b9dcf6b064f59e4879bc517906c3af5fbdb2 /target-alpha/op_helper.c
parent990b3e19013ebd36b3fb9af97aaa67f7bc490c15 (diff)
target-alpha: Fixes for alpha-linux syscalls.
1. Add correct definitions of error numbers. 2. Implement SYS_osf_sigprocmask 3. Implement SYS_osf_get/setsysinfo for IEEE_FP_CONTROL. This last requires exposing the FPCR value to do_syscall. Since this value is actually split up into the float_status, expose routines from helper.c to access it. Finally, also add a float_exception_mask field to float_status. We don't actually use it to control delivery of exceptions to the emulator yet, but simply hold the value that we placed there when loading/storing the FPCR. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Diffstat (limited to 'target-alpha/op_helper.c')
-rw-r--r--target-alpha/op_helper.c41
1 files changed, 2 insertions, 39 deletions
diff --git a/target-alpha/op_helper.c b/target-alpha/op_helper.c
index 508272c85d..999a8ab46c 100644
--- a/target-alpha/op_helper.c
+++ b/target-alpha/op_helper.c
@@ -39,49 +39,12 @@ uint64_t helper_load_pcc (void)
uint64_t helper_load_fpcr (void)
{
- uint64_t ret = 0;
-#ifdef CONFIG_SOFTFLOAT
- ret |= env->fp_status.float_exception_flags << 52;
- if (env->fp_status.float_exception_flags)
- ret |= 1ULL << 63;
- env->ipr[IPR_EXC_SUM] &= ~0x3E:
- env->ipr[IPR_EXC_SUM] |= env->fp_status.float_exception_flags << 1;
-#endif
- switch (env->fp_status.float_rounding_mode) {
- case float_round_nearest_even:
- ret |= 2ULL << 58;
- break;
- case float_round_down:
- ret |= 1ULL << 58;
- break;
- case float_round_up:
- ret |= 3ULL << 58;
- break;
- case float_round_to_zero:
- break;
- }
- return ret;
+ return cpu_alpha_load_fpcr (env);
}
void helper_store_fpcr (uint64_t val)
{
-#ifdef CONFIG_SOFTFLOAT
- set_float_exception_flags((val >> 52) & 0x3F, &FP_STATUS);
-#endif
- switch ((val >> 58) & 3) {
- case 0:
- set_float_rounding_mode(float_round_to_zero, &FP_STATUS);
- break;
- case 1:
- set_float_rounding_mode(float_round_down, &FP_STATUS);
- break;
- case 2:
- set_float_rounding_mode(float_round_nearest_even, &FP_STATUS);
- break;
- case 3:
- set_float_rounding_mode(float_round_up, &FP_STATUS);
- break;
- }
+ cpu_alpha_store_fpcr (env, val);
}
static spinlock_t intr_cpu_lock = SPIN_LOCK_UNLOCKED;