diff options
author | Laurent Vivier <laurent@vivier.eu> | 2017-02-25 12:05:16 +0100 |
---|---|---|
committer | Laurent Vivier <laurent@vivier.eu> | 2017-02-27 23:10:02 +0100 |
commit | 3219de458c497e15fd3b0c3ba3c1952fc34fe3da (patch) | |
tree | 5ff8c7f3a97bb1f710d4a91c313b63e0b8c8c769 /linux-user | |
parent | 1c1df0198b30e180bd63891727fa1c3e0c96eb8e (diff) |
linux-user: correctly manage SR in ucontext
Use cpu_m68k_get_ccr()/cpu_m68k_set_ccr() to setup and restore correctly
the value of SR in the ucontext structure
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20170225110517.2832-2-laurent@vivier.eu>
Diffstat (limited to 'linux-user')
-rw-r--r-- | linux-user/signal.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/linux-user/signal.c b/linux-user/signal.c index 5dae87e3f4..99adfc29e4 100644 --- a/linux-user/signal.c +++ b/linux-user/signal.c @@ -5676,6 +5676,7 @@ static inline int target_rt_setup_ucontext(struct target_ucontext *uc, CPUM68KState *env) { target_greg_t *gregs = uc->tuc_mcontext.gregs; + uint32_t sr = cpu_m68k_get_ccr(env); __put_user(TARGET_MCONTEXT_VERSION, &uc->tuc_mcontext.version); __put_user(env->dregs[0], &gregs[0]); @@ -5695,7 +5696,7 @@ static inline int target_rt_setup_ucontext(struct target_ucontext *uc, __put_user(env->aregs[6], &gregs[14]); __put_user(env->aregs[7], &gregs[15]); __put_user(env->pc, &gregs[16]); - __put_user(env->sr, &gregs[17]); + __put_user(sr, &gregs[17]); return 0; } @@ -5729,7 +5730,7 @@ static inline int target_rt_restore_ucontext(CPUM68KState *env, __get_user(env->aregs[7], &gregs[15]); __get_user(env->pc, &gregs[16]); __get_user(temp, &gregs[17]); - env->sr = (env->sr & 0xff00) | (temp & 0xff); + cpu_m68k_set_ccr(env, temp); return 0; |