OpenOCD
riscv_semihosting.c File Reference

Hold RISC-V semihosting support. More...

Include dependency graph for riscv_semihosting.c:

Go to the source code of this file.

Functions

enum semihosting_result riscv_semihosting (struct target *target, int *retval)
 Check for and process a semihosting request using the ARM protocol). More...
 
void riscv_semihosting_init (struct target *target)
 Initialize RISC-V semihosting. More...
 
static int riscv_semihosting_post_result (struct target *target)
 
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 command. More...
 

Detailed Description

Hold RISC-V semihosting support.

The RISC-V code is inspired from ARM semihosting.

Details can be found in chapter 8 of DUI0203I_rvct_developer_guide.pdf from ARM Ltd.

Definition in file riscv_semihosting.c.

Function Documentation

◆ riscv_semihosting()

enum semihosting_result riscv_semihosting ( struct target target,
int *  retval 
)

Check for and process a semihosting request using the ARM protocol).

This is meant to be called when the target is stopped due to a debug mode entry.

Parameters
targetPointer to the target to process.
retvalPointer to a location where the return code will be stored
Returns
non-zero value if a request was processed or an error encountered

Definition at line 42 of file riscv_semihosting.c.

References riscv_semihosting_post_result(), riscv_semihosting_setup(), and semihosting_common_init().

Referenced by handle_halt(), and riscv_openocd_poll().

◆ riscv_semihosting_init()

void riscv_semihosting_init ( struct target target)

Initialize RISC-V semihosting.

Use common ARM code.

Definition at line 42 of file riscv_semihosting.c.

Referenced by riscv_init_target().

◆ riscv_semihosting_post_result()

static int riscv_semihosting_post_result ( struct target target)
static

◆ riscv_semihosting_setup()

static int riscv_semihosting_setup ( struct target target,
int  enable 
)
static

Called via semihosting->setup() later, after the target is known, usually on the first semihosting command.

Definition at line 169 of file riscv_semihosting.c.

References ERROR_OK, LOG_DEBUG, target::semihosting, semihosting::setup_time, and target_name().

Referenced by riscv_semihosting().