diff options
author | Øyvind Harboe <oyvind.harboe@zylin.com> | 2009-10-27 14:02:16 +0100 |
---|---|---|
committer | Øyvind Harboe <oyvind.harboe@zylin.com> | 2009-11-05 09:53:31 +0100 |
commit | d269122f91efaf2f745424c215fabb758b7e7ea0 (patch) | |
tree | 7e692e954a34ca07243ff9d9fc06db186f8c9fd1 /src/target/target_type.h | |
parent | 972924b2ad4bb7da34e331d4854b5f3d3e9e7260 (diff) |
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>
Diffstat (limited to 'src/target/target_type.h')
-rw-r--r-- | src/target/target_type.h | 8 |
1 files changed, 8 insertions, 0 deletions
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); |