target-arm: Clean up handling of AArch64 PSTATE
commitd356312fdc8640af929e0dbab61c6e514d47feb8
authorPeter Maydell <peter.maydell@linaro.org>
Tue, 17 Dec 2013 19:42:30 +0000 (17 19:42 +0000)
committerPeter Maydell <peter.maydell@linaro.org>
Tue, 17 Dec 2013 19:42:30 +0000 (17 19:42 +0000)
treeef3cdeaf3ef2e87cb21cc42199f2fe5188f82ae9
parentb197ebd410f0298ec078c3048f9cfb9f6bfc3b3c
target-arm: Clean up handling of AArch64 PSTATE

The env->pstate field is a little odd since it doesn't strictly
speaking represent an architectural register. However it's convenient
for QEMU to use it to hold the various PSTATE architectural bits
in the same format the architecture specifies for SPSR registers
(since this is the same format the kernel uses for signal handlers
and the KVM register). Add some structure to how we deal with it:
 * document what env->pstate is
 * add some #defines for various bits in it
 * add helpers for reading/writing it taking account of caching
   of NZCV, and use them where appropriate
 * reset it on startup

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 1385645602-18662-3-git-send-email-peter.maydell@linaro.org
Reviewed-by: Christoffer Dall <christoffer.dall@linaro.org>
linux-user/signal.c
target-arm/cpu.c
target-arm/cpu.h
target-arm/gdbstub64.c
target-arm/translate-a64.c