alpha-linux-user: Fix a3 error return with v0 error bypass.

We were failing to initialize a3 for syscalls that bypass the
negative return value error check.

Signed-off-by: Richard Henderson <rth@twiddle.net>
This commit is contained in:
Richard Henderson 2012-06-07 14:47:41 -07:00
parent e7ea6cbefd
commit 0e141977e6

View file

@ -2846,13 +2846,11 @@ void cpu_loop(CPUAlphaState *env)
break; break;
} }
/* Syscall writes 0 to V0 to bypass error check, similar /* Syscall writes 0 to V0 to bypass error check, similar
to how this is handled internal to Linux kernel. */ to how this is handled internal to Linux kernel.
if (env->ir[IR_V0] == 0) { (Ab)use trapnr temporarily as boolean indicating error. */
env->ir[IR_V0] = sysret; trapnr = (env->ir[IR_V0] != 0 && sysret < 0);
} else { env->ir[IR_V0] = (trapnr ? -sysret : sysret);
env->ir[IR_V0] = (sysret < 0 ? -sysret : sysret); env->ir[IR_A3] = trapnr;
env->ir[IR_A3] = (sysret < 0);
}
break; break;
case 0x86: case 0x86:
/* IMB */ /* IMB */