OpenOCD
|
Go to the source code of this file.
Data Structures | |
struct | semihosting |
Macros | |
#define | SEMIHOSTING_MAX_TCL_COMMAND_FIELD_LENGTH (1024 * 1024) |
Maximum allowed Tcl command segment length in bytes. More... | |
Functions | |
int | semihosting_common (struct target *target) |
Portable implementation of ARM semihosting calls. More... | |
int | semihosting_common_init (struct target *target, void *setup, void *post_result) |
Initialize common semihosting support. More... | |
uint64_t | semihosting_get_field (struct target *target, size_t index, uint8_t *fields) |
Extract a field from the buffer, considering register size and endianness. More... | |
const char * | semihosting_opcode_to_str (uint64_t opcode) |
Convert the syscall opcode to a human-readable string. More... | |
int | semihosting_read_fields (struct target *target, size_t number, uint8_t *fields) |
Read all fields of a command from target to buffer. More... | |
void | semihosting_set_field (struct target *target, uint64_t value, size_t index, uint8_t *fields) |
Store a field in the buffer, considering register size and endianness. More... | |
int | semihosting_write_fields (struct target *target, size_t number, uint8_t *fields) |
Write all fields of a command from buffer to target. More... | |
Variables | |
const struct command_registration | semihosting_common_handlers [] |
#define SEMIHOSTING_MAX_TCL_COMMAND_FIELD_LENGTH (1024 * 1024) |
Maximum allowed Tcl command segment length in bytes.
Definition at line 76 of file semihosting_common.h.
Definition at line 38 of file semihosting_common.h.
Enumerator | |
---|---|
SEMIHOSTING_REDIRECT_CFG_NONE | |
SEMIHOSTING_REDIRECT_CFG_DEBUG | |
SEMIHOSTING_REDIRECT_CFG_STDIO | |
SEMIHOSTING_REDIRECT_CFG_ALL |
Definition at line 90 of file semihosting_common.h.
Enumerator | |
---|---|
ADP_STOPPED_APPLICATION_EXIT | |
ADP_STOPPED_RUN_TIME_ERROR |
Definition at line 83 of file semihosting_common.h.
enum semihosting_result |
Enumerator | |
---|---|
SEMIHOSTING_NONE | |
SEMIHOSTING_HANDLED | |
SEMIHOSTING_WAITING | |
SEMIHOSTING_ERROR |
Definition at line 97 of file semihosting_common.h.
int semihosting_common | ( | struct target * | target | ) |
Portable implementation of ARM semihosting calls.
Performs the currently pending semihosting operation encoded in target->semihosting.
This is a user defined operation (while user cmds 0x100-0x1ff are possible, only 0x100-0x107 are currently implemented).
Reads the user operation parameters from target, then fires the corresponding target event. When the target callbacks returned, cleans up the command parameter buffer.
Entry On entry, the PARAMETER REGISTER contains a pointer to a two-field data block:
Return On exit, the RETURN REGISTER contains the return status.
Definition at line 366 of file semihosting_common.c.
References addr, ADP_STOPPED_APPLICATION_EXIT, ADP_STOPPED_RUN_TIME_ERROR, semihosting::basedir, cmd, semihosting::cmdline, count, ENOTSUP, ERROR_FAIL, ERROR_NOT_IMPLEMENTED, ERROR_OK, target::fileio_info, gdb_get_actual_connections(), semihosting::has_resumable_exit, semihosting::hit_fileio, gdb_fileio_info::identifier, semihosting::is_fileio, semihosting::is_resumable, LOG_DEBUG, LOG_ERROR, mode, NULL, semihosting::op, open_gdb_modeflags, open_host_modeflags, semihosting::param, gdb_fileio_info::param_1, gdb_fileio_info::param_2, gdb_fileio_info::param_3, gdb_fileio_info::param_4, semihosting::post_result, semihosting::result, target::semihosting, semihosting_get_field(), semihosting_getchar(), SEMIHOSTING_MAX_TCL_COMMAND_FIELD_LENGTH, semihosting_opcode_to_str(), semihosting_putchar(), semihosting_read(), semihosting_read_fields(), semihosting_set_field(), SEMIHOSTING_SYS_CLOCK, SEMIHOSTING_SYS_CLOSE, SEMIHOSTING_SYS_ELAPSED, SEMIHOSTING_SYS_ERRNO, SEMIHOSTING_SYS_EXIT, SEMIHOSTING_SYS_EXIT_EXTENDED, SEMIHOSTING_SYS_FLEN, SEMIHOSTING_SYS_GET_CMDLINE, SEMIHOSTING_SYS_HEAPINFO, SEMIHOSTING_SYS_ISERROR, SEMIHOSTING_SYS_ISTTY, SEMIHOSTING_SYS_OPEN, SEMIHOSTING_SYS_READ, SEMIHOSTING_SYS_READC, SEMIHOSTING_SYS_REMOVE, SEMIHOSTING_SYS_RENAME, SEMIHOSTING_SYS_SEEK, SEMIHOSTING_SYS_SYSTEM, SEMIHOSTING_SYS_TICKFREQ, SEMIHOSTING_SYS_TIME, SEMIHOSTING_SYS_TMPNAM, SEMIHOSTING_SYS_WRITE, SEMIHOSTING_SYS_WRITE0, SEMIHOSTING_SYS_WRITEC, SEMIHOSTING_USER_CMD_0X100, SEMIHOSTING_USER_CMD_0X107, semihosting_user_op_params, semihosting_write(), semihosting_write_fields(), semihosting::setup_time, size, semihosting::stderr_fd, semihosting::stdin_fd, semihosting::stdout_fd, semihosting::sys_errno, target_call_event_callbacks(), TARGET_EVENT_HALTED, target_handle_event(), target_read_buffer(), target_read_memory(), target_write_buffer(), target_write_memory(), type, semihosting::user_command_extension, and semihosting::word_size_bytes.
Referenced by arm_semihosting(), and esp_xtensa_semihosting().
int semihosting_common_init | ( | struct target * | target, |
void * | setup, | ||
void * | post_result | ||
) |
Initialize common semihosting support.
target | Pointer to the target to initialize. |
setup | |
post_result |
Definition at line 104 of file semihosting_common.c.
References semihosting::basedir, semihosting::cmdline, ERROR_FAIL, ERROR_OK, target::fileio_info, target_type::gdb_fileio_end, target_type::get_gdb_fileio_info, semihosting::has_resumable_exit, semihosting::hit_fileio, semihosting::is_active, semihosting::is_fileio, semihosting::is_resumable, LOG_DEBUG, LOG_ERROR, NULL, semihosting::op, semihosting::param, post_result(), semihosting::post_result, semihosting::redirect_cfg, semihosting::result, target::semihosting, semihosting_common_fileio_end(), semihosting_common_fileio_info(), SEMIHOSTING_REDIRECT_CFG_NONE, semihosting::setup, semihosting::setup_time, semihosting::stderr_fd, semihosting::stdin_fd, semihosting::stdout_fd, semihosting::sys_errno, semihosting::tcp_connection, target::type, semihosting::user_command_extension, and semihosting::word_size_bytes.
Referenced by arm_semihosting_init(), riscv_semihosting(), and xtensa_semihosting_init().
uint64_t semihosting_get_field | ( | struct target * | target, |
size_t | index, | ||
uint8_t * | fields | ||
) |
Extract a field from the buffer, considering register size and endianness.
Definition at line 1744 of file semihosting_common.c.
References target::semihosting, target_buffer_get_u32(), target_buffer_get_u64(), and semihosting::word_size_bytes.
Referenced by esp_semihosting_common(), and semihosting_common().
const char* semihosting_opcode_to_str | ( | uint64_t | opcode | ) |
Convert the syscall opcode to a human-readable string.
[in] | opcode | Syscall opcode |
Definition at line 301 of file semihosting_common.c.
References SEMIHOSTING_ARM_RESERVED_END, SEMIHOSTING_ARM_RESERVED_START, SEMIHOSTING_SYS_CLOCK, SEMIHOSTING_SYS_CLOSE, SEMIHOSTING_SYS_ELAPSED, SEMIHOSTING_SYS_ERRNO, SEMIHOSTING_SYS_EXIT, SEMIHOSTING_SYS_EXIT_EXTENDED, SEMIHOSTING_SYS_FLEN, SEMIHOSTING_SYS_GET_CMDLINE, SEMIHOSTING_SYS_HEAPINFO, SEMIHOSTING_SYS_ISERROR, SEMIHOSTING_SYS_ISTTY, SEMIHOSTING_SYS_OPEN, SEMIHOSTING_SYS_READ, SEMIHOSTING_SYS_READC, SEMIHOSTING_SYS_REMOVE, SEMIHOSTING_SYS_RENAME, SEMIHOSTING_SYS_SEEK, SEMIHOSTING_SYS_SYSTEM, SEMIHOSTING_SYS_TICKFREQ, SEMIHOSTING_SYS_TIME, SEMIHOSTING_SYS_TMPNAM, SEMIHOSTING_SYS_WRITE, SEMIHOSTING_SYS_WRITE0, SEMIHOSTING_SYS_WRITEC, SEMIHOSTING_USER_CMD_0X100, and SEMIHOSTING_USER_CMD_0X1FF.
Referenced by semihosting_common().
int semihosting_read_fields | ( | struct target * | target, |
size_t | number, | ||
uint8_t * | fields | ||
) |
Read all fields of a command from target to buffer.
Definition at line 1720 of file semihosting_common.c.
References number, semihosting::param, target::semihosting, target_read_memory(), and semihosting::word_size_bytes.
Referenced by esp_semihosting_common(), and semihosting_common().
void semihosting_set_field | ( | struct target * | target, |
uint64_t | value, | ||
size_t | index, | ||
uint8_t * | fields | ||
) |
Store a field in the buffer, considering register size and endianness.
Definition at line 1757 of file semihosting_common.c.
References target::semihosting, target_buffer_set_u32(), target_buffer_set_u64(), and semihosting::word_size_bytes.
Referenced by semihosting_common().
int semihosting_write_fields | ( | struct target * | target, |
size_t | number, | ||
uint8_t * | fields | ||
) |
Write all fields of a command from buffer to target.
Definition at line 1732 of file semihosting_common.c.
References number, semihosting::param, target::semihosting, target_write_memory(), and semihosting::word_size_bytes.
Referenced by semihosting_common().
|
extern |
Definition at line 2077 of file semihosting_common.c.