diff options
author | Antonio Borneo <borneo.antonio@gmail.com> | 2019-06-24 17:15:33 +0200 |
---|---|---|
committer | Antonio Borneo <borneo.antonio@gmail.com> | 2020-03-12 10:05:42 +0000 |
commit | fba438fde7355bcbe5fb4dc0ce712665d3d8a6da (patch) | |
tree | b03a74645a8d29d9757119b196d94cae31e42c76 /src/target/arm.h | |
parent | f447c31b30f805725b7a09d51d786c88de4b7a4f (diff) | |
download | riscv-openocd-fba438fde7355bcbe5fb4dc0ce712665d3d8a6da.zip riscv-openocd-fba438fde7355bcbe5fb4dc0ce712665d3d8a6da.tar.gz riscv-openocd-fba438fde7355bcbe5fb4dc0ce712665d3d8a6da.tar.bz2 |
arm: Use different enum for core_type and core_mode
The fields core_type and core_mode use the same enum arm_mode
but encode different information, making the code less immediate
to read.
Use a different enum arm_core_type for the field core_type.
The code behavior is not changed.
Change-Id: I60f2095ea6801dfe22f6da81ec295ca71ef90466
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5258
Tested-by: jenkins
Diffstat (limited to 'src/target/arm.h')
-rw-r--r-- | src/target/arm.h | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/src/target/arm.h b/src/target/arm.h index ea83d38..bf0d932 100644 --- a/src/target/arm.h +++ b/src/target/arm.h @@ -41,6 +41,22 @@ */ /** + * Indicates what registers are in the ARM state core register set. + * + * - ARM_CORE_TYPE_STD indicates the standard set of 37 registers, seen + * on for example ARM7TDMI cores. + * - ARM_CORE_TYPE_SEC_EXT indicates core has security extensions, thus + * three more registers are shadowed for "Secure Monitor" mode. + * - ARM_CORE_TYPE_M_PROFILE indicates a microcontroller profile core, + * which only shadows SP. + */ +enum arm_core_type { + ARM_CORE_TYPE_STD = -1, + ARM_CORE_TYPE_SEC_EXT = 1, + ARM_CORE_TYPE_M_PROFILE, +}; + +/** * Represent state of an ARM core. * * Most numbers match the five low bits of the *PSR registers on @@ -161,15 +177,8 @@ struct arm { /** Support for arm_reg_current() */ const int *map; - /** - * Indicates what registers are in the ARM state core register set. - * ARM_MODE_ANY indicates the standard set of 37 registers, - * seen on for example ARM7TDMI cores. ARM_MODE_MON indicates three - * more registers are shadowed, for "Secure Monitor" mode. - * ARM_MODE_THREAD indicates a microcontroller profile core, - * which only shadows SP. - */ - enum arm_mode core_type; + /** Indicates what registers are in the ARM state core register set. */ + enum arm_core_type core_type; /** Record the current core mode: SVC, USR, or some other mode. */ enum arm_mode core_mode; |