65 LOG_DEBUG(
" -> NONE (!semihosting->is_active)");
77 for (
int i = 0; i < 3; i++) {
95 LOG_DEBUG(
"check %08x %08x %08x from 0x%" PRIx64
"-4", pre,
ebreak, post, pc);
97 if (pre != 0x01f01013 ||
ebreak != 0x00100073 || post != 0x40705013) {
114 LOG_DEBUG(
" -> ERROR (couldn't read a0)");
120 LOG_DEBUG(
" -> ERROR (couldn't read a1)");
139 LOG_DEBUG(
" -> NONE (unknown operation number)");
#define LOG_ERROR(expr ...)
#define LOG_DEBUG(expr ...)
static uint32_t ebreak(void) __attribute__((unused))
int riscv_set_register(struct target *target, enum gdb_regno regid, riscv_reg_t value)
This function is called when the debug user wants to change the value of a register.
int riscv_read_by_any_size(struct target *target, target_addr_t address, uint32_t size, uint8_t *buffer)
Read one memory item using any memory access size that will work.
unsigned riscv_xlen(const struct target *target)
int riscv_get_register(struct target *target, riscv_reg_t *value, enum gdb_regno regid)
Get register, from the cache if it's in there.
static int riscv_semihosting_post_result(struct target *target)
void riscv_semihosting_init(struct target *target)
Initialize RISC-V semihosting.
enum semihosting_result riscv_semihosting(struct target *target, int *retval)
Check for and process a semihosting request using the ARM protocol).
static int riscv_semihosting_setup(struct target *target, int enable)
Called via semihosting->setup() later, after the target is known, usually on the first semihosting co...
int semihosting_common_init(struct target *target, void *setup, void *post_result)
Initialize common semihosting support.
int semihosting_common(struct target *target)
Portable implementation of ARM semihosting calls.
bool is_resumable
Most are resumable, except the two exit calls.
bool hit_fileio
A flag reporting whether semihosting fileio operation is active.
size_t word_size_bytes
The Target (hart) word size; 8 for 64-bits targets.
int64_t result
The current semihosting result to be returned to the application.
bool is_active
A flag reporting whether semihosting is active.
int op
The current semihosting operation (R0 on ARM).
uint64_t param
The current semihosting parameter (R1 or ARM).
clock_t setup_time
The current time when 'execution starts'.
struct semihosting * semihosting
uint32_t target_buffer_get_u32(struct target *target, const uint8_t *buffer)
static const char * target_name(struct target *target)
Returns the instance-specific name of the specified target.