From c0e7ccbd87cf491b065bf18bbdb6a73b741c2698 Mon Sep 17 00:00:00 2001 From: Steven Stallion Date: Fri, 22 Jul 2016 15:43:11 -0500 Subject: semihosting: support fileio operation This patch adds support for bridging semihosting to GDB's File-I/O remote protocol extension. For the most part operations match up 1:1, however some require a working area to complete successfully, namely operations that devolve to read, stat, and gettimeofday. A new command was added to enable support for fileio named `arm semihosting_fileio`, which ensures that the default behavior remains intact for those that prefer it. Finally, redundant logging was removed from the target_arch_state function; this permits ARM targets to quiesce log output when polling for a fileio reply. This prevents filling the logs with halt/resume messages when using semihosting fileio. Change-Id: Ifbb864fc2373336a501cc0332675b887b552e1ee Signed-off-by: Steven Stallion Reviewed-on: http://openocd.zylin.com/3566 Tested-by: jenkins Reviewed-by: Steven Stallion Reviewed-by: Paul Fertser --- src/target/arm.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/target/arm.h') diff --git a/src/target/arm.h b/src/target/arm.h index 28022e3d..226dd656 100644 --- a/src/target/arm.h +++ b/src/target/arm.h @@ -130,6 +130,18 @@ struct arm { /** Flag reporting whether semihosting is active. */ bool is_semihosting; + /** Flag reporting whether semihosting fileio is active. */ + bool is_semihosting_fileio; + + /** Flag reporting whether semihosting fileio operation is active. */ + bool semihosting_hit_fileio; + + /** Current semihosting operation. */ + int semihosting_op; + + /** Current semihosting result. */ + int semihosting_result; + /** Value to be returned by semihosting SYS_ERRNO request. */ int semihosting_errno; -- cgit v1.2.3-18-g5258