Patchwork [3/3] linux-user: Initialize Alpha FPCR register.

login
register
mail settings
Submitter Richard Henderson
Date Dec. 19, 2009, 11:17 p.m.
Message ID <9f33a8f00045c6cf1ba26be71b76ff84fb7e0eac.1261264754.git.rth@twiddle.net>
Download mbox | patch
Permalink /patch/41483/
State New
Headers show

Comments

Richard Henderson - Dec. 19, 2009, 11:17 p.m.
Signed-off-by: Richard Henderson <rth@twiddle.net>
---
 linux-user/main.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
Aurelien Jarno - Dec. 21, 2009, 10:33 a.m.
On Sat, Dec 19, 2009 at 03:17:16PM -0800, Richard Henderson wrote:
> Signed-off-by: Richard Henderson <rth@twiddle.net>
> ---
>  linux-user/main.c |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
> 
> diff --git a/linux-user/main.c b/linux-user/main.c
> index 12502ad..b67662c 100644
> --- a/linux-user/main.c
> +++ b/linux-user/main.c
> @@ -3052,6 +3052,8 @@ int main(int argc, char **argv, char **envp)
>          env->ir[30] = regs->usp;
>          env->pc = regs->pc;
>          env->unique = regs->unique;
> +        cpu_alpha_store_fpcr(env, (FPCR_INVD | FPCR_DZED | FPCR_OVFD
> +                                   | FPCR_UNFD | FPCR_INED | FPCR_DNOD));
>      }

This cpu initialization which does not depends on the binary being run
is usually done in target-*/translate.c, using #if defined
(CONFIG_USER_ONLY).

Patch

diff --git a/linux-user/main.c b/linux-user/main.c
index 12502ad..b67662c 100644
--- a/linux-user/main.c
+++ b/linux-user/main.c
@@ -3052,6 +3052,8 @@  int main(int argc, char **argv, char **envp)
         env->ir[30] = regs->usp;
         env->pc = regs->pc;
         env->unique = regs->unique;
+        cpu_alpha_store_fpcr(env, (FPCR_INVD | FPCR_DZED | FPCR_OVFD
+                                   | FPCR_UNFD | FPCR_INED | FPCR_DNOD));
     }
 #elif defined(TARGET_CRIS)
     {