Skip to content

Commit

Permalink
Make cortex_m3 functions public accessible.
Browse files Browse the repository at this point in the history
Change this functions to make it accessible for other
target implementations.

Change-Id: Ib41fc793cfb4de5439af026c2e8b52e7a9507c85
Signed-off-by: Mathias K <[email protected]>
Reviewed-on: http://openocd.zylin.com/278
Tested-by: jenkins
Reviewed-by: Spencer Oliver <[email protected]>
  • Loading branch information
Mathias K authored and ntfreak committed Jan 3, 2012
1 parent 9f89822 commit 54f820e
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 13 deletions.
23 changes: 10 additions & 13 deletions src/target/cortex_m.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,6 @@


/* forward declarations */
static int cortex_m3_set_breakpoint(struct target *target, struct breakpoint *breakpoint);
static int cortex_m3_unset_breakpoint(struct target *target, struct breakpoint *breakpoint);
static void cortex_m3_enable_watchpoints(struct target *target);
static int cortex_m3_store_core_reg_u32(struct target *target,
enum armv7m_regtype type, uint32_t num, uint32_t value);

Expand Down Expand Up @@ -1142,7 +1139,7 @@ static int cortex_m3_deassert_reset(struct target *target)
return ERROR_OK;
}

static int
int
cortex_m3_set_breakpoint(struct target *target, struct breakpoint *breakpoint)
{
int retval;
Expand Down Expand Up @@ -1217,7 +1214,7 @@ cortex_m3_set_breakpoint(struct target *target, struct breakpoint *breakpoint)
return ERROR_OK;
}

static int
int
cortex_m3_unset_breakpoint(struct target *target, struct breakpoint *breakpoint)
{
int retval;
Expand Down Expand Up @@ -1272,7 +1269,7 @@ cortex_m3_unset_breakpoint(struct target *target, struct breakpoint *breakpoint)
return ERROR_OK;
}

static int
int
cortex_m3_add_breakpoint(struct target *target, struct breakpoint *breakpoint)
{
struct cortex_m3_common *cortex_m3 = target_to_cm3(target);
Expand Down Expand Up @@ -1322,7 +1319,7 @@ cortex_m3_add_breakpoint(struct target *target, struct breakpoint *breakpoint)
return cortex_m3_set_breakpoint(target, breakpoint);
}

static int
int
cortex_m3_remove_breakpoint(struct target *target, struct breakpoint *breakpoint)
{
struct cortex_m3_common *cortex_m3 = target_to_cm3(target);
Expand Down Expand Up @@ -1350,7 +1347,7 @@ cortex_m3_remove_breakpoint(struct target *target, struct breakpoint *breakpoint
return ERROR_OK;
}

static int
int
cortex_m3_set_watchpoint(struct target *target, struct watchpoint *watchpoint)
{
int dwt_num = 0;
Expand Down Expand Up @@ -1415,7 +1412,7 @@ cortex_m3_set_watchpoint(struct target *target, struct watchpoint *watchpoint)
return ERROR_OK;
}

static int
int
cortex_m3_unset_watchpoint(struct target *target, struct watchpoint *watchpoint)
{
struct cortex_m3_common *cortex_m3 = target_to_cm3(target);
Expand Down Expand Up @@ -1452,7 +1449,7 @@ cortex_m3_unset_watchpoint(struct target *target, struct watchpoint *watchpoint)
return ERROR_OK;
}

static int
int
cortex_m3_add_watchpoint(struct target *target, struct watchpoint *watchpoint)
{
struct cortex_m3_common *cortex_m3 = target_to_cm3(target);
Expand Down Expand Up @@ -1503,7 +1500,7 @@ cortex_m3_add_watchpoint(struct target *target, struct watchpoint *watchpoint)
return ERROR_OK;
}

static int
int
cortex_m3_remove_watchpoint(struct target *target, struct watchpoint *watchpoint)
{
struct cortex_m3_common *cortex_m3 = target_to_cm3(target);
Expand All @@ -1526,7 +1523,7 @@ cortex_m3_remove_watchpoint(struct target *target, struct watchpoint *watchpoint
return ERROR_OK;
}

static void cortex_m3_enable_watchpoints(struct target *target)
void cortex_m3_enable_watchpoints(struct target *target)
{
struct watchpoint *watchpoint = target->watchpoints;

Expand Down Expand Up @@ -1820,7 +1817,7 @@ cortex_m3_dwt_addreg(struct target *t, struct reg *r, struct dwt_reg *d)
r->type = &dwt_reg_type;
}

static void
void
cortex_m3_dwt_setup(struct cortex_m3_common *cm3, struct target *target)
{
uint32_t dwtcr;
Expand Down
11 changes: 11 additions & 0 deletions src/target/cortex_m.h
Original file line number Diff line number Diff line change
Expand Up @@ -185,4 +185,15 @@ target_to_cm3(struct target *target)
struct cortex_m3_common, armv7m);
}

int cortex_m3_set_breakpoint(struct target *target, struct breakpoint *breakpoint);
int cortex_m3_unset_breakpoint(struct target *target, struct breakpoint *breakpoint);
int cortex_m3_add_breakpoint(struct target *target, struct breakpoint *breakpoint);
int cortex_m3_remove_breakpoint(struct target *target, struct breakpoint *breakpoint);
int cortex_m3_set_watchpoint(struct target *target, struct watchpoint *watchpoint);
int cortex_m3_unset_watchpoint(struct target *target, struct watchpoint *watchpoint);
int cortex_m3_add_watchpoint(struct target *target, struct watchpoint *watchpoint);
int cortex_m3_remove_watchpoint(struct target *target, struct watchpoint *watchpoint);
void cortex_m3_enable_watchpoints(struct target *target);
void cortex_m3_dwt_setup(struct cortex_m3_common *cm3, struct target *target);

#endif /* CORTEX_M3_H */

0 comments on commit 54f820e

Please sign in to comment.