target: add target->type->has_mmu fn.

improve default target->read/write_phys_memory, produce
more sensible error messages if the mmu interface
functions have not been implemented yet vs. will
not be implemented(e.g. cortex m3).

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
This commit is contained in:
Øyvind Harboe
2009-10-27 14:02:16 +01:00
parent 972924b2ad
commit d269122f91
3 changed files with 48 additions and 5 deletions

View File

@@ -52,6 +52,12 @@ extern uint8_t armv7m_gdb_dummy_cpsr_value[];
extern reg_t armv7m_gdb_dummy_cpsr_reg;
#endif
static int cortex_m3_has_mmu(struct target_s *target, bool *has_mmu)
{
*has_mmu = false;
return ERROR_OK;
}
static int cortexm3_dap_read_coreregister_u32(swjdp_common_t *swjdp,
uint32_t *value, int regnum)
{
@@ -1837,6 +1843,7 @@ target_type_t cortexm3_target =
.register_commands = cortex_m3_register_commands,
.target_create = cortex_m3_target_create,
.init_target = cortex_m3_init_target,
.has_mmu = cortex_m3_has_mmu,
.examine = cortex_m3_examine,
};