OpenOCD
|
Go to the source code of this file.
Functions | |
int | nds32_add_software_breakpoint (struct target *target, struct breakpoint *breakpoint) |
int | nds32_arch_state (struct target *target) |
int | nds32_assert_reset (struct target *target) |
static struct reg_cache * | nds32_build_reg_cache (struct target *target, struct nds32 *nds32) |
int | nds32_cache_sync (struct target *target, target_addr_t address, uint32_t length) |
static int | nds32_callback_event_handler (struct target *target, enum target_event event, void *priv) |
static int | nds32_check_extension (struct nds32 *nds32) |
If fpu/audio is disabled, to access fpu/audio registers will cause exceptions. More... | |
int | nds32_config (struct nds32 *nds32) |
int | nds32_edm_config (struct nds32 *nds32) |
int | nds32_examine_debug_reason (struct nds32 *nds32) |
int | nds32_full_context (struct nds32 *nds32) |
static int | nds32_gdb_attach (struct nds32 *nds32) |
static int | nds32_gdb_detach (struct nds32 *nds32) |
int | nds32_gdb_fileio_end (struct target *target, int retcode, int fileio_errno, bool ctrl_c) |
int | nds32_gdb_fileio_write_memory (struct nds32 *nds32, uint32_t address, uint32_t size, const uint8_t *buffer) |
static int | nds32_get_all_reg_list (struct nds32 *nds32, struct reg **reg_list[], int *reg_list_size) |
get all register list More... | |
static int | nds32_get_core_reg (struct reg *reg) |
static int | nds32_get_core_reg_64 (struct reg *reg) |
int | nds32_get_gdb_fileio_info (struct target *target, struct gdb_fileio_info *fileio_info) |
int | nds32_get_gdb_reg_list (struct target *target, struct reg **reg_list[], int *reg_list_size, enum target_register_class reg_class) |
get all register list More... | |
static int | nds32_get_general_reg_list (struct nds32 *nds32, struct reg **reg_list[], int *reg_list_size) |
get general register list More... | |
int | nds32_get_mapped_reg (struct nds32 *nds32, unsigned regnum, uint32_t *value) |
int | nds32_halt (struct target *target) |
int | nds32_init (struct nds32 *nds32) |
int | nds32_init_arch_info (struct target *target, struct nds32 *nds32) |
static void | nds32_init_config (struct nds32 *nds32) |
static int | nds32_init_memory_config (struct nds32 *nds32) |
static void | nds32_init_must_have_registers (struct nds32 *nds32) |
static int | nds32_init_option_registers (struct nds32 *nds32) |
int | nds32_init_register_table (struct nds32 *nds32) |
int | nds32_login (struct nds32 *nds32) |
int | nds32_mmu (struct target *target, int *enabled) |
uint32_t | nds32_nextpc (struct nds32 *nds32, int current, uint32_t address) |
int | nds32_poll (struct target *target) |
int | nds32_profiling (struct target *target, uint32_t *samples, uint32_t max_num_samples, uint32_t *num_samples, uint32_t seconds) |
int | nds32_read_buffer (struct target *target, uint32_t address, uint32_t size, uint8_t *buffer) |
int | nds32_read_memory (struct target *target, uint32_t address, uint32_t size, uint32_t count, uint8_t *buffer) |
int | nds32_read_phys_memory (struct target *target, target_addr_t address, uint32_t size, uint32_t count, uint8_t *buffer) |
static int | nds32_reg_cache_init (struct target *target, struct nds32 *nds32) |
static struct reg * | nds32_reg_current (struct nds32 *nds32, unsigned regnum) |
int | nds32_remove_software_breakpoint (struct target *target, struct breakpoint *breakpoint) |
int | nds32_reset_halt (struct nds32 *nds32) |
int | nds32_restore_context (struct target *target) |
Restore the processor context on an Andes target. More... | |
int | nds32_resume (struct target *target, int current, target_addr_t address, int handle_breakpoints, int debug_execution) |
static int | nds32_select_memory_mode (struct target *target, uint32_t address, uint32_t length, uint32_t *end_address) |
static int | nds32_set_core_reg (struct reg *reg, uint8_t *buf) |
static int | nds32_set_core_reg_64 (struct reg *reg, uint8_t *buf) |
int | nds32_set_mapped_reg (struct nds32 *nds32, unsigned regnum, uint32_t value) |
set register internally More... | |
static int | nds32_soft_reset_halt (struct target *target) |
int | nds32_step (struct target *target, int current, target_addr_t address, int handle_breakpoints) |
static int | nds32_step_without_watchpoint (struct nds32 *nds32) |
int | nds32_target_state (struct nds32 *nds32, enum target_state *state) |
static int | nds32_update_cache_info (struct nds32 *nds32) |
static int | nds32_update_lm_info (struct nds32 *nds32) |
static int | nds32_update_mmu_info (struct nds32 *nds32) |
static int | nds32_update_psw (struct nds32 *nds32) |
int | nds32_virtual_to_physical (struct target *target, target_addr_t address, target_addr_t *physical) |
int | nds32_write_buffer (struct target *target, uint32_t address, uint32_t size, const uint8_t *buffer) |
int | nds32_write_memory (struct target *target, uint32_t address, uint32_t size, uint32_t count, const uint8_t *buffer) |
int | nds32_write_phys_memory (struct target *target, target_addr_t address, uint32_t size, uint32_t count, const uint8_t *buffer) |
Variables | |
const char * | nds32_debug_type_name [11] |
struct nds32_edm_operation | nds32_edm_ops [NDS32_EDM_OPERATION_MAX_NUM] |
uint32_t | nds32_edm_ops_num |
static const int | nds32_line_size_table [6] |
static const int | nds32_lm_size_table [16] |
static const struct reg_arch_type | nds32_reg_access_type |
static const struct reg_arch_type | nds32_reg_access_type_64 |
int nds32_add_software_breakpoint | ( | struct target * | target, |
struct breakpoint * | breakpoint | ||
) |
Definition at line 1431 of file nds32.c.
References breakpoint::address, ERROR_FAIL, ERROR_OK, breakpoint::length, NDS32_BREAK_16, NDS32_BREAK_32, nds32_cache_sync(), breakpoint::orig_instr, target_type::read_buffer, target::type, and target_type::write_buffer.
Referenced by nds32_v2_add_breakpoint(), nds32_v3_add_breakpoint(), and nds32_v3m_add_breakpoint().
int nds32_arch_state | ( | struct target * | target | ) |
Definition at line 964 of file nds32.c.
References buf_set_u32(), nds32::common_magic, debug_reason_name(), ERROR_FAIL, ERROR_OK, IR0, LOG_ERROR, LOG_USER, NDS32_COMMON_MAGIC, nds32_get_mapped_reg(), PC, target::reg_cache, register_get_by_name(), target_to_nds32(), reg::value, and nds32::virtual_hosting.
int nds32_assert_reset | ( | struct target * | target | ) |
Definition at line 2176 of file nds32.c.
References aice_assert_srst(), AICE_RESET_HOLD, AICE_SRST, alive_sleep(), nds32::boot_time, nds32::core_cache, nds32_cpu_version::cpu_id_family, nds32_cpu_version::cpu_id_version, nds32::cpu_version, nds32::edm, ERROR_OK, ERROR_TARGET_NOT_EXAMINED, LOG_WARNING, nds32_login(), nds32_soft_reset_halt(), register_cache_invalidate(), target::reset_halt, nds32_cpu_version::revision, nds32::soft_reset_halt, target::state, TARGET_RESET, target_to_aice(), target_to_nds32(), target_was_examined(), and nds32_edm::version.
|
static |
Definition at line 381 of file nds32.c.
References reg::arch_info, reg::caller_save, CBE3, nds32::core_cache, CR0, D0L24, nds32_reg::enable, FD0, FD31, reg::feature, FPCFG, FPCSR, FS0, FS31, reg::group, reg_data_type::id, IFC_LP, reg_feature::name, reg::name, reg_cache::name, nds32_reg::nds32, nds32_reg_access_type, nds32_reg_access_type_64, nds32_reg_simple_name(), nds32_reg_size(), reg_cache::next, NULL, nds32_reg::num, reg_cache::num_regs, reg::number, PC, R0, R16, R25, R28, R29, R30, R31, reg::reg_data_type, reg_cache::reg_list, REG_TYPE_CODE_PTR, REG_TYPE_DATA_PTR, REG_TYPE_IEEE_DOUBLE, REG_TYPE_IEEE_SINGLE, REG_TYPE_UINT32, SECUR0, reg::size, target, nds32_reg::target, TOTAL_REG_NUM, reg_data_type::type, reg::type, nds32_reg::value, and reg::value.
Referenced by nds32_reg_cache_init().
int nds32_cache_sync | ( | struct target * | target, |
target_addr_t | address, | ||
uint32_t | length | ||
) |
Definition at line 1680 of file nds32.c.
References aice_cache_ctl(), AICE_CACHE_CTL_L1D_VA_INVAL, AICE_CACHE_CTL_L1D_VA_WB, AICE_CACHE_CTL_L1I_VA_INVAL, nds32_memory::dcache, nds32_cache::enable, ERROR_FAIL, ERROR_OK, nds32_memory::icache, length, nds32_cache::line_size, nds32::memory, nds32_line_size_table, target_to_aice(), target_to_nds32(), target::type, and target_type::virt2phys.
Referenced by nds32_add_software_breakpoint(), and nds32_remove_software_breakpoint().
|
static |
Definition at line 2260 of file nds32.c.
References ERROR_OK, nds32_gdb_attach(), nds32_gdb_detach(), priv, TARGET_EVENT_GDB_ATTACH, TARGET_EVENT_GDB_DETACH, target::target_number, and target_to_nds32().
Referenced by nds32_init().
|
static |
If fpu/audio is disabled, to access fpu/audio registers will cause exceptions.
So, we need to check if fpu/audio is enabled or not as target is halted. If fpu/audio is disabled, as users access fpu/audio registers, OpenOCD will return fake value 0 instead of accessing registers through DIM.
Definition at line 253 of file nds32.c.
References nds32::audio_enable, ERROR_OK, nds32::fpu_enable, FUCPR, nds32_get_mapped_reg(), and NDS32_REGISTER_DISABLE.
Referenced by nds32_full_context(), and nds32_set_core_reg().
int nds32_config | ( | struct nds32 * | nds32 | ) |
Definition at line 1593 of file nds32.c.
References nds32_memory::dlm_size, ERROR_OK, nds32_memory::ilm_size, nds32_misc_config::interruption_level, nds32::max_interrupt_level, nds32::memory, nds32::misc_config, MR6, MR7, nds32_get_mapped_reg(), nds32_init_config(), nds32_init_option_registers(), and nds32_lm_size_table.
Referenced by nds32_v2_debug_entry(), and nds32_v3_debug_entry().
int nds32_edm_config | ( | struct nds32 * | nds32 | ) |
Definition at line 1554 of file nds32.c.
References nds32_edm::access_control, aice_read_debug_reg(), nds32_edm::breakpoint_num, nds32_edm::direct_access_local_memory, nds32::edm, ERROR_OK, LOG_INFO, nds32_login(), NDS_EDM_SR_EDM_CFG, NDS_EDM_SR_EDM_CTL, nds32_edm::support_max_stop, nds32::target, target_to_aice(), and nds32_edm::version.
Referenced by nds32_v2_examine(), nds32_v3_examine(), and nds32_v3m_examine().
int nds32_examine_debug_reason | ( | struct nds32 * | nds32 | ) |
Definition at line 1888 of file nds32.c.
References DBG_REASON_BREAKPOINT, DBG_REASON_DBGRQ, DBG_REASON_EXIT, DBG_REASON_SINGLESTEP, DBG_REASON_UNDEFINED, DBG_REASON_WATCHPOINT, target::debug_reason, ERROR_FAIL, ERROR_OK, nds32::get_debug_reason, nds32::get_watched_address, nds32::hit_syscall, nds32_instruction::imm, nds32_instruction::info, LOG_DEBUG, NDS32_DEBUG_BREAK, NDS32_DEBUG_BREAK_16, NDS32_DEBUG_DATA_ADDR_WATCHPOINT_NEXT_PRECISE, NDS32_DEBUG_DATA_ADDR_WATCHPOINT_PRECISE, NDS32_DEBUG_DATA_VALUE_WATCHPOINT_IMPRECISE, NDS32_DEBUG_DATA_VALUE_WATCHPOINT_NEXT_PRECISE, NDS32_DEBUG_DATA_VALUE_WATCHPOINT_PRECISE, NDS32_DEBUG_DEBUG_INTERRUPT, NDS32_DEBUG_HARDWARE_SINGLE_STEP, NDS32_DEBUG_INST_BREAK, NDS32_DEBUG_LOAD_STORE_GLOBAL_STOP, nds32_debug_type_name, nds32_evaluate_opcode(), nds32_get_mapped_reg(), nds32_read_opcode(), nds32_step_without_watchpoint(), nds32_instruction::opc_6, nds32_instruction::opcode, PC, nds32_instruction::sub_opc, nds32::target, and nds32::watched_address.
Referenced by nds32_v2_debug_entry(), and nds32_v3_debug_entry().
int nds32_full_context | ( | struct nds32 * | nds32 | ) |
Definition at line 494 of file nds32.c.
References ERROR_OK, IR0, nds32_check_extension(), nds32_get_mapped_reg(), nds32_update_cache_info(), nds32_update_lm_info(), nds32_update_mmu_info(), nds32_update_psw(), PC, and reg::value.
Referenced by nds32_v2_debug_entry(), and nds32_v3_debug_entry().
|
static |
Definition at line 2215 of file nds32.c.
References aice_read_debug_reg(), nds32::attached, nds32::backup_edm_ctl, target::coreid, ERROR_OK, nds32::keep_target_edm_ctl, LOG_DEBUG, NDS_EDM_SR_EDM_CTL, nds32::target, target_halt(), and target_to_aice().
Referenced by nds32_callback_event_handler().
|
static |
Definition at line 2235 of file nds32.c.
References aice_write_debug_reg(), nds32::attached, nds32::backup_edm_ctl, ERROR_OK, nds32::keep_target_edm_ctl, LOG_DEBUG, NDS_EDM_SR_EDM_CTL, nds32::target, target_resume(), target_to_aice(), and nds32::virtual_hosting.
Referenced by nds32_callback_event_handler().
int nds32_gdb_fileio_end | ( | struct target * | target, |
int | retcode, | ||
int | fileio_errno, | ||
bool | ctrl_c | ||
) |
Definition at line 2458 of file nds32.c.
References nds32::active_syscall_id, ERROR_OK, LOG_DEBUG, nds32_set_mapped_reg(), NDS32_SYSCALL_UNDEFINED, R0, target_to_nds32(), nds32::virtual_hosting_ctrl_c, and nds32::virtual_hosting_errno.
int nds32_gdb_fileio_write_memory | ( | struct nds32 * | nds32, |
uint32_t | address, | ||
uint32_t | size, | ||
const uint8_t * | buffer | ||
) |
Definition at line 2499 of file nds32.c.
References nds32::active_syscall_id, buffer, NDS32_STRUCT_STAT_SIZE, NDS32_STRUCT_TIMEVAL_SIZE, NDS32_SYSCALL_FSTAT, NDS32_SYSCALL_GETTIMEOFDAY, NDS32_SYSCALL_STAT, nds32_write_buffer(), size, and nds32::target.
Referenced by nds32_v3_write_buffer().
|
static |
get all register list
freed in gdb_server.c
Definition at line 573 of file nds32.c.
References reg::arch_info, nds32::core_cache, ERROR_OK, reg::exist, nds32_reg_current(), and reg_cache::num_regs.
Referenced by nds32_get_gdb_reg_list().
|
static |
Definition at line 59 of file nds32.c.
References aice_read_register(), reg::arch_info, nds32::audio_enable, buf_get_u32(), buf_set_u32(), reg::dirty, nds32_reg::enable, ERROR_FAIL, ERROR_OK, ERROR_TARGET_NOT_HALTED, nds32::fpu_enable, LOG_DEBUG, LOG_ERROR, reg::name, nds32_reg_type(), NDS32_REG_TYPE_AUMR, NDS32_REG_TYPE_FPU, NDS32_REGISTER_DISABLE, nds32_reg::num, nds32::register_map, target::state, nds32_reg::target, TARGET_HALTED, target_to_aice(), target_to_nds32(), reg::valid, and nds32_reg::value.
|
static |
Definition at line 109 of file nds32.c.
References aice_read_reg_64(), reg::arch_info, buf_set_u64(), reg::dirty, nds32_reg::enable, ERROR_FAIL, ERROR_OK, ERROR_TARGET_NOT_HALTED, FD0, FD31, nds32::fpu_enable, LOG_ERROR, NDS32_REGISTER_DISABLE, nds32_reg::num, target::state, nds32_reg::target, TARGET_HALTED, target_to_aice(), target_to_nds32(), reg::valid, and nds32_reg::value.
int nds32_get_gdb_fileio_info | ( | struct target * | target, |
struct gdb_fileio_info * | fileio_info | ||
) |
Definition at line 2297 of file nds32.c.
References nds32::active_syscall_id, ERROR_FAIL, ERROR_OK, nds32::hit_syscall, gdb_fileio_info::identifier, IR6, LOG_DEBUG, LOG_ERROR, nds32_get_mapped_reg(), nds32_set_mapped_reg(), NDS32_SYSCALL_CLOSE, NDS32_SYSCALL_ERRNO, NDS32_SYSCALL_EXIT, NDS32_SYSCALL_FSTAT, NDS32_SYSCALL_GETTIMEOFDAY, NDS32_SYSCALL_ISATTY, NDS32_SYSCALL_LSEEK, NDS32_SYSCALL_OPEN, NDS32_SYSCALL_READ, NDS32_SYSCALL_RENAME, NDS32_SYSCALL_STAT, NDS32_SYSCALL_SYSTEM, NDS32_SYSCALL_UNLINK, NDS32_SYSCALL_WRITE, NULL, gdb_fileio_info::param_1, gdb_fileio_info::param_2, gdb_fileio_info::param_3, gdb_fileio_info::param_4, R0, R1, R2, target_type::read_buffer, target_to_nds32(), target::type, and nds32::virtual_hosting_errno.
int nds32_get_gdb_reg_list | ( | struct target * | target, |
struct reg ** | reg_list[], | ||
int * | reg_list_size, | ||
enum target_register_class | reg_class | ||
) |
get all register list
Definition at line 596 of file nds32.c.
References ERROR_FAIL, nds32_get_all_reg_list(), nds32_get_general_reg_list(), REG_CLASS_ALL, REG_CLASS_GENERAL, and target_to_nds32().
|
static |
get general register list
freed in gdb_server.c
Definition at line 549 of file nds32.c.
References reg::arch_info, ERROR_OK, IFC_LP, nds32_reg_current(), and R0.
Referenced by nds32_get_gdb_reg_list().
int nds32_get_mapped_reg | ( | struct nds32 * | nds32, |
unsigned | regnum, | ||
uint32_t * | value | ||
) |
Definition at line 513 of file nds32.c.
References buf_get_u32(), nds32::core_cache, ERROR_FAIL, ERROR_OK, reg_arch_type::get, nds32_reg_current(), reg_cache::num_regs, reg::type, and reg::value.
Referenced by COMMAND_HANDLER(), nds32_arch_state(), nds32_calculate_lsmw_access_range(), nds32_check_extension(), nds32_config(), nds32_examine_debug_reason(), nds32_full_context(), nds32_get_gdb_fileio_info(), nds32_init_config(), nds32_init_memory_config(), nds32_init_option_registers(), nds32_nextpc(), nds32_parse_group_0_insn(), nds32_parse_group_1_insn(), nds32_parse_group_1_insn_16(), nds32_parse_group_2_insn(), nds32_parse_group_3_insn_16(), nds32_parse_hwgp(), nds32_parse_mem(), nds32_parse_sbgp(), nds32_resume(), nds32_soft_reset_halt(), nds32_step(), nds32_step_without_watchpoint(), nds32_update_cache_info(), nds32_update_lm_info(), nds32_update_mmu_info(), nds32_update_psw(), nds32_v3_check_interrupt_stack(), nds32_v3_deassert_reset(), nds32_v3_debug_entry(), nds32_v3_get_exception_address(), nds32_v3_leave_debug_state(), nds32_v3_restore_interrupt_stack(), nds32_v3m_check_interrupt_stack(), nds32_v3m_restore_interrupt_stack(), and nds32_walk_page_table().
int nds32_halt | ( | struct target * | target | ) |
Definition at line 2031 of file nds32.c.
References aice_halt(), CHECK_RETVAL, nds32::enter_debug_state, ERROR_FAIL, ERROR_OK, LOG_DEBUG, nds32_target_state(), state, target::state, target_call_event_callbacks(), TARGET_EVENT_HALTED, TARGET_HALTED, target_state_name(), target_to_aice(), and target_to_nds32().
int nds32_init | ( | struct nds32 * | nds32 | ) |
Definition at line 2285 of file nds32.c.
References nds32_memory::access_channel, ERROR_OK, nds32::memory, nds32_callback_event_handler(), NDS_MEMORY_ACC_CPU, nds32::target, target::target_number, and target_register_event_callback().
Referenced by nds32_v2_init_target(), and nds32_v3_init_target().
Definition at line 1620 of file nds32.c.
References nds32::active_syscall_id, target::arch_info, breakpoint::asid, nds32::attached, nds32::auto_convert_hw_bp, nds32::boot_time, nds32::common_magic, nds32::edm_passcode, ERROR_FAIL, ERROR_OK, nds32::global_stop, nds32::hit_syscall, nds32::init_arch_info_after_halted, breakpoint::is_set, nds32::keep_target_edm_ctl, breakpoint::length, breakpoint::linked_brp, NDS32_COMMON_MAGIC, nds32_init_register_table(), nds32_reg_cache_init(), nds32_reg_init(), NDS32_SYSCALL_UNDEFINED, breakpoint::next, NULL, breakpoint::orig_instr, nds32::privilege_level, nds32::reset_halt_as_examine, nds32::soft_reset_halt, nds32::syscall_break, target, nds32::target, target::target_number, breakpoint::unique_id, nds32::virtual_hosting, nds32::virtual_hosting_ctrl_c, nds32::virtual_hosting_errno, and nds32::word_access_mem.
Referenced by nds32_v2_target_create(), and nds32_v3_target_create_common().
|
static |
Definition at line 1070 of file nds32.c.
References nds32_cpu_version::_16bit_extension, nds32_mmu_config::_8k_page_support, nds32_misc_config::addr_24, nds32_misc_config::audio_isa, nds32_misc_config::baseline_instruction, nds32_cpu_version::cop_fpu_extension, nds32_cpu_version::cpu_id_family, nds32_cpu_version::cpu_id_version, nds32::cpu_version, CR0, CR3, CR4, nds32_misc_config::debug_tracer, nds32_mmu_config::default_endian, nds32_misc_config::div_instruction, nds32_mmu_config::drde, nds32_misc_config::edm, nds32_misc_config::ex9, nds32_mmu_config::extra_page_size_support, nds32_mmu_config::fully_associative_tlb, nds32_mmu_config::hardware_page_table_walker, nds32_misc_config::high_speed_memory_port, nds32_misc_config::ifc, nds32_misc_config::implement_dependant_register, nds32_misc_config::implement_dependant_sr_encoding, nds32_misc_config::interruption_level, nds32_mmu_config::invisible_tlb, nds32_misc_config::l2_cache, nds32_misc_config::local_memory_dma, nds32_misc_config::mac_instruction, nds32_misc_config::mcu, nds32_mmu_config::memory_protection, nds32_mmu_config::memory_protection_version, nds32::misc_config, nds32::mmu_config, nds32_get_mapped_reg(), nds32_init_memory_config(), nds32_misc_config::no_dx_register, nds32_mmu_config::ntme, nds32_mmu_config::partition_num, nds32_cpu_version::performance_extension, nds32_cpu_version::performance_extension_2, nds32_misc_config::performance_monitor, nds32_misc_config::reduce_register, nds32_cpu_version::revision, nds32_misc_config::shadow, nds32_cpu_version::string_extension, nds32_mmu_config::tlb_lock, nds32_mmu_config::tlb_sets, nds32_mmu_config::tlb_size, nds32_mmu_config::tlb_ways, and nds32_mmu_config::vlpt.
Referenced by nds32_config().
|
static |
Definition at line 1041 of file nds32.c.
References CR1, CR2, nds32_memory::dcache, nds32_memory::dlm_align_ver, nds32_memory::dlm_base, ERROR_OK, nds32_memory::icache, nds32_memory::ilm_align_ver, nds32_memory::ilm_base, nds32_cache::line_size, nds32_cache::lock_support, nds32::memory, nds32_get_mapped_reg(), nds32_cache::set, and nds32_cache::way.
Referenced by nds32_init_config().
|
static |
MUST have general registers
MUST have configuration system registers
MUST have interrupt system registers
MUST have MMU system registers
MUST have EDM system registers
Definition at line 992 of file nds32.c.
References reg::arch_info, nds32::core_cache, CR0, CR1, CR2, CR3, CR4, DR40, DR42, IR0, IR1, IR11, IR14, IR15, IR3, IR4, IR6, IR9, MR0, PC, R0, R1, R10, R15, R2, R28, R29, R3, R30, R31, R4, R5, R6, R7, R8, R9, and reg_cache::reg_list.
Referenced by nds32_init_register_table().
|
static |
Definition at line 1139 of file nds32.c.
References ADM_VBASE, reg::arch_info, nds32_misc_config::audio_isa, nds32_edm::breakpoint_num, CB_CTL, CBB0, CBB1, CBB2, CBB3, CBE0, CBE1, CBE2, CBE3, nds32_cpu_version::cop_fpu_extension, nds32::core_cache, nds32_cpu_version::cpu_id_family, nds32::cpu_version, CR5, CR6, D0HI, D0L24, D0LO, D1HI, D1L24, D1LO, nds32_memory::dcache, nds32_misc_config::debug_tracer, nds32_memory::dlm_base, DMAR0, DMAR1, DMAR10, DMAR2, DMAR3, DMAR4, DMAR5, DMAR6, DMAR7, DMAR8, DMAR9, DR0, DR41, DR43, DR44, DR45, DR46, DR47, nds32_misc_config::edm, nds32::edm, nds32_reg::enable, ERROR_OK, nds32_misc_config::ex9, FPCFG, FPCSR, FUCPR, nds32_misc_config::high_speed_memory_port, I0, I1, I2, I3, I4, I5, I6, I7, nds32_memory::icache, IDR0, IDR1, nds32_misc_config::ifc, IFC_LP, nds32_memory::ilm_base, nds32_misc_config::interruption_level, IR1, IR10, IR12, IR13, IR16, IR17, IR18, IR19, IR2, IR20, IR21, IR22, IR23, IR24, IR25, IR26, IR27, IR28, IR29, IR3, IR30, IR4, IR5, IR7, IR8, IR9, ITB, LBE, LC, LE, nds32_cache::line_size, nds32_misc_config::local_memory_dma, M1, M2, M3, M5, M6, M7, nds32_misc_config::mcu, nds32::memory, nds32_mmu_config::memory_protection, nds32_mmu_config::memory_protection_version, nds32::misc_config, nds32::mmu_config, MOD, MR0, MR1, MR10, MR11, MR2, MR3, MR4, MR5, MR6, MR7, MR8, MR9, nds32_get_mapped_reg(), nds32_set_mapped_reg(), nds32_misc_config::no_dx_register, nds32_misc_config::performance_monitor, PFR0, PFR1, PFR2, PFR3, nds32::privilege_level, R11, R12, R13, R14, R16, R17, R18, R19, R20, R21, R22, R23, R24, R25, R26, R27, RACR, nds32_misc_config::reduce_register, reg_cache::reg_list, nds32_cpu_version::revision, SECUR0, nds32_misc_config::shadow, SHFT_CTL0, and SHFT_CTL1.
Referenced by nds32_config().
int nds32_init_register_table | ( | struct nds32 * | nds32 | ) |
Definition at line 1424 of file nds32.c.
References ERROR_OK, and nds32_init_must_have_registers().
Referenced by nds32_init_arch_info().
int nds32_login | ( | struct nds32 * | nds32 | ) |
Definition at line 1969 of file nds32.c.
References aice_program_edm(), aice_read_debug_reg(), nds32::edm_passcode, ERROR_FAIL, ERROR_OK, LOG_DEBUG, LOG_INFO, nds32_edm_ops, nds32_edm_ops_num, NDS_EDM_SR_EDMSW, NULL, nds32::privilege_level, nds32::target, target_to_aice(), and nds32_edm_operation::value.
Referenced by nds32_assert_reset(), and nds32_edm_config().
int nds32_mmu | ( | struct target * | target, |
int * | enabled | ||
) |
Definition at line 945 of file nds32.c.
References nds32_memory::address_translation, ERROR_OK, ERROR_TARGET_INVALID, LOG_ERROR, nds32::memory, nds32_mmu_config::memory_protection, nds32::mmu_config, target::state, TARGET_HALTED, and target_to_nds32().
uint32_t nds32_nextpc | ( | struct nds32 * | nds32, |
int | current, | ||
uint32_t | address | ||
) |
Definition at line 1740 of file nds32.c.
References nds32_get_mapped_reg(), nds32_set_mapped_reg(), and PC.
Referenced by nds32_resume(), and nds32_step().
int nds32_poll | ( | struct target * | target | ) |
Definition at line 2061 of file nds32.c.
References aice_run(), nds32::core_cache, DBG_REASON_NOTHALTED, target::debug_reason, nds32::enter_debug_state, ERROR_FAIL, ERROR_OK, LOG_DEBUG, LOG_WARNING, nds32_target_state(), register_cache_invalidate(), state, target::state, target_call_event_callbacks(), TARGET_DEBUG_RUNNING, TARGET_EVENT_HALTED, TARGET_HALTED, TARGET_RESET, TARGET_RUNNING, target_to_aice(), and target_to_nds32().
Referenced by nds32_v2_deassert_reset(), nds32_v3_deassert_reset(), and nds32_v3m_deassert_reset().
int nds32_profiling | ( | struct target * | target, |
uint32_t * | samples, | ||
uint32_t | max_num_samples, | ||
uint32_t * | num_samples, | ||
uint32_t | seconds | ||
) |
Definition at line 2474 of file nds32.c.
References aice_profiling(), target::cmd_name, nds32::core_cache, ERROR_OK, ERROR_TARGET_NOT_HALTED, LOG_WARNING, PC, register_cache_invalidate(), nds32::register_map, target::state, TARGET_HALTED, target_to_aice(), and target_to_nds32().
int nds32_read_buffer | ( | struct target * | target, |
uint32_t | address, | ||
uint32_t | size, | ||
uint8_t * | buffer | ||
) |
Definition at line 713 of file nds32.c.
References nds32_memory::access_channel, aice_read_mem_bulk(), aice_read_mem_unit(), buffer, ERROR_OK, ERROR_TARGET_NOT_HALTED, LOG_DEBUG, LOG_WARNING, nds32::memory, nds32_select_memory_mode(), NDS_MEMORY_ACC_CPU, size, target::state, TARGET_HALTED, target_to_aice(), and target_to_nds32().
Referenced by nds32_v2_read_buffer(), nds32_v3_read_buffer(), and nds32_walk_page_table().
int nds32_read_memory | ( | struct target * | target, |
uint32_t | address, | ||
uint32_t | size, | ||
uint32_t | count, | ||
uint8_t * | buffer | ||
) |
Definition at line 804 of file nds32.c.
References aice_read_mem_unit(), buffer, count, size, and target_to_aice().
Referenced by nds32_v2_read_memory(), and nds32_v3_read_memory().
int nds32_read_phys_memory | ( | struct target * | target, |
target_addr_t | address, | ||
uint32_t | size, | ||
uint32_t | count, | ||
uint8_t * | buffer | ||
) |
Definition at line 812 of file nds32.c.
References nds32_memory::access_channel, aice_memory_access(), aice_read_mem_unit(), buffer, count, nds32::memory, NDS_MEMORY_ACC_BUS, size, target_to_aice(), and target_to_nds32().
Definition at line 472 of file nds32.c.
References ERROR_FAIL, ERROR_OK, nds32_build_reg_cache(), target::reg_cache, and register_get_last_cache_p().
Referenced by nds32_init_arch_info().
Definition at line 485 of file nds32.c.
References nds32::core_cache, and reg_cache::reg_list.
Referenced by nds32_get_all_reg_list(), nds32_get_general_reg_list(), nds32_get_mapped_reg(), and nds32_set_mapped_reg().
int nds32_remove_software_breakpoint | ( | struct target * | target, |
struct breakpoint * | breakpoint | ||
) |
Definition at line 1469 of file nds32.c.
References breakpoint::address, ERROR_FAIL, ERROR_OK, breakpoint::length, NDS32_BREAK_16, NDS32_BREAK_32, nds32_cache_sync(), breakpoint::orig_instr, target_type::read_buffer, target::type, and target_type::write_buffer.
Referenced by nds32_v2_remove_breakpoint(), nds32_v3_remove_breakpoint(), and nds32_v3m_remove_breakpoint().
int nds32_reset_halt | ( | struct nds32 * | nds32 | ) |
Definition at line 2605 of file nds32.c.
References aice_assert_srst(), AICE_RESET_HOLD, ERROR_OK, LOG_INFO, nds32::target, and target_to_aice().
Referenced by nds32_v2_examine(), nds32_v3_examine(), and nds32_v3m_examine().
int nds32_restore_context | ( | struct target * | target | ) |
Restore the processor context on an Andes target.
The full processor context is analyzed to see if any of the registers are dirty on this end, but have a valid new value. If this is the case, the processor is changed to the appropriate mode and the new register values are written out to the processor. If there happens to be a dirty register with an invalid value, an error will be logged.
target | Pointer to the Andes target to have its context restored |
Definition at line 1510 of file nds32.c.
References aice_write_reg_64(), aice_write_register(), reg::arch_info, buf_get_u32(), buf_get_u64(), nds32::core_cache, reg::dirty, ERROR_OK, ERROR_TARGET_NOT_HALTED, FD0, FD31, LOG_DEBUG, LOG_WARNING, reg::name, nds32_reg::num, reg_cache::num_regs, reg_cache::reg_list, target::state, TARGET_HALTED, target_to_aice(), target_to_nds32(), reg::valid, nds32_reg::value, and reg::value.
Referenced by nds32_v2_leave_debug_state(), and nds32_v3_leave_debug_state().
int nds32_resume | ( | struct target * | target, |
int | current, | ||
target_addr_t | address, | ||
int | handle_breakpoints, | ||
int | debug_execution | ||
) |
Definition at line 2104 of file nds32.c.
References aice_run(), CHECK_RETVAL, DBG_REASON_NOTHALTED, target::debug_reason, ERROR_OK, ERROR_TARGET_NOT_HALTED, IR0, nds32::leave_debug_state, LOG_DEBUG, LOG_ERROR, nds32_get_mapped_reg(), nds32_nextpc(), nds32_reach_max_interrupt_level(), nds32_set_mapped_reg(), target::state, target_call_event_callbacks(), TARGET_DEBUG_RUNNING, TARGET_EVENT_RESUMED, target_free_all_working_areas(), TARGET_HALTED, TARGET_PRIxADDR, TARGET_RUNNING, target_state_name(), target_to_aice(), target_to_nds32(), and nds32::virtual_hosting_ctrl_c.
|
static |
Definition at line 614 of file nds32.c.
References nds32_memory::access_channel, nds32_edm::access_control, aice_memory_mode(), nds32_edm::direct_access_local_memory, nds32_memory::dlm_base, nds32_memory::dlm_enable, nds32_memory::dlm_end, nds32_memory::dlm_start, nds32::edm, ERROR_OK, nds32_memory::ilm_base, nds32_memory::ilm_enable, nds32_memory::ilm_end, nds32_memory::ilm_start, length, LOG_DEBUG, nds32::memory, nds32_memory::mode, NDS_MEMORY_ACC_CPU, NDS_MEMORY_SELECT_AUTO, NDS_MEMORY_SELECT_DLM, NDS_MEMORY_SELECT_ILM, NDS_MEMORY_SELECT_MEM, target_to_aice(), and target_to_nds32().
Referenced by nds32_read_buffer(), and nds32_write_buffer().
|
static |
Definition at line 277 of file nds32.c.
References aice_read_register(), aice_write_register(), reg::arch_info, nds32::audio_enable, buf_get_u32(), buf_set_u32(), reg::dirty, ERROR_OK, ERROR_TARGET_NOT_HALTED, nds32::fpu_enable, FUCPR, IR0, LOG_DEBUG, LOG_ERROR, MR0, MR6, MR7, MR8, reg::name, nds32_check_extension(), nds32_reg_exception(), nds32_reg_type(), NDS32_REG_TYPE_AUMR, NDS32_REG_TYPE_FPU, nds32_update_cache_info(), nds32_update_lm_info(), nds32_update_mmu_info(), nds32_update_psw(), nds32_reg::num, nds32::register_map, target::state, nds32_reg::target, TARGET_HALTED, target_to_aice(), target_to_nds32(), reg::valid, nds32_reg::value, and reg::value.
|
static |
int nds32_set_mapped_reg | ( | struct nds32 * | nds32, |
unsigned | regnum, | ||
uint32_t | value | ||
) |
set register internally
Definition at line 532 of file nds32.c.
References buf_set_u32(), nds32::core_cache, ERROR_FAIL, nds32_reg_current(), reg_cache::num_regs, reg_arch_type::set, reg::type, and reg::value.
Referenced by COMMAND_HANDLER(), nds32_gdb_fileio_end(), nds32_get_gdb_fileio_info(), nds32_init_option_registers(), nds32_nextpc(), nds32_resume(), nds32_soft_reset_halt(), nds32_step(), nds32_step_without_watchpoint(), nds32_v3_deassert_reset(), nds32_v3_restore_interrupt_stack(), and nds32_v3m_restore_interrupt_stack().
|
static |
Definition at line 2155 of file nds32.c.
References aice_assert_srst(), AICE_SRST, ERROR_OK, IR3, nds32_get_mapped_reg(), nds32_set_mapped_reg(), PC, target_halt(), target_to_aice(), and target_to_nds32().
Referenced by nds32_assert_reset().
int nds32_step | ( | struct target * | target, |
int | current, | ||
target_addr_t | address, | ||
int | handle_breakpoints | ||
) |
set DSSIM
Definition at line 1750 of file nds32.c.
References aice_step(), CHECK_RETVAL, nds32::enter_debug_state, ERROR_FAIL, ERROR_OK, ERROR_TARGET_NOT_HALTED, nds32::hit_syscall, IR14, nds32::leave_debug_state, LOG_DEBUG, LOG_WARNING, nds32_get_mapped_reg(), nds32_nextpc(), nds32_set_mapped_reg(), target::state, nds32::step_isr_enable, target_call_event_callbacks(), TARGET_EVENT_HALTED, TARGET_EVENT_RESUMED, TARGET_HALTED, TARGET_PRIxADDR, target_state_name(), target_to_aice(), and target_to_nds32().
|
static |
set DSSIM
Definition at line 1811 of file nds32.c.
References aice_step(), CHECK_RETVAL, nds32::enter_debug_state, ERROR_FAIL, ERROR_OK, ERROR_TARGET_NOT_HALTED, IR14, nds32::leave_debug_state, LOG_WARNING, nds32_get_mapped_reg(), nds32_set_mapped_reg(), target::state, nds32::step_isr_enable, nds32::target, TARGET_HALTED, and target_to_aice().
Referenced by nds32_examine_debug_reason().
int nds32_target_state | ( | struct nds32 * | nds32, |
enum target_state * | state | ||
) |
Definition at line 1851 of file nds32.c.
References AICE_DISCONNECT, aice_state(), AICE_TARGET_DEBUG_RUNNING, AICE_TARGET_DETACH, AICE_TARGET_HALTED, AICE_TARGET_RESET, AICE_TARGET_RUNNING, AICE_TARGET_UNKNOWN, ERROR_FAIL, ERROR_OK, LOG_INFO, state, nds32::target, TARGET_DEBUG_RUNNING, TARGET_HALTED, TARGET_RESET, TARGET_RUNNING, target_to_aice(), and TARGET_UNKNOWN.
Referenced by nds32_halt(), and nds32_poll().
|
static |
Definition at line 181 of file nds32.c.
References nds32_memory::dcache, nds32_cache::enable, ERROR_OK, nds32_memory::icache, nds32::memory, MR8, and nds32_get_mapped_reg().
Referenced by nds32_full_context(), and nds32_set_core_reg().
|
static |
Definition at line 203 of file nds32.c.
References nds32_memory::dlm_align_ver, nds32_memory::dlm_enable, nds32_memory::dlm_end, nds32_memory::dlm_size, nds32_memory::dlm_start, ERROR_OK, nds32_memory::ilm_align_ver, nds32_memory::ilm_enable, nds32_memory::ilm_end, nds32_memory::ilm_size, nds32_memory::ilm_start, nds32::memory, MR6, MR7, and nds32_get_mapped_reg().
Referenced by nds32_full_context(), and nds32_set_core_reg().
|
static |
Definition at line 169 of file nds32.c.
References nds32_mmu_config::default_min_page_size, ERROR_OK, nds32::mmu_config, MR0, nds32_mmu_config::multiple_page_size_in_use, and nds32_get_mapped_reg().
Referenced by nds32_full_context(), and nds32_set_core_reg().
|
static |
Definition at line 147 of file nds32.c.
References nds32_memory::address_translation, AICE_BIG_ENDIAN, AICE_LITTLE_ENDIAN, aice_set_data_endian(), nds32::data_endian, ERROR_OK, IR0, nds32::memory, nds32_get_mapped_reg(), nds32::target, TARGET_BIG_ENDIAN, TARGET_LITTLE_ENDIAN, target_to_aice(), and true.
Referenced by nds32_full_context(), and nds32_set_core_reg().
int nds32_virtual_to_physical | ( | struct target * | target, |
target_addr_t | address, | ||
target_addr_t * | physical | ||
) |
Definition at line 1662 of file nds32.c.
References nds32_memory::address_translation, ERROR_FAIL, ERROR_OK, nds32::memory, nds32_probe_tlb(), nds32_walk_page_table(), and target_to_nds32().
int nds32_write_buffer | ( | struct target * | target, |
uint32_t | address, | ||
uint32_t | size, | ||
const uint8_t * | buffer | ||
) |
Definition at line 836 of file nds32.c.
References nds32_memory::access_channel, aice_write_mem_bulk(), aice_write_mem_unit(), buffer, ERROR_OK, ERROR_TARGET_NOT_HALTED, LOG_DEBUG, LOG_WARNING, nds32::memory, nds32_select_memory_mode(), NDS_MEMORY_ACC_CPU, size, target::state, TARGET_HALTED, target_to_aice(), and target_to_nds32().
Referenced by nds32_gdb_fileio_write_memory(), nds32_v2_write_buffer(), and nds32_v3_write_buffer().
int nds32_write_memory | ( | struct target * | target, |
uint32_t | address, | ||
uint32_t | size, | ||
uint32_t | count, | ||
const uint8_t * | buffer | ||
) |
Definition at line 913 of file nds32.c.
References aice_write_mem_unit(), buffer, count, size, and target_to_aice().
Referenced by nds32_v3_write_memory().
int nds32_write_phys_memory | ( | struct target * | target, |
target_addr_t | address, | ||
uint32_t | size, | ||
uint32_t | count, | ||
const uint8_t * | buffer | ||
) |
Definition at line 921 of file nds32.c.
References nds32_memory::access_channel, aice_memory_access(), aice_write_mem_unit(), buffer, count, nds32::memory, NDS_MEMORY_ACC_BUS, size, target_to_aice(), and target_to_nds32().
const char* nds32_debug_type_name[11] |
Definition at line 22 of file nds32.c.
Referenced by nds32_examine_debug_reason().
struct nds32_edm_operation nds32_edm_ops[NDS32_EDM_OPERATION_MAX_NUM] |
Definition at line 1 of file nds32.c.
Referenced by COMMAND_HANDLER(), and nds32_login().
uint32_t nds32_edm_ops_num |
Definition at line 20 of file nds32.c.
Referenced by COMMAND_HANDLER(), and nds32_login().
|
static |
Definition at line 50 of file nds32.c.
Referenced by nds32_cache_sync().
|
static |
Definition at line 36 of file nds32.c.
Referenced by nds32_config().
|
static |
Definition at line 339 of file nds32.c.
Referenced by nds32_build_reg_cache().
|
static |
Definition at line 339 of file nds32.c.
Referenced by nds32_build_reg_cache().