OpenOCD
arm_semihosting.h File Reference
Include dependency graph for arm_semihosting.h:
This graph shows which files directly or indirectly include this file:

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...
 

Function Documentation

◆ arm_semihosting()

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.

Parameters
targetPointer to the ARM target to process. This target must not represent an ARMv6-M or ARMv7-M processor.
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 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().

◆ arm_semihosting_init()

int arm_semihosting_init ( struct target target)

Initialize ARM semihosting support.

Parameters
targetPointer to the ARM target to initialize.
Returns
An error status if there is a problem during initialization.

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().