aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMarc Schink <openocd-dev@marcschink.de>2019-02-26 13:40:23 +0100
committerTomas Vanek <vanekt@fbl.cz>2019-03-06 16:09:22 +0000
commit351ef7bf3cce048ec854c8d19d8af5aa2b97c3a9 (patch)
treec341e7bcaa0b9cfdb6362d1c4844c080e45dbbf8 /src
parentf426d8dd33797a504f118933c8ff658e5c080809 (diff)
downloadriscv-openocd-351ef7bf3cce048ec854c8d19d8af5aa2b97c3a9.zip
riscv-openocd-351ef7bf3cce048ec854c8d19d8af5aa2b97c3a9.tar.gz
riscv-openocd-351ef7bf3cce048ec854c8d19d8af5aa2b97c3a9.tar.bz2
target/cortex_m: Use 'bool' instead of 'int'
Change-Id: I273d24997e2c844015e144a15981f8f0af522261 Signed-off-by: Marc Schink <openocd-dev@marcschink.de> Reviewed-on: http://openocd.zylin.com/4950 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/target/cortex_m.c12
-rw-r--r--src/target/cortex_m.h6
2 files changed, 9 insertions, 9 deletions
diff --git a/src/target/cortex_m.c b/src/target/cortex_m.c
index d751fd8..4bada39 100644
--- a/src/target/cortex_m.c
+++ b/src/target/cortex_m.c
@@ -265,7 +265,7 @@ static int cortex_m_endreset_event(struct target *target)
return retval;
}
- cortex_m->fpb_enabled = 1;
+ cortex_m->fpb_enabled = true;
/* Restore FPB registers */
for (i = 0; i < cortex_m->fp_num_code + cortex_m->fp_num_lit; i++) {
@@ -1180,7 +1180,7 @@ int cortex_m_set_breakpoint(struct target *target, struct breakpoint *breakpoint
LOG_ERROR("Unhandled Cortex-M Flash Patch Breakpoint architecture revision");
return ERROR_FAIL;
}
- comparator_list[fp_num].used = 1;
+ comparator_list[fp_num].used = true;
comparator_list[fp_num].fpcr_value = fpcr_value;
target_write_u32(target, comparator_list[fp_num].fpcr_address,
comparator_list[fp_num].fpcr_value);
@@ -1195,7 +1195,7 @@ int cortex_m_set_breakpoint(struct target *target, struct breakpoint *breakpoint
return retval;
}
- cortex_m->fpb_enabled = 1;
+ cortex_m->fpb_enabled = true;
}
} else if (breakpoint->type == BKPT_SOFT) {
uint8_t code[4];
@@ -1254,7 +1254,7 @@ int cortex_m_unset_breakpoint(struct target *target, struct breakpoint *breakpoi
LOG_DEBUG("Invalid FP Comparator number in breakpoint");
return ERROR_OK;
}
- comparator_list[fp_num].used = 0;
+ comparator_list[fp_num].used = false;
comparator_list[fp_num].fpcr_value = 0;
target_write_u32(target, comparator_list[fp_num].fpcr_address,
comparator_list[fp_num].fpcr_value);
@@ -1351,7 +1351,7 @@ int cortex_m_set_watchpoint(struct target *target, struct watchpoint *watchpoint
LOG_ERROR("Can not find free DWT Comparator");
return ERROR_FAIL;
}
- comparator->used = 1;
+ comparator->used = true;
watchpoint->set = dwt_num + 1;
comparator->comp = watchpoint->address;
@@ -1408,7 +1408,7 @@ int cortex_m_unset_watchpoint(struct target *target, struct watchpoint *watchpoi
}
comparator = cortex_m->dwt_comparator_list + dwt_num;
- comparator->used = 0;
+ comparator->used = false;
comparator->function = 0;
target_write_u32(target, comparator->dwt_comparator_address + 8,
comparator->function);
diff --git a/src/target/cortex_m.h b/src/target/cortex_m.h
index 22d9735..b375d11 100644
--- a/src/target/cortex_m.h
+++ b/src/target/cortex_m.h
@@ -136,14 +136,14 @@
#define FPCR_REPLACE_BKPT_BOTH (3 << 30)
struct cortex_m_fp_comparator {
- int used;
+ bool used;
int type;
uint32_t fpcr_value;
uint32_t fpcr_address;
};
struct cortex_m_dwt_comparator {
- int used;
+ bool used;
uint32_t comp;
uint32_t mask;
uint32_t function;
@@ -174,7 +174,7 @@ struct cortex_m_common {
int fp_num_code;
int fp_code_available;
int fp_rev;
- int fpb_enabled;
+ bool fpb_enabled;
struct cortex_m_fp_comparator *fp_comparator_list;
/* Data Watchpoint and Trace (DWT) */