OpenOCD
|
Hold ARM semihosting support. More...
Go to the source code of this file.
Functions | |
int | arm_semihosting (struct target *target, int *retval) |
Checks for and processes an ARM semihosting request. More... | |
int | arm_semihosting_init (struct target *target) |
Initialize ARM semihosting support. More... | |
static int | arm_semihosting_resume (struct target *target, int *retval) |
static int | post_result (struct target *target) |
Hold ARM semihosting support.
Semihosting enables code running on an ARM target to use the I/O facilities on the host computer. The target application must be linked against a library that forwards operation requests by using the SVC instruction trapped at the Supervisor Call vector by the debugger. Details can be found in chapter 8 of DUI0203I_rvct_developer_guide.pdf from ARM Ltd.
Definition in file arm_semihosting.c.
int arm_semihosting | ( | struct target * | target, |
int * | retval | ||
) |
Checks for and processes an ARM semihosting request.
This is meant to be called when the target is stopped due to a debug mode entry. If the value 0 is returned then there was nothing to process. A non-zero return value signifies that a request was processed and the target resumed, or an error was encountered, in which case the caller must return immediately.
target | Pointer to the ARM target to process. This target must not represent an ARMv6-M or ARMv7-M processor. |
retval | Pointer to a location where the return code will be stored |
Definition at line 172 of file arm_semihosting.c.
References armv7a_common::arm, ARM_MODE_SVC, arm_reg_current(), arm_semihosting_resume(), ARM_STATE_AARCH64, ARM_STATE_ARM, ARM_STATE_THUMB, ARMV4_5_MRC, buf_get_u32(), buf_get_u64(), arm::core_cache, arm::core_mode, arm::core_state, DBG_REASON_BREAKPOINT, target::debug_reason, arm::dpm, ERROR_FAIL, ERROR_OK, arm_dpm::finish, semihosting::hit_fileio, arm_dpm::instr_read_data_r0, semihosting::is_active, is_arm7_9(), is_armv7a(), is_armv7m(), is_armv8(), semihosting::is_resumable, LOG_ERROR, semihosting::op, semihosting::param, arm::pc, arm_dpm::prepare, reg_cache::reg_list, target::semihosting, semihosting_common(), arm::spsr, target_buffer_get_u16(), target_buffer_get_u32(), target_read_memory(), target_read_u16(), target_read_u32(), target_to_arm(), target_to_arm7_9(), target_to_armv7a(), target_to_armv7m(), target_to_armv8(), reg::valid, reg::value, and semihosting::word_size_bytes.
Referenced by aarch64_poll(), adapter_poll(), arm7_9_poll(), cortex_a_poll(), and cortex_m_poll().
int arm_semihosting_init | ( | struct target * | target | ) |
Initialize ARM semihosting support.
target | Pointer to the ARM target to initialize. |
Definition at line 150 of file arm_semihosting.c.
References ERROR_OK, post_result(), semihosting_common_init(), arm::setup_semihosting, and target_to_arm().
Referenced by aarch64_init_target(), adapter_init_target(), arm7tdmi_init_target(), arm9tdmi_init_target(), cortex_a_init_target(), and cortex_m_init_target().
|
static |
Definition at line 48 of file arm_semihosting.c.
References ARMV8_RUNCONTROL_RESUME, ARMV8_RUNCONTROL_STEP, DBG_REASON_SINGLESTEP, target::debug_reason, ERROR_OK, is_armv8(), armv8_common::last_run_control_op, LOG_ERROR, target_resume(), and target_to_armv8().
Referenced by arm_semihosting().
|
static |
Definition at line 70 of file arm_semihosting.c.
References arm_reg_current(), ARM_STATE_AARCH64, ARM_STATE_ARM, ARM_STATE_THUMB, buf_get_u32(), buf_get_u64(), buf_set_u32(), buf_set_u64(), arm::core_cache, arm::core_mode, arm::core_state, arm::cpsr, reg::dirty, ERROR_FAIL, ERROR_OK, is_arm7_9(), is_armv7a(), is_armv8(), arm::pc, reg_cache::reg_list, semihosting::result, target::semihosting, arm::spsr, target_to_arm(), target_to_arm7_9(), target_to_armv7a(), target_to_armv8(), and reg::value.
Referenced by arm_semihosting_init(), and semihosting_common_init().