target/m68k: use M68K_FEATURE_MOVEFROMSR_PRIV feature for move_from_sr privilege...
commitb342e56b23dc2a0a1f30e21d67d001a1d0befbf0
authorMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Sun, 25 Sep 2022 13:48:04 +0000 (25 14:48 +0100)
committerLaurent Vivier <laurent@vivier.eu>
Mon, 26 Sep 2022 21:37:22 +0000 (26 23:37 +0200)
tree3395f62377c7011cd3791c63824a7db0361d5cc4
parent2dc7bf63cf77d23b287c8d78628d62046fba1bf4
target/m68k: use M68K_FEATURE_MOVEFROMSR_PRIV feature for move_from_sr privilege check

Now that M68K_FEATURE_M68000 has been renamed to M68K_FEATURE_M68K it is easier
to see that the privilege exception check is wrong: it is currently only generated
for ColdFire CPUs when in fact it should also be generated for Motorola CPUs from
the 68010 onwards.

Introduce a new M68K_FEATURE_MOVEFROMSR_PRIV feature which is set for all non-
Motorola CPUs, and for all Motorola CPUs from the 68010 onwards and use it to
determine whether a privilege exception should be generated for the MOVE-from-SR
instruction.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20220925134804.139706-3-mark.cave-ayland@ilande.co.uk>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
target/m68k/cpu.c
target/m68k/cpu.h
target/m68k/translate.c