OpenOCD
aarch64.c File Reference
Include dependency graph for aarch64.c:

Go to the source code of this file.

Data Structures

struct  aarch64_private_config
 

Enumerations

enum  aarch64_cfg_param { CFG_CTI }
 
enum  halt_mode { HALT_LAZY , HALT_SYNC }
 
enum  restart_mode { RESTART_LAZY , RESTART_SYNC }
 

Functions

static int aarch64_add_breakpoint (struct target *target, struct breakpoint *breakpoint)
 
static int aarch64_add_context_breakpoint (struct target *target, struct breakpoint *breakpoint)
 
static int aarch64_add_hybrid_breakpoint (struct target *target, struct breakpoint *breakpoint)
 
static int aarch64_add_watchpoint (struct target *target, struct watchpoint *watchpoint)
 
static int aarch64_assert_reset (struct target *target)
 
static int aarch64_check_state_one (struct target *target, uint32_t mask, uint32_t val, int *p_result, uint32_t *p_prsr)
 
static int aarch64_clear_reset_catch (struct target *target)
 
static int aarch64_dap_write_memap_register_u32 (struct target *target, target_addr_t address, uint32_t value)
 
static int aarch64_deassert_reset (struct target *target)
 
static int aarch64_debug_entry (struct target *target)
 
static void aarch64_deinit_target (struct target *target)
 
static int aarch64_do_restart_one (struct target *target, enum restart_mode mode)
 
static int aarch64_dpm_setup (struct aarch64_common *a8, uint64_t debug)
 
static int aarch64_enable_reset_catch (struct target *target, bool enable)
 
static int aarch64_examine (struct target *target)
 
static int aarch64_examine_first (struct target *target)
 
static int aarch64_halt (struct target *target)
 
static int aarch64_halt_one (struct target *target, enum halt_mode mode)
 
static int aarch64_halt_smp (struct target *target, bool exc_target)
 
static int aarch64_handle_target_request (void *priv)
 
static int aarch64_hit_watchpoint (struct target *target, struct watchpoint **hit_watchpoint)
 find out which watchpoint hits get exception address and compare the address to watchpoints More...
 
static int aarch64_init_arch_info (struct target *target, struct aarch64_common *aarch64, struct adiv5_dap *dap)
 
static int aarch64_init_debug_access (struct target *target)
 
static int aarch64_init_target (struct command_context *cmd_ctx, struct target *target)
 
static int aarch64_jim_configure (struct target *target, struct jim_getopt_info *goi)
 
static int aarch64_mmu (struct target *target, int *enabled)
 
static int aarch64_mmu_modify (struct target *target, int enable)
 
static int aarch64_poll (struct target *target)
 
static int aarch64_post_debug_entry (struct target *target)
 
static int aarch64_prep_restart_smp (struct target *target, int handle_breakpoints, struct target **p_first)
 
static int aarch64_prepare_halt_smp (struct target *target, bool exc_target, struct target **p_first)
 
static int aarch64_prepare_restart_one (struct target *target)
 prepare single target for restart More...
 
static int aarch64_read_cpu_memory (struct target *target, uint64_t address, uint32_t size, uint32_t count, uint8_t *buffer)
 
static int aarch64_read_cpu_memory_fast (struct target *target, uint32_t count, uint8_t *buffer, uint32_t *dscr)
 
static int aarch64_read_cpu_memory_slow (struct target *target, uint32_t size, uint32_t count, uint8_t *buffer, uint32_t *dscr)
 
static int aarch64_read_memory (struct target *target, target_addr_t address, uint32_t size, uint32_t count, uint8_t *buffer)
 
static int aarch64_read_phys_memory (struct target *target, target_addr_t address, uint32_t size, uint32_t count, uint8_t *buffer)
 
static int aarch64_remove_breakpoint (struct target *target, struct breakpoint *breakpoint)
 
static int aarch64_remove_watchpoint (struct target *target, struct watchpoint *watchpoint)
 
static int aarch64_restart_one (struct target *target, enum restart_mode mode)
 
