From 2783cba8106a86bd81635b509ccb5edb0ebd3d29 Mon Sep 17 00:00:00 2001 From: Øyvind Harboe Date: Wed, 21 Oct 2009 14:45:39 +0200 Subject: Added target_read/write_phys_memory() fn's. mdX/mwX commands updated to support phys flag to specify bypassing of MMU. --- src/target/target_type.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src/target/target_type.h') 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); }; -- cgit v1.2.3