aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Head <chead@zaber.com>2018-04-26 18:09:36 -0700
committerTomas Vanek <vanekt@fbl.cz>2018-06-05 11:30:19 +0100
commit95a0024ef2e16c2bca592ce20c0fe00154b1aaa5 (patch)
tree234fde146c64eac31b7fcc2541ec8251e36c60b1
parent69b0021846fd5b3ded5dc3ed85b9d1aef331900f (diff)
downloadriscv-openocd-95a0024ef2e16c2bca592ce20c0fe00154b1aaa5.zip
riscv-openocd-95a0024ef2e16c2bca592ce20c0fe00154b1aaa5.tar.gz
riscv-openocd-95a0024ef2e16c2bca592ce20c0fe00154b1aaa5.tar.bz2
target/cortex_m: constify some variables
Change-Id: I1f3fddd89597333fc1bb9535c0cd76ca3e008324 Signed-off-by: Christopher Head <chead@zaber.com> Reviewed-on: http://openocd.zylin.com/4503 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
-rw-r--r--src/target/cortex_m.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/target/cortex_m.c b/src/target/cortex_m.c
index 30439f4..b6043fc 100644
--- a/src/target/cortex_m.c
+++ b/src/target/cortex_m.c
@@ -1806,11 +1806,11 @@ static int cortex_m_dwt_set_reg(struct reg *reg, uint8_t *buf)
struct dwt_reg {
uint32_t addr;
- char *name;
+ const char *name;
unsigned size;
};
-static struct dwt_reg dwt_base_regs[] = {
+static const struct dwt_reg dwt_base_regs[] = {
{ DWT_CTRL, "dwt_ctrl", 32, },
/* NOTE that Erratum 532314 (fixed r2p0) affects CYCCNT: it wrongly
* increments while the core is asleep.
@@ -1819,7 +1819,7 @@ static struct dwt_reg dwt_base_regs[] = {
/* plus some 8 bit counters, useful for profiling with TPIU */
};
-static struct dwt_reg dwt_comp[] = {
+static const struct dwt_reg dwt_comp[] = {
#define DWT_COMPARATOR(i) \
{ DWT_COMP0 + 0x10 * (i), "dwt_" #i "_comp", 32, }, \
{ DWT_MASK0 + 0x10 * (i), "dwt_" #i "_mask", 4, }, \
@@ -1848,7 +1848,7 @@ static const struct reg_arch_type dwt_reg_type = {
.set = cortex_m_dwt_set_reg,
};
-static void cortex_m_dwt_addreg(struct target *t, struct reg *r, struct dwt_reg *d)
+static void cortex_m_dwt_addreg(struct target *t, struct reg *r, const struct dwt_reg *d)
{
struct dwt_reg_state *state;