summaryrefslogtreecommitdiff
path: root/src/target/target_type.h
diff options
context:
space:
mode:
authorØyvind Harboe <oyvind.harboe@zylin.com>2009-10-21 14:45:39 +0200
committerØyvind Harboe <oyvind.harboe@zylin.com>2009-10-21 14:45:39 +0200
commit2783cba8106a86bd81635b509ccb5edb0ebd3d29 (patch)
tree36df983391ee8474a45ac2248a4ca7c0b192c219 /src/target/target_type.h
parent818cedaff315d4ca44541012d5e4a8882cda1c85 (diff)
downloadopenocd+libswd-2783cba8106a86bd81635b509ccb5edb0ebd3d29.tar.gz
openocd+libswd-2783cba8106a86bd81635b509ccb5edb0ebd3d29.tar.bz2
openocd+libswd-2783cba8106a86bd81635b509ccb5edb0ebd3d29.tar.xz
openocd+libswd-2783cba8106a86bd81635b509ccb5edb0ebd3d29.zip
Added target_read/write_phys_memory() fn's. mdX/mwX commands updated to support phys flag to specify bypassing of MMU.
Diffstat (limited to 'src/target/target_type.h')
-rw-r--r--src/target/target_type.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/target/target_type.h b/src/target/target_type.h
index d28608fe..aab4321f 100644
--- a/src/target/target_type.h
+++ b/src/target/target_type.h
@@ -180,7 +180,26 @@ struct target_type_s
int (*init_target)(struct command_context_s *cmd_ctx, struct target_s *target);
int (*quit)(void);
+ /* translate from virtual to physical address. Default implementation is successful
+ * no-op(i.e. virtual==physical).
+ */
int (*virt2phys)(struct target_s *target, uint32_t address, uint32_t *physical);
+
+ /* read directly from physical memory. caches are bypassed and untouched.
+ *
+ * If the target does not support disabling caches, leaving them untouched,
+ * then minimally the actual physical memory location will be read even
+ * if cache states are unchanged, flushed, etc.
+ *
+ * Default implementation is to call read_memory.
+ */
+ int (*read_phys_memory)(struct target_s *target, uint32_t phys_address, uint32_t size, uint32_t count, uint8_t *buffer);
+
+ /*
+ * same as read_phys_memory, except that it writes...
+ */
+ int (*write_phys_memory)(struct target_s *target, uint32_t phys_address, uint32_t size, uint32_t count, uint8_t *buffer);
+
int (*mmu)(struct target_s *target, int *enabled);
};