aboutsummaryrefslogtreecommitdiff
path: root/src/target/target_type.h
diff options
context:
space:
mode:
authorTim Newsome <tim@sifive.com>2019-02-25 14:02:30 -0800
committerMatthias Welwarsky <matthias@welwarsky.de>2019-03-08 14:05:19 +0000
commit57e30102ea440d77aa001e26eb901d0cbb305a30 (patch)
treeed63b282decaa8a1fdbe04c2f4c213e56e493eae /src/target/target_type.h
parent85ba2dc4c6ab4c91f4461c2853660cc2cb9e2623 (diff)
gdb_server, target: Add target_address_bits()
Targets can use this to expose how many address bits there are. gdb_server uses this to send gdb the appropriate upper limit in the memory-map. (Before this change the upper limit would only be correct for 32-bit targets.) Change-Id: Idb0933255ed53951fcfb05e040674bcdf19441e1 Signed-off-by: Tim Newsome <tim@sifive.com> Reviewed-on: http://openocd.zylin.com/4947 Tested-by: jenkins Reviewed-by: Peter Mamonov <pmamonov@gmail.com> Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Diffstat (limited to 'src/target/target_type.h')
-rw-r--r--src/target/target_type.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/target/target_type.h b/src/target/target_type.h
index a8928911..95745c9e 100644
--- a/src/target/target_type.h
+++ b/src/target/target_type.h
@@ -284,6 +284,11 @@ struct target_type {
*/
int (*profiling)(struct target *target, uint32_t *samples,
uint32_t max_num_samples, uint32_t *num_samples, uint32_t seconds);
+
+ /* Return the number of address bits this target supports. This will
+ * typically be 32 for 32-bit targets, and 64 for 64-bit targets. If not
+ * implemented, it's assumed to be 32. */
+ unsigned (*address_bits)(struct target *target);
};
#endif /* OPENOCD_TARGET_TARGET_TYPE_H */