Revisão | 68aa851aa21741ab0a3c019b641d6ce72f68b3d5 (tree) |
---|---|
Hora | 2019-02-06 19:49:21 |
Autor | Sven Schnelle <svens@stac...> |
Commiter | Richard Henderson |
target/hppa: fix PSW Q bit behaviour to match hardware
PA-RISC specification says: "Setting the PSW Q-bit, PSW{28}, to 1
with this instruction, if it was not already 1, is an undefined
operation." However, at least HP-UX 10.20 sets the Q bit from 0 to 1
with the SSM instruction. Tested this both on HP9000/712 and
HP9000/785/C3750, both machines set the Q bit from 0 to 1 without
exception. This makes HP-UX 10.20 progress a little bit further.
Signed-off-by: Sven Schnelle <svens@stackframe.org>
Message-Id: <20190129191402.29539-1-svens@stackframe.org>
[rth: Add a comment to the code as well.]
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
@@ -665,11 +665,15 @@ void HELPER(reset)(CPUHPPAState *env) | ||
665 | 665 | target_ureg HELPER(swap_system_mask)(CPUHPPAState *env, target_ureg nsm) |
666 | 666 | { |
667 | 667 | target_ulong psw = env->psw; |
668 | - /* ??? On second reading this condition simply seems | |
669 | - to be undefined rather than a diagnosed trap. */ | |
670 | - if (nsm & ~psw & PSW_Q) { | |
671 | - hppa_dynamic_excp(env, EXCP_ILL, GETPC()); | |
672 | - } | |
668 | + /* | |
669 | + * Setting the PSW Q bit to 1, if it was not already 1, is an | |
670 | + * undefined operation. | |
671 | + * | |
672 | + * However, HP-UX 10.20 does this with the SSM instruction. | |
673 | + * Tested this on HP9000/712 and HP9000/785/C3750 and both | |
674 | + * machines set the Q bit from 0 to 1 without an exception, | |
675 | + * so let this go without comment. | |
676 | + */ | |
673 | 677 | env->psw = (psw & ~PSW_SM) | (nsm & PSW_SM); |
674 | 678 | return psw & PSW_SM; |
675 | 679 | } |