static int aarch64_restore_context (struct target *target, bool bpwp)
 
static int aarch64_restore_one (struct target *target, int current, uint64_t *address, int handle_breakpoints, int debug_execution)
 
static int aarch64_restore_system_control_reg (struct target *target)
 
static int aarch64_resume (struct target *target, int current, target_addr_t address, int handle_breakpoints, int debug_execution)
 
static int aarch64_set_breakpoint (struct target *target, struct breakpoint *breakpoint, uint8_t matchmode)
 
static int aarch64_set_context_breakpoint (struct target *target, struct breakpoint *breakpoint, uint8_t matchmode)
 
static int aarch64_set_dscr_bits (struct target *target, unsigned long bit_mask, unsigned long value)
 
static int aarch64_set_hybrid_breakpoint (struct target *target, struct breakpoint *breakpoint)
 
static int aarch64_set_watchpoint (struct target *target, struct watchpoint *watchpoint)
 
static int aarch64_step (struct target *target, int current, target_addr_t address, int handle_breakpoints)
 
static int aarch64_step_restart_smp (struct target *target)
 
static int aarch64_target_create (struct target *target, Jim_Interp *interp)
 
static int aarch64_unset_breakpoint (struct target *target, struct breakpoint *breakpoint)
 
static int aarch64_unset_watchpoint (struct target *target, struct watchpoint *watchpoint)
 
static int aarch64_virt2phys (struct target *target, target_addr_t virt, target_addr_t *phys)
 
static int aarch64_wait_halt_one (struct target *target)
 
static int aarch64_write_cpu_memory (struct target *target, uint64_t address, uint32_t size, uint32_t count, const uint8_t *buffer)
 
static int aarch64_write_cpu_memory_fast (struct target *target, uint32_t count, const uint8_t *buffer, uint32_t *dscr)
 
static int aarch64_write_cpu_memory_slow (struct target *target, uint32_t size, uint32_t count, const uint8_t *buffer, uint32_t *dscr)
 
static int aarch64_write_memory (struct target *target, target_addr_t address, uint32_t size, uint32_t count, const uint8_t *buffer)
 
static int aarch64_write_phys_memory (struct target *target, target_addr_t address, uint32_t size, uint32_t count, const uint8_t *buffer)
 
 COMMAND_HANDLER (aarch64_handle_cache_info_command)
 
 COMMAND_HANDLER (aarch64_handle_dbginit_command)
 
 COMMAND_HANDLER (aarch64_handle_disassemble_command)
 
 COMMAND_HANDLER (aarch64_mask_interrupts_command)
 
static int jim_mcrmrc (Jim_Interp *interp, int argc, Jim_Obj *const *argv)
 
static int update_halt_gdb (struct target *target, enum target_debug_reason debug_reason)
 

Variables

static const struct command_registration aarch64_command_handlers []
 
static const struct command_registration aarch64_exec_command_handlers []
 
struct target_type aarch64_target
 
static const struct jim_nvp nvp_config_opts []
 

Enumeration Type Documentation

◆ aarch64_cfg_param

Enumerator
CFG_CTI 

Definition at line 2783 of file aarch64.c.

◆ halt_mode

enum halt_mode
Enumerator
HALT_LAZY 
HALT_SYNC 

Definition at line 31 of file aarch64.c.

◆ restart_mode

Enumerator
RESTART_LAZY 
RESTART_SYNC 

Definition at line 26 of file aarch64.c.

Function Documentation

◆ aarch64_add_breakpoint()

static int aarch64_add_breakpoint ( struct target target,
struct breakpoint breakpoint 
)
static

◆ aarch64_add_context_breakpoint()

static int aarch64_add_context_breakpoint ( struct target target,
struct breakpoint breakpoint 
)
static

◆ aarch64_add_hybrid_breakpoint()

static int aarch64_add_hybrid_breakpoint ( struct target target,
struct breakpoint breakpoint 
)
static

◆ aarch64_add_watchpoint()

