2
0
mirror of git://git.code.sf.net/p/openocd/code synced 2025-08-16 17:57:47 +10:00

target/armv8: Use 'bool' data type for cache validity flag

The variable is already used as boolean value but has the wrong data
type.

Change-Id: Ia54cfbcdad00dc15e1181c05fb97fcbaa435bb21
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/9059
Tested-by: jenkins
Reviewed-by: Richard Allen <rsaxvc@gmail.com>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
This commit is contained in:
Marc Schink 2025-07-28 07:34:39 +00:00 committed by Antonio Borneo
parent b4d05b6e72
commit 1272796cc5
4 changed files with 8 additions and 8 deletions

View File

@ -1095,7 +1095,7 @@ static int aarch64_post_debug_entry(struct target *target)
LOG_DEBUG("System_register: %8.8" PRIx64, aarch64->system_control_reg);
aarch64->system_control_reg_curr = aarch64->system_control_reg;
if (armv8->armv8_mmu.armv8_cache.info == -1) {
if (!armv8->armv8_mmu.armv8_cache.info_valid) {
armv8_identify_cache(armv8);
armv8_read_mpidr(armv8);
}

View File

@ -1303,7 +1303,7 @@ COMMAND_HANDLER(armv8_pauth_command)
int armv8_handle_cache_info_command(struct command_invocation *cmd,
struct armv8_cache_common *armv8_cache)
{
if (armv8_cache->info == -1) {
if (!armv8_cache->info_valid) {
command_print(cmd, "cache not yet identified");
return ERROR_OK;
}
@ -1330,7 +1330,7 @@ int armv8_init_arch_info(struct target *target, struct armv8_common *armv8)
armv8->common_magic = ARMV8_COMMON_MAGIC;
armv8->armv8_mmu.armv8_cache.l2_cache = NULL;
armv8->armv8_mmu.armv8_cache.info = -1;
armv8->armv8_mmu.armv8_cache.info_valid = false;
armv8->armv8_mmu.armv8_cache.flush_all_data_cache = NULL;
armv8->armv8_mmu.armv8_cache.display_cache_info = NULL;
return ERROR_OK;

View File

@ -151,7 +151,7 @@ struct armv8_arch_cache {
};
struct armv8_cache_common {
int info;
bool info_valid;
int loc;
uint32_t iminline;
uint32_t dminline;

View File

@ -214,7 +214,7 @@ static int armv8_handle_inner_cache_info_command(struct command_invocation *cmd,
{
int cl;
if (armv8_cache->info == -1) {
if (!armv8_cache->info_valid) {
command_print(cmd, "cache not yet identified");
return ERROR_OK;
}
@ -262,7 +262,7 @@ static int armv8_flush_all_data(struct target *target)
int retval = ERROR_FAIL;
/* check that armv8_cache is correctly identify */
struct armv8_common *armv8 = target_to_armv8(target);
if (armv8->armv8_mmu.armv8_cache.info == -1) {
if (!armv8->armv8_mmu.armv8_cache.info_valid) {
LOG_ERROR("trying to flush un-identified cache");
return retval;
}
@ -288,7 +288,7 @@ static int armv8_flush_all_instruction(struct target *target)
int retval = ERROR_FAIL;
/* check that armv8_cache is correctly identify */
struct armv8_common *armv8 = target_to_armv8(target);
if (armv8->armv8_mmu.armv8_cache.info == -1) {
if (!armv8->armv8_mmu.armv8_cache.info_valid) {
LOG_ERROR("trying to flush un-identified cache");
return retval;
}
@ -459,7 +459,7 @@ int armv8_identify_cache(struct armv8_common *armv8)
if (retval != ERROR_OK)
goto done;
armv8->armv8_mmu.armv8_cache.info = 1;
armv8->armv8_mmu.armv8_cache.info_valid = true;
/* if no l2 cache initialize l1 data cache flush function function */
if (!armv8->armv8_mmu.armv8_cache.flush_all_data_cache) {