From d269122f91efaf2f745424c215fabb758b7e7ea0 Mon Sep 17 00:00:00 2001 From: Øyvind Harboe Date: Tue, 27 Oct 2009 14:02:16 +0100 Subject: target: add target->type->has_mmu fn. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- src/target/target_type.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/target/target_type.h') diff --git a/src/target/target_type.h b/src/target/target_type.h index dd469db1..23ed40e0 100644 --- a/src/target/target_type.h +++ b/src/target/target_type.h @@ -199,8 +199,16 @@ struct target_type_s */ int (*write_phys_memory)(struct target_s *target, uint32_t phys_address, uint32_t size, uint32_t count, uint8_t *buffer); + /* returns true if the mmu is enabled. Default implementation returns error. */ int (*mmu)(struct target_s *target, int *enabled); + /* returns true if the target has an mmu. This can only be + determined after the target has been examined. + + Default implementation returns success and has_mmu==true. + */ + int (*has_mmu)(struct target_s *target, bool *has_mmu); + /* Read coprocessor - arm specific. Default implementation returns error. */ int (*mrc)(struct target_s *target, int cpnum, uint32_t op1, uint32_t op2, uint32_t CRn, uint32_t CRm, uint32_t *value); -- cgit v1.2.3