Skip to content

Commit

Permalink
semihosting: Cleaned up the target controller structure and headers
Browse files Browse the repository at this point in the history
  • Loading branch information
dragonmux authored and esden committed Jan 14, 2024
1 parent 03506b7 commit 2a16e08
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 74 deletions.
42 changes: 0 additions & 42 deletions src/gdb_hostio.h

This file was deleted.

17 changes: 1 addition & 16 deletions src/gdb_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@
#include "gdb_if.h"
#include "gdb_packet.h"
#include "gdb_main.h"
#include "gdb_hostio.h"
#include "target.h"
#include "target_internal.h"
#include "semihosting.h"
#include "command.h"
#include "crc32.h"
#include "morse.h"
Expand Down Expand Up @@ -111,21 +111,6 @@ static void gdb_target_printf(target_controller_s *tc, const char *fmt, va_list
target_controller_s gdb_controller = {
.destroy_callback = gdb_target_destroy_callback,
.printf = gdb_target_printf,

#if PC_HOSTED == 0
.open = hostio_open,
.close = hostio_close,
.read = hostio_read,
.write = hostio_write,
.lseek = hostio_lseek,
.rename = hostio_rename,
.unlink = hostio_unlink,
.stat = hostio_stat,
.fstat = hostio_fstat,
.gettimeofday = hostio_gettimeofday,
.isatty = hostio_isatty,
.system = hostio_system,
#endif
};

/* execute gdb remote command stored in 'pbuf'. returns immediately, no busy waiting. */
Expand Down
15 changes: 0 additions & 15 deletions src/include/target.h
Original file line number Diff line number Diff line change
Expand Up @@ -165,21 +165,6 @@ struct target_controller {
void (*destroy_callback)(target_controller_s *, target_s *target);
void (*printf)(target_controller_s *, const char *fmt, va_list);

#if PC_HOSTED == 0
/* Interface to host system calls */
int (*open)(target_controller_s *, target_addr_t path, size_t path_len, target_open_flags_e flags, mode_t mode);
int (*close)(target_controller_s *, int fd);
int (*read)(target_controller_s *, int fd, target_addr_t buf, unsigned int count);
int (*write)(target_controller_s *, int fd, target_addr_t buf, unsigned int count);
long (*lseek)(target_controller_s *, int fd, long offset, target_seek_flag_e flag);
int (*rename)(target_controller_s *, target_addr_t oldpath, size_t old_len, target_addr_t newpath, size_t new_len);
int (*unlink)(target_controller_s *, target_addr_t path, size_t path_len);
int (*stat)(target_controller_s *, target_addr_t path, size_t path_len, target_addr_t buf);
int (*fstat)(target_controller_s *, int fd, target_addr_t buf);
int (*gettimeofday)(target_controller_s *, target_addr_t tv, target_addr_t tz);
int (*isatty)(target_controller_s *, int fd);
int (*system)(target_controller_s *, target_addr_t cmd, size_t cmd_len);
#endif
target_errno_e errno_;
bool interrupted;
};
Expand Down
1 change: 0 additions & 1 deletion src/target/semihosting.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
#include "target.h"
#include "target_internal.h"
#include "gdb_main.h"
#include "gdb_hostio.h"
#include "gdb_packet.h"
#include "cortexm.h"
#include "semihosting.h"
Expand Down
1 change: 1 addition & 0 deletions src/target/semihosting.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,6 @@
#include "general.h"

int cortexm_hostio_request(target_s *target);
int hostio_reply(target_controller_s *tc, char *packet, int len);

#endif /* TARGET_SEMIHOSTING_H */

0 comments on commit 2a16e08

Please sign in to comment.