hvf: arm: Use macros for sysreg shift/masking
commitad99f64f1cfff7c5e7af0e697523d9b7e45423b6
authorAlexander Graf <agraf@csgraf.de>
Wed, 9 Feb 2022 12:41:34 +0000 (9 13:41 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Mon, 21 Feb 2022 13:30:19 +0000 (21 13:30 +0000)
treedac3fcd3c54474807b25986adec034f0e974068b
parent48006e03d5425b924af31091bc28e35619ffb948
hvf: arm: Use macros for sysreg shift/masking

We are parsing the syndrome field for sysregs in multiple places across
the hvf code, but repeat shift/mask operations with hard coded constants
every time. This is an error prone approach and makes it harder to reason
about the correctness of these operations.

Let's introduce macros that allow us to unify the constants used as well
as create new helpers to extract fields from the sysreg value.

Suggested-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Alexander Graf <agraf@csgraf.de>
Reviewed-by: Cameron Esfahani <dirty@apple.com <mailto:dirty@apple.com>>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-id: 20220209124135.69183-1-agraf@csgraf.de
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
target/arm/hvf/hvf.c