Skip to content

Commit 2a16e08

Browse files
dragonmuxesden
authored andcommitted
semihosting: Cleaned up the target controller structure and headers
1 parent 03506b7 commit 2a16e08

File tree

5 files changed

+2
-74
lines changed

5 files changed

+2
-74
lines changed

src/gdb_hostio.h

Lines changed: 0 additions & 42 deletions
This file was deleted.

src/gdb_main.c

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@
3232
#include "gdb_if.h"
3333
#include "gdb_packet.h"
3434
#include "gdb_main.h"
35-
#include "gdb_hostio.h"
3635
#include "target.h"
3736
#include "target_internal.h"
37+
#include "semihosting.h"
3838
#include "command.h"
3939
#include "crc32.h"
4040
#include "morse.h"
@@ -111,21 +111,6 @@ static void gdb_target_printf(target_controller_s *tc, const char *fmt, va_list
111111
target_controller_s gdb_controller = {
112112
.destroy_callback = gdb_target_destroy_callback,
113113
.printf = gdb_target_printf,
114-
115-
#if PC_HOSTED == 0
116-
.open = hostio_open,
117-
.close = hostio_close,
118-
.read = hostio_read,
119-
.write = hostio_write,
120-
.lseek = hostio_lseek,
121-
.rename = hostio_rename,
122-
.unlink = hostio_unlink,
123-
.stat = hostio_stat,
124-
.fstat = hostio_fstat,
125-
.gettimeofday = hostio_gettimeofday,
126-
.isatty = hostio_isatty,
127-
.system = hostio_system,
128-
#endif
129114
};
130115

131116
/* execute gdb remote command stored in 'pbuf'. returns immediately, no busy waiting. */

src/include/target.h

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -165,21 +165,6 @@ struct target_controller {
165165
void (*destroy_callback)(target_controller_s *, target_s *target);
166166
void (*printf)(target_controller_s *, const char *fmt, va_list);
167167

168-
#if PC_HOSTED == 0
169-
/* Interface to host system calls */
170-
int (*open)(target_controller_s *, target_addr_t path, size_t path_len, target_open_flags_e flags, mode_t mode);
171-
int (*close)(target_controller_s *, int fd);
172-
int (*read)(target_controller_s *, int fd, target_addr_t buf, unsigned int count);
173-
int (*write)(target_controller_s *, int fd, target_addr_t buf, unsigned int count);
174-
long (*lseek)(target_controller_s *, int fd, long offset, target_seek_flag_e flag);
175-
int (*rename)(target_controller_s *, target_addr_t oldpath, size_t old_len, target_addr_t newpath, size_t new_len);
176-
int (*unlink)(target_controller_s *, target_addr_t path, size_t path_len);
177-
int (*stat)(target_controller_s *, target_addr_t path, size_t path_len, target_addr_t buf);
178-
int (*fstat)(target_controller_s *, int fd, target_addr_t buf);
179-
int (*gettimeofday)(target_controller_s *, target_addr_t tv, target_addr_t tz);
180-
int (*isatty)(target_controller_s *, int fd);
181-
int (*system)(target_controller_s *, target_addr_t cmd, size_t cmd_len);
182-
#endif
183168
target_errno_e errno_;
184169
bool interrupted;
185170
};

src/target/semihosting.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
#include "target.h"
2525
#include "target_internal.h"
2626
#include "gdb_main.h"
27-
#include "gdb_hostio.h"
2827
#include "gdb_packet.h"
2928
#include "cortexm.h"
3029
#include "semihosting.h"

src/target/semihosting.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,6 @@
2626
#include "general.h"
2727

2828
int cortexm_hostio_request(target_s *target);
29+
int hostio_reply(target_controller_s *tc, char *packet, int len);
2930

3031
#endif /* TARGET_SEMIHOSTING_H */

0 commit comments

Comments
 (0)