static int aarch64_add_watchpoint ( struct target target,
struct watchpoint watchpoint 
)
static

◆ aarch64_assert_reset()

◆ aarch64_check_state_one()

static int aarch64_check_state_one ( struct target target,
uint32_t  mask,
uint32_t  val,
int *  p_result,
uint32_t *  p_prsr 
)
static

◆ aarch64_clear_reset_catch()

static int aarch64_clear_reset_catch ( struct target target)
static

◆ aarch64_dap_write_memap_register_u32()

static int aarch64_dap_write_memap_register_u32 ( struct target target,
target_addr_t  address,
uint32_t  value 
)
static

◆ aarch64_deassert_reset()

◆ aarch64_debug_entry()

◆ aarch64_deinit_target()

◆ aarch64_do_restart_one()

◆ aarch64_dpm_setup()

static int aarch64_dpm_setup ( struct aarch64_common a8,
uint64_t  debug 
)
static

◆ aarch64_enable_reset_catch()

static int aarch64_enable_reset_catch ( struct target target,
bool  enable 
)
static

◆ aarch64_examine()

static int aarch64_examine ( struct target target)
static

◆ aarch64_examine_first()

◆ aarch64_halt()

static int aarch64_halt ( struct target target)
static

◆ aarch64_halt_one()

◆ aarch64_halt_smp()

◆ aarch64_handle_target_request()

◆ aarch64_hit_watchpoint()

static int aarch64_hit_watchpoint ( struct target target,
struct watchpoint **  hit_watchpoint 
)
static

find out which watchpoint hits get exception address and compare the address to watchpoints

Definition at line 1840 of file aarch64.c.

References watchpoint::address, DBG_REASON_WATCHPOINT, target::debug_reason, armv8_common::dpm, ERROR_FAIL, ERROR_OK, watchpoint::length, watchpoint::next, target_to_armv8(), target::watchpoints, and arm_dpm::wp_addr.

◆ aarch64_init_arch_info()

◆ aarch64_init_debug_access()

◆ aarch64_init_target()

static int aarch64_init_target ( struct command_context cmd_ctx,
struct target target 
)
static

Definition at line 2699 of file aarch64.c.

References arm_semihosting_init(), and ERROR_OK.

◆ aarch64_jim_configure()

◆ aarch64_mmu()

static int aarch64_mmu ( struct target target,
int *  enabled 
)
static

◆ aarch64_mmu_modify()

◆ aarch64_poll()

◆ aarch64_post_debug_entry()

◆ aarch64_prep_restart_smp()

static int aarch64_prep_restart_smp ( struct target target,
int  handle_breakpoints,
struct target **  p_first 
)
static

◆ aarch64_prepare_halt_smp()

◆ aarch64_prepare_restart_one()

◆ aarch64_read_cpu_memory()

◆ aarch64_read_cpu_memory_fast()

◆ aarch64_read_cpu_memory_slow()

◆ aarch64_read_memory()

static int aarch64_read_memory ( struct target target,
target_addr_t  address,
uint32_t  size,
uint32_t  count,
uint8_t *  buffer 
)
static

◆ aarch64_read_phys_memory()

static int aarch64_read_phys_memory ( struct target target,
target_addr_t  address,
uint32_t  size,
uint32_t  count,
uint8_t *  buffer 
)
static

◆ aarch64_remove_breakpoint()

static int aarch64_remove_breakpoint ( struct target target,
struct breakpoint breakpoint 
)
static

◆ aarch64_remove_watchpoint()

static int aarch64_remove_watchpoint ( struct target target,
struct watchpoint watchpoint 
)
static

◆ aarch64_restart_one()

static int aarch64_restart_one ( struct target target,
enum restart_mode  mode 
)
static

◆ aarch64_restore_context()

static int aarch64_restore_context ( struct target target,
bool  bpwp 
)
static

◆ aarch64_restore_one()

◆ aarch64_restore_system_control_reg()

◆ aarch64_resume()

◆ aarch64_set_breakpoint()

