From 03506b7165e3e57c67926f9956c99d0c222d2d76 Mon Sep 17 00:00:00 2001 From: dragonmux Date: Thu, 21 Dec 2023 16:44:07 +0000 Subject: [PATCH] semihosting: Simplified tc_write() by directly invoking hostio_write() rather than using the target controller indirection --- src/target/semihosting.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/target/semihosting.c b/src/target/semihosting.c index a4a76bc2dfc..dc9b6985ecd 100644 --- a/src/target/semihosting.c +++ b/src/target/semihosting.c @@ -229,7 +229,6 @@ int hostio_system(target_controller_s *tc, target_addr_t cmd, size_t cmd_len) /* Interface to host system calls */ int tc_write(target_s *t, int fd, target_addr_t buf, unsigned int count) { -#if PC_HOSTED == 0 if (t->stdout_redirected && (fd == STDOUT_FILENO || fd == STDERR_FILENO)) { while (count) { uint8_t tmp[STDOUT_READ_BUF_SIZE]; @@ -243,11 +242,7 @@ int tc_write(target_s *t, int fd, target_addr_t buf, unsigned int count) } return 0; } -#endif - - if (t->tc->write == NULL) - return 0; - return t->tc->write(t->tc, fd, buf, count); + return hostio_write(t->tc, fd, buf, count); } /* probe memory access functions */