Skip to content

Commit

Permalink
semihosting: Simplified tc_write() by directly invoking hostio_write(…
Browse files Browse the repository at this point in the history
…) rather than using the target controller indirection
  • Loading branch information
dragonmux authored and esden committed Jan 14, 2024
1 parent 8ada884 commit 03506b7
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/target/semihosting.c
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand All @@ -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 */
Expand Down

0 comments on commit 03506b7

Please sign in to comment.