static int aarch64_set_breakpoint ( struct target target,
struct breakpoint breakpoint,
uint8_t  matchmode 
)
static

◆ aarch64_set_context_breakpoint()

◆ aarch64_set_dscr_bits()

static int aarch64_set_dscr_bits ( struct target target,
unsigned long  bit_mask,
unsigned long  value 
)
static

◆ aarch64_set_hybrid_breakpoint()

◆ aarch64_set_watchpoint()

◆ aarch64_step()

◆ aarch64_step_restart_smp()

◆ aarch64_target_create()

static int aarch64_target_create ( struct target target,
Jim_Interp *  interp 
)
static

◆ aarch64_unset_breakpoint()

◆ aarch64_unset_watchpoint()

◆ aarch64_virt2phys()

static int aarch64_virt2phys ( struct target target,
target_addr_t  virt,
target_addr_t phys 
)
static

Definition at line 2774 of file aarch64.c.

References armv8_mmu_translate_va_pa().

◆ aarch64_wait_halt_one()

static int aarch64_wait_halt_one ( struct target target)
static

◆ aarch64_write_cpu_memory()

◆ aarch64_write_cpu_memory_fast()

static int aarch64_write_cpu_memory_fast ( struct target target,
uint32_t  count,
const uint8_t *  buffer,
uint32_t *  dscr 
)
static

◆ aarch64_write_cpu_memory_slow()

◆ aarch64_write_memory()

static int aarch64_write_memory ( struct target target,
target_addr_t  address,
uint32_t  size,
uint32_t  count,
const uint8_t *  buffer 
)
static

◆ aarch64_write_phys_memory()

static int aarch64_write_phys_memory ( struct target target,
target_addr_t  address,
uint32_t  size,
uint32_t  count,
const uint8_t *  buffer 
)
static

◆ COMMAND_HANDLER() [1/4]

COMMAND_HANDLER ( aarch64_handle_cache_info_command  )

◆ COMMAND_HANDLER() [2/4]

COMMAND_HANDLER ( aarch64_handle_dbginit_command  )

◆ COMMAND_HANDLER() [3/4]

◆ COMMAND_HANDLER() [4/4]

◆ jim_mcrmrc()

static int jim_mcrmrc ( Jim_Interp *  interp,
int  argc,
Jim_Obj *const *  argv 
)
static

Definition at line 2955 of file aarch64.c.

◆ update_halt_gdb()

Variable Documentation

◆ aarch64_command_handlers

const struct command_registration aarch64_command_handlers[]
static
Initial value:
= {
{
.name = "arm",
.mode = COMMAND_ANY,
.help = "ARM Command Group",
.usage = "",
},
{
},
{
.name = "aarch64",
.mode = COMMAND_ANY,
.help = "Aarch64 command group",
.usage = "",
},
}
static const struct command_registration aarch64_exec_command_handlers[]
Definition: aarch64.c:3093
const struct command_registration armv8_command_handlers[]
Definition: armv8.c:1740
#define COMMAND_REGISTRATION_DONE
Use this as the last entry in an array of command_registration records.
Definition: command.h:247
@ COMMAND_ANY
Definition: command.h:42
const struct command_registration semihosting_common_handlers[]
const char * name
Definition: command.h:229
const struct command_registration * chain
If non-NULL, the commands in chain will be registered in the same context and scope of this registrat...
Definition: command.h:243

Definition at line 2955 of file aarch64.c.

◆ aarch64_exec_command_handlers

const struct command_registration aarch64_exec_command_handlers[]
static

Definition at line 2955 of file aarch64.c.

◆ aarch64_target

struct target_type aarch64_target

Definition at line 2955 of file aarch64.c.

◆ nvp_config_opts

const struct jim_nvp nvp_config_opts[]
static
Initial value:
= {
{ .name = "-cti", .value = CFG_CTI },
{ .name = NULL, .value = -1 }
}
@ CFG_CTI
Definition: aarch64.c:2784
#define NULL
Definition: usb.h:16

Definition at line 2774 of file aarch64.c.

Referenced by aarch64_jim_configure().