#include "config.h"
#endif
+#include "breakpoints.h"
#include "cortex_m3.h"
#include "target_request.h"
#include "target_type.h"
#include "arm_disassembler.h"
+#include "register.h"
/* NOTE: most of this should work fine for the Cortex-M1 and
* Cortex-M0 cores too, although they're ARMv6-M not ARMv7-M.
*/
-#define ARRAY_SIZE(x) ((int)(sizeof(x)/sizeof((x)[0])))
-
/* forward declarations */
static int cortex_m3_set_breakpoint(struct target *target, struct breakpoint *breakpoint);
return cortex_m3_write_memory(target, address, 4, count, buffer);
}
-static int cortex_m3_init_target(struct command_context_s *cmd_ctx,
+static int cortex_m3_init_target(struct command_context *cmd_ctx,
struct target *target)
{
armv7m_build_reg_cache(target);
/*--------------------------------------------------------------------------*/
-static int cortex_m3_verify_pointer(struct command_context_s *cmd_ctx,
+static int cortex_m3_verify_pointer(struct command_context *cmd_ctx,
struct cortex_m3_common *cm3)
{
if (cm3->common_magic != CORTEX_M3_COMMON_MAGIC) {
struct swjdp_common *swjdp = &armv7m->swjdp_info;
uint32_t demcr = 0;
int retval;
- int i;
-
retval = cortex_m3_verify_pointer(cmd_ctx, cortex_m3);
if (retval != ERROR_OK)
return retval;
}
}
while (argc-- > 0) {
+ unsigned i;
for (i = 0; i < ARRAY_SIZE(vec_ids); i++) {
if (strcmp(args[argc], vec_ids[i].name) != 0)
continue;
mem_ap_read_atomic_u32(swjdp, DCB_DEMCR, &demcr);
}
- for (i = 0; i < ARRAY_SIZE(vec_ids); i++)
+ for (unsigned i = 0; i < ARRAY_SIZE(vec_ids); i++)
command_print(cmd_ctx, "%9s: %s", vec_ids[i].name,
(demcr & vec_ids[i].mask) ? "catch" : "ignore");
return ERROR_OK;
}
-static int cortex_m3_register_commands(struct command_context_s *cmd_ctx)
+static int cortex_m3_register_commands(struct command_context *cmd_ctx)
{
int retval;
- command_t *cortex_m3_cmd;
+ struct command *cortex_m3_cmd;
retval = armv7m_register_commands(cmd_ctx);