OpenOCD
|
Go to the source code of this file.
Macros | |
#define | a0 4 |
#define | a1 5 |
#define | a2 6 |
#define | a3 7 |
#define | AT 1 |
#define | fp 30 |
#define | gp 28 |
#define | k0 26 |
#define | k1 27 |
#define | MIPS32_GDB_FP_REG 1 |
#define | MIPS32_NUM_REGS ARRAY_SIZE(mips32_regs) |
#define | ra 31 |
#define | s0 16 |
#define | s1 17 |
#define | s2 18 |
#define | s3 19 |
#define | s4 20 |
#define | s5 21 |
#define | s6 22 |
#define | s7 23 |
#define | s8 30 /* == fp */ |
#define | sp 29 |
#define | t0 8 |
#define | t1 9 |
#define | t2 10 |
#define | t3 11 |
#define | t4 12 |
#define | t5 13 |
#define | t6 14 |
#define | t7 15 |
#define | t8 24 |
#define | t9 25 |
#define | ta0 12 /* alias for $t4 */ |
#define | ta1 13 /* alias for $t5 */ |
#define | ta2 14 /* alias for $t6 */ |
#define | ta3 15 /* alias for $t7 */ |
#define | v0 2 |
#define | v1 3 |
#define | zero 0 |
Functions | |
COMMAND_HANDLER (mips32_handle_cp0_command) | |
mips32_handle_cp0_command - Handle commands related to CP0 registers. More... | |
COMMAND_HANDLER (mips32_handle_cpuinfo_command) | |
mips32_handle_cpuinfo_command - Handles the 'cpuinfo' command. More... | |
COMMAND_HANDLER (mips32_handle_dsp_command) | |
mips32_handle_dsp_command - Handles mips dsp related command More... | |
COMMAND_HANDLER (mips32_handle_ejtag_reg_command) | |
mips32_handle_ejtag_reg_command - Handler commands related to EJTAG More... | |
COMMAND_HANDLER (mips32_handle_scan_delay_command) | |
mips32_handle_scan_delay_command - Handler command for changing scan delay More... | |
int | mips32_arch_state (struct target *target) |
int | mips32_blank_check_memory (struct target *target, struct target_memory_check_block *blocks, int num_blocks, uint8_t erased_value) |
Checks whether a memory region is erased. More... | |
struct reg_cache * | mips32_build_reg_cache (struct target *target) |
int | mips32_checksum_memory (struct target *target, target_addr_t address, uint32_t count, uint32_t *checksum) |
int | mips32_configure_break_unit (struct target *target) |
static int | mips32_configure_dbs (struct target *target) |
static int | mips32_configure_ibs (struct target *target) |
static const struct mips32_cp0 * | mips32_cp0_find_register_by_name (uint32_t cp0_mask, const char *reg_name) |
mips32_cp0_find_register_by_name - Find CP0 register by its name. More... | |
static int | mips32_cp0_get_all_regs (struct command_invocation *cmd, struct mips_ejtag *ejtag_info, uint32_t cp0_mask) |
mips32_cp0_get_all_regs - Print all CP0 registers and their values. More... | |
static int | mips32_cp0_get_reg_by_name (struct command_invocation *cmd, struct mips_ejtag *ejtag_info, uint32_t cp0_mask) |
mips32_cp0_get_reg_by_name - Read and print a CP0 register's value by name. More... | |
static int | mips32_cp0_get_reg_by_number (struct command_invocation *cmd, struct mips_ejtag *ejtag_info) |
mips32_cp0_get_reg_by_number - Read and print a CP0 register's value by number. More... | |
static int | mips32_cp0_set_reg_by_name (struct command_invocation *cmd, struct mips32_common *mips32, struct mips_ejtag *ejtag_info) |
mips32_cp0_set_reg_by_name - Write to a CP0 register identified by name. More... | |
static int | mips32_cp0_set_reg_by_number (struct command_invocation *cmd, struct mips32_common *mips32, struct mips_ejtag *ejtag_info) |
mips32_cp0_set_reg_by_number - Write to a CP0 register identified by number. More... | |
static int | mips32_cpu_get_release (struct mips_ejtag *ejtag_info) |
static bool | mips32_cpu_is_lexra (struct mips_ejtag *ejtag_info) |
int | mips32_cpu_probe (struct target *target) |
mips32_cpu_probe - Detects processor type and applies necessary quirks. More... | |
bool | mips32_cpu_support_hazard_barrier (struct mips_ejtag *ejtag_info) |
mips32_cpu_support_hazard_barrier - Checks CPU supports hazard barrier More... | |
bool | mips32_cpu_support_sync (struct mips_ejtag *ejtag_info) |
mips32_cpu_support_sync - Checks CPU supports ordering More... | |
static void | mips32_detect_fpr_mode_change (struct mips32_common *mips32, uint32_t cp0_status) |
mips32_detect_fpr_mode_change - Detect changes in floating-point register mode More... | |
static void | mips32_dsp_enable (struct pracc_queue_info *ctx, int isa) |
mips32_dsp_enable - Enable access to DSP registers More... | |
static int | mips32_dsp_find_register_by_name (const char *reg_name) |
mips32_dsp_find_register_by_name - Find DSP register index by name More... | |
static int | mips32_dsp_get_all_regs (struct command_invocation *cmd, struct mips32_common *mips32) |
mips32_dsp_get_all_regs - Get values of all MIPS32 DSP registers More... | |
static int | mips32_dsp_get_register (struct command_invocation *cmd, struct mips32_common *mips32) |
mips32_dsp_get_register - Get the value of a MIPS32 DSP register More... | |
static void | mips32_dsp_restore (struct pracc_queue_info *ctx, int isa) |
mips32_dsp_restore - Restore DSP status registers to the previous setting More... | |
static int | mips32_dsp_set_register (struct command_invocation *cmd, struct mips32_common *mips32) |
mips32_dsp_set_register - Set the value of a MIPS32 DSP register More... | |
int | mips32_enable_interrupts (struct target *target, int enable) |
int | mips32_examine (struct target *target) |
static const struct cpu_entry * | mips32_find_cpu_by_prid (uint32_t prid) |
mips32_find_cpu_by_prid - Find CPU information by processor ID. More... | |
static int | mips32_get_core_reg (struct reg *reg) |
int | mips32_get_gdb_reg_list (struct target *target, struct reg **reg_list[], int *reg_list_size, enum target_register_class reg_class) |
int | mips32_init_arch_info (struct target *target, struct mips32_common *mips32, struct jtag_tap *tap) |
static int | mips32_pracc_read_dsp_reg (struct mips_ejtag *ejtag_info, uint32_t *val, uint32_t reg) |
mips32_pracc_read_dsp_reg - Read a value from a MIPS32 DSP register More... | |
static int | mips32_pracc_write_dsp_reg (struct mips_ejtag *ejtag_info, uint32_t val, uint32_t reg) |
mips32_pracc_write_dsp_reg - Write a value to a MIPS32 DSP register More... | |
static int | mips32_read_c0_prid (struct target *target) |
static void | mips32_read_config_dsp (struct mips32_common *mips32, struct mips_ejtag *ejtag_info) |
static void | mips32_read_config_fdc (struct mips32_common *mips32, struct mips_ejtag *ejtag_info, uint32_t dcr) |
mips32_read_config_fdc - Read Fast Debug Channel configuration More... | |
static int | mips32_read_config_fpu (struct mips32_common *mips32, struct mips_ejtag *ejtag_info) |
static int | mips32_read_config_mmu (struct mips_ejtag *ejtag_info) |
mips32_read_config_mmu - Reads MMU configuration and logs relevant information. More... | |
int | mips32_read_config_regs (struct target *target) |
static int | mips32_read_core_reg (struct target *target, unsigned int num) |
int | mips32_restore_context (struct target *target) |
int | mips32_run_algorithm (struct target *target, int num_mem_params, struct mem_param *mem_params, int num_reg_params, struct reg_param *reg_params, target_addr_t entry_point, target_addr_t exit_point, unsigned int timeout_ms, void *arch_info) |
static int | mips32_run_and_wait (struct target *target, target_addr_t entry_point, unsigned int timeout_ms, target_addr_t exit_point, struct mips32_common *mips32) |
int | mips32_save_context (struct target *target) |
static void | mips32_set_all_fpr_width (struct mips32_common *mips32, bool fp64) |
mips32_set_all_fpr_width - Set the width of all floating-point registers More... | |
static int | mips32_set_core_reg (struct reg *reg, uint8_t *buf) |
static int | mips32_verify_pointer (struct command_invocation *cmd, struct mips32_common *mips32) |
static int | mips32_write_core_reg (struct target *target, unsigned int num) |
Variables | |
const struct command_registration | mips32_command_handlers [] |
struct { | |
const char * name | |
} | mips32_dsp_regs [MIPS32NUMDSPREGS] |
static const struct command_registration | mips32_exec_command_handlers [] |
static const struct reg_arch_type | mips32_reg_type |
struct { | |
const char * feature | |
const char * group | |
unsigned int id | |
const char * name | |
int size | |
enum reg_type type | |
} | mips32_regs [] |
static const char * | mips_isa_strings [] |
#define MIPS32_NUM_REGS ARRAY_SIZE(mips32_regs) |
COMMAND_HANDLER | ( | mips32_handle_cp0_command | ) |
mips32_handle_cp0_command - Handle commands related to CP0 registers.
@cmd: Command invocation context.
Orchestrates different operations on CP0 registers based on the command arguments. Supports operations like reading all registers, reading/writing a specific register by name or number.
Return: ERROR_OK on success; error code on failure.
Definition at line 1672 of file mips32.c.
References CMD, CMD_ARGC, CMD_ARGV, CMD_CTX, CMD_NAME, command_print(), mips32_common::cp0_mask, mips32_common::ejtag_info, ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, ERROR_TARGET_NOT_HALTED, get_current_target(), mips32_cp0_get_all_regs(), mips32_cp0_get_reg_by_name(), mips32_cp0_get_reg_by_number(), mips32_cp0_set_reg_by_name(), mips32_cp0_set_reg_by_number(), mips32_verify_pointer(), target::state, TARGET_HALTED, and target_to_mips32().
COMMAND_HANDLER | ( | mips32_handle_cpuinfo_command | ) |
mips32_handle_cpuinfo_command - Handles the 'cpuinfo' command.
[in] | cmd | Command invocation context. |
Executes the 'cpuinfo' command which displays detailed information about the current CPU core. This includes core type, vendor, instruction set, cache size, and other relevant details.
Definition at line 1918 of file mips32.c.
References BIT, CMD, CMD_ARGC, CMD_CTX, CMD_NAME, command_print(), mips_ejtag::config, mips32_common::cpu_info, cpu_entry::cpu_name, mips32_common::ejtag_info, ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, ERROR_TARGET_NOT_HALTED, get_current_target(), mips32_common::isa_rel, MIPS32_CFG1_DASHIFT, MIPS32_CFG1_DLSHIFT, MIPS32_CFG1_DSSHIFT, MIPS32_CFG1_IASHIFT, MIPS32_CFG1_ILSHIFT, MIPS32_CFG1_ISSHIFT, MIPS32_CONFIG3_ISA_MASK, MIPS32_CONFIG3_ISA_SHIFT, mips32_cp0_read(), mips32_cpu_entry, MIPS32_MMU_BAT, MIPS32_MMU_DUAL_VTLB_FTLB, MIPS32_MMU_FIXED, MIPS32_MMU_TLB, MIPS32_NUM_CPU_ENTRIES, mips32_read_config_dsp(), mips32_read_config_fpu(), mips32_read_config_mmu(), MIPS32_RELEASE_1, MIPS32_RELEASE_2, MIPS32_RELEASE_6, mips32_common::num_data_bpoints, mips32_common::num_inst_bpoints, cpu_entry::prid, mips32_common::prid, mips_ejtag::prid, pracc_queue_info::retval, target::state, TARGET_HALTED, target_to_mips32(), and cpu_entry::vendor.
COMMAND_HANDLER | ( | mips32_handle_dsp_command | ) |
mips32_handle_dsp_command - Handles mips dsp related command
[in] | cmd | Command invocation context |
Reads or sets the content of each dsp register.
Definition at line 2238 of file mips32.c.
References CMD, CMD_ARGC, CMD_ARGV, CMD_CTX, CMD_NAME, command_print(), mips32_common::dsp_imp, ERROR_COMMAND_ARGUMENT_INVALID, ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, get_current_target(), mips32_dsp_get_all_regs(), mips32_dsp_get_register(), mips32_dsp_set_register(), mips32_verify_pointer(), target::state, TARGET_HALTED, and target_to_mips32().
COMMAND_HANDLER | ( | mips32_handle_ejtag_reg_command | ) |
mips32_handle_ejtag_reg_command - Handler commands related to EJTAG
[in] | cmd | Command invocation context |
Prints all EJTAG Registers including DCR features.
Definition at line 2296 of file mips32.c.
References BIT, bit(), CMD, CMD_CTX, command_print(), dcr_features, mips_ejtag::ejtag_ctrl, EJTAG_DCR, EJTAG_DCR_ENTRIES, mips32_common::ejtag_info, EJTAG_INST_CONTROL, ejtag_main_print_imp(), ERROR_OK, get_current_target(), mips_ejtag::idcode, mips_ejtag::impcode, mips_ejtag_drscan_32(), mips_ejtag_get_idcode(), mips_ejtag_get_impcode(), mips_ejtag_set_instr(), name, target_read_u32(), and target_to_mips32().
COMMAND_HANDLER | ( | mips32_handle_scan_delay_command | ) |
mips32_handle_scan_delay_command - Handler command for changing scan delay
[in] | cmd | Command invocation context |
Changes current scan mode between legacy and fast queued mode.
Definition at line 2351 of file mips32.c.
References CMD, CMD_ARGC, CMD_ARGV, CMD_CTX, COMMAND_PARSE_NUMBER, command_print(), mips32_common::ejtag_info, ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, get_current_target(), MIPS32_SCAN_DELAY_LEGACY_MODE, mips_ejtag::mode, mips_ejtag::scan_delay, and target_to_mips32().
int mips32_arch_state | ( | struct target * | target | ) |
Definition at line 484 of file mips32.c.
References buf_get_u32(), mips32_common::core_cache, debug_reason_name(), ERROR_OK, mips32_common::isa_mode, LOG_USER, MIPS32_REGLIST_C0_PC_INDEX, mips_isa_strings, reg_cache::reg_list, target_to_mips32(), and reg::value.
int mips32_blank_check_memory | ( | struct target * | target, |
struct target_memory_check_block * | blocks, | ||
int | num_blocks, | ||
uint8_t | erased_value | ||
) |
Checks whether a memory region is erased.
Definition at line 1312 of file mips32.c.
References working_area::address, ARRAY_SIZE, buf_get_u32(), buf_set_u32(), mips32_algorithm::common_magic, destroy_reg_param(), mips32_common::ejtag_info, ERROR_FAIL, ERROR_OK, ERROR_TARGET_RESOURCE_NOT_AVAILABLE, init_reg_param(), mips_ejtag::isa, mips32_algorithm::isa_mode, LOG_ERROR, MIPS32_ADDIU, MIPS32_AND, MIPS32_BNE, MIPS32_COMMON_MAGIC, MIPS32_ISA_MIPS32, MIPS32_ISA_MMIPS32, MIPS32_LB, MIPS32_SDBBP, NEG16, NULL, PARAM_IN_OUT, PARAM_OUT, pracc_swap16_array(), target_memory_check_block::result, size, target_alloc_working_area(), target_buffer_set_u32_array(), target_free_working_area(), target_run_algorithm(), target_to_mips32(), and target_write_buffer().
Definition at line 501 of file mips32.c.
References reg::arch_info, reg::caller_save, mips32_common::core_cache, reg::dirty, reg::exist, feature, reg::feature, reg::group, LOG_ERROR, mips32_core_reg::mips32_common, MIPS32_NUM_REGS, mips32_reg_type, mips32_regs, reg::name, reg_cache::name, reg_cache::next, NULL, mips32_core_reg::num, reg_cache::num_regs, reg::number, target::reg_cache, reg::reg_data_type, reg_cache::reg_list, register_get_last_cache_p(), reg::size, target, mips32_core_reg::target, target_to_mips32(), reg_data_type::type, reg::type, reg::valid, and reg::value.
Referenced by mips_m4k_init_target().
int mips32_checksum_memory | ( | struct target * | target, |
target_addr_t | address, | ||
uint32_t | count, | ||
uint32_t * | checksum | ||
) |
Definition at line 1229 of file mips32.c.
References working_area::address, ARRAY_SIZE, buf_get_u32(), buf_set_u32(), mips32_algorithm::common_magic, count, destroy_reg_param(), mips32_common::ejtag_info, ERROR_OK, ERROR_TARGET_RESOURCE_NOT_AVAILABLE, init_reg_param(), mips_ejtag::isa, mips32_algorithm::isa_mode, MIPS32_ADDI, MIPS32_ADDIU, MIPS32_ADDU, MIPS32_BEQ, MIPS32_BNE, MIPS32_COMMON_MAGIC, MIPS32_ISA_MIPS32, MIPS32_ISA_MMIPS32, MIPS32_LB, MIPS32_LUI, MIPS32_MOVN, MIPS32_ORI, MIPS32_SDBBP, MIPS32_SLL, MIPS32_SLTI, MIPS32_XOR, NEG16, NULL, PARAM_IN_OUT, PARAM_OUT, pracc_swap16_array(), target_alloc_working_area(), target_buffer_set_u32_array(), target_free_working_area(), target_run_algorithm(), target_to_mips32(), and target_write_buffer().
int mips32_configure_break_unit | ( | struct target * | target | ) |
Definition at line 804 of file mips32.c.
References mips32_common::bp_scanned, mips_ejtag::debug_caps, EJTAG_DCR, EJTAG_DCR_DB, EJTAG_DCR_ENM, EJTAG_DCR_IB, mips32_common::ejtag_info, EJTAG_V20_IMP_NODB, EJTAG_V20_IMP_NOIB, mips_ejtag::ejtag_version, EJTAG_VERSION_20, target::endianness, ERROR_OK, mips_ejtag::impcode, LOG_DEBUG, LOG_WARNING, mips32_configure_dbs(), mips32_configure_ibs(), mips32_common::num_data_bpoints, mips32_common::num_inst_bpoints, TARGET_BIG_ENDIAN, TARGET_LITTLE_ENDIAN, target_read_u32(), and target_to_mips32().
Referenced by mips_m4k_debug_entry().
|
static |
Definition at line 777 of file mips32.c.
References mips32_common::data_break_list, mips_ejtag::ejtag_dba0_addr, mips_ejtag::ejtag_dba_step_size, mips_ejtag::ejtag_dbs_addr, mips32_common::ejtag_info, ERROR_OK, mips32_common::num_data_bpoints, mips32_common::num_data_bpoints_avail, mips32_comparator::reg_address, target_read_u32(), target_to_mips32(), and target_write_u32().
Referenced by mips32_configure_break_unit().
|
static |
Definition at line 750 of file mips32.c.
References mips_ejtag::ejtag_iba0_addr, mips_ejtag::ejtag_iba_step_size, mips_ejtag::ejtag_ibs_addr, mips32_common::ejtag_info, ERROR_OK, mips32_common::inst_break_list, mips32_common::num_inst_bpoints, mips32_common::num_inst_bpoints_avail, mips32_comparator::reg_address, target_read_u32(), target_to_mips32(), and target_write_u32().
Referenced by mips32_configure_break_unit().
|
static |
mips32_cp0_find_register_by_name - Find CP0 register by its name.
[in] | cp0_mask | Mask to filter out irrelevant registers. |
[in] | reg_name | Name of the register to find. |
This function iterates through mips32_cp0_regs to find a register matching reg_name, considering cp0_mask to filter out registers not relevant for the current core.
Definition at line 1452 of file mips32.c.
References mips32_cp0::core, mips32_cp0_regs, MIPS32NUMCP0REGS, name, and NULL.
Referenced by mips32_cp0_get_reg_by_name(), and mips32_cp0_set_reg_by_name().
|
static |
mips32_cp0_get_all_regs - Print all CP0 registers and their values.
[in] | cmd | Command invocation context. |
[in] | ejtag_info | EJTAG interface information. |
[in] | cp0_mask | Mask to identify relevant registers. |
Iterates over all CP0 registers, reads their values, and prints them. Only considers registers relevant to the current core, as defined by cp0_mask.
Definition at line 1476 of file mips32.c.
References CMD, command_print(), mips32_cp0::core, ERROR_OK, mips32_cp0_read(), mips32_cp0_regs, MIPS32NUMCP0REGS, name, and mips32_cp0::sel.
Referenced by COMMAND_HANDLER().
|
static |
mips32_cp0_get_reg_by_name - Read and print a CP0 register's value by name.
[in] | cmd | Command invocation context. |
[in] | ejtag_info | EJTAG interface information. |
[in] | cp0_mask | Mask to identify relevant registers. |
Finds a CP0 register by name, reads its value, and prints it. Handles error scenarios like register not found or read failure.
Definition at line 1507 of file mips32.c.
References CMD, CMD_ARGV, command_print(), ERROR_COMMAND_ARGUMENT_INVALID, ERROR_OK, mips32_cp0_find_register_by_name(), mips32_cp0_read(), mips32_cp0::reg, and mips32_cp0::sel.
Referenced by COMMAND_HANDLER().
|
static |
mips32_cp0_get_reg_by_number - Read and print a CP0 register's value by number.
[in] | cmd | Command invocation context. |
[in] | ejtag_info | EJTAG interface information. |
Reads a specific CP0 register (identified by number and selection) and prints its value. The register number and selection are parsed from the command arguments.
Definition at line 1537 of file mips32.c.
References CMD, CMD_ARGV, COMMAND_PARSE_NUMBER, command_print(), ERROR_OK, and mips32_cp0_read().
Referenced by COMMAND_HANDLER().
|
static |
mips32_cp0_set_reg_by_name - Write to a CP0 register identified by name.
[in] | cmd | Command invocation context. |
[in] | mips32 | Common MIPS32 data structure. |
[in] | ejtag_info | EJTAG interface information. |
Writes a value to a CP0 register specified by name. Updates internal cache if specific registers (STATUS, CAUSE, DEPC, GUESTCTL1) are modified.
Definition at line 1567 of file mips32.c.
References CMD, CMD_ARGV, COMMAND_PARSE_NUMBER, command_print(), mips32_common::core_cache, mips32_common::core_regs, mips32_core_regs::cp0, mips32_common::cp0_mask, reg::dirty, ERROR_COMMAND_ARGUMENT_INVALID, ERROR_OK, MIPS32_C0_CAUSE, MIPS32_C0_DEPC, MIPS32_C0_GUESTCTL1, MIPS32_C0_STATUS, mips32_cp0_find_register_by_name(), mips32_cp0_write(), MIPS32_REG_C0_CAUSE_INDEX, MIPS32_REG_C0_GUESTCTL1_INDEX, MIPS32_REG_C0_PC_INDEX, MIPS32_REG_C0_STATUS_INDEX, MIPS32_REGLIST_C0_CAUSE_INDEX, MIPS32_REGLIST_C0_GUESTCTL1_INDEX, MIPS32_REGLIST_C0_PC_INDEX, MIPS32_REGLIST_C0_STATUS_INDEX, mips32_cp0::reg, reg_cache::reg_list, and mips32_cp0::sel.
Referenced by COMMAND_HANDLER().
|
static |
mips32_cp0_set_reg_by_number - Write to a CP0 register identified by number.
[in] | cmd | Command invocation context. |
[in] | mips32 | Common MIPS32 data structure. |
[in] | ejtag_info | EJTAG interface information. |
Writes a value to a CP0 register specified by number and selection. Handles special cases like updating the internal cache for certain registers.
Definition at line 1623 of file mips32.c.
References CMD, CMD_ARGV, COMMAND_PARSE_NUMBER, command_print(), mips32_common::core_cache, mips32_common::core_regs, mips32_core_regs::cp0, reg::dirty, ERROR_OK, MIPS32_C0_CAUSE, MIPS32_C0_DEPC, MIPS32_C0_GUESTCTL1, MIPS32_C0_STATUS, mips32_cp0_write(), MIPS32_REG_C0_CAUSE_INDEX, MIPS32_REG_C0_GUESTCTL1_INDEX, MIPS32_REG_C0_PC_INDEX, MIPS32_REG_C0_STATUS_INDEX, MIPS32_REGLIST_C0_CAUSE_INDEX, MIPS32_REGLIST_C0_GUESTCTL1_INDEX, MIPS32_REGLIST_C0_PC_INDEX, MIPS32_REGLIST_C0_STATUS_INDEX, and reg_cache::reg_list.
Referenced by COMMAND_HANDLER().
|
static |
Definition at line 948 of file mips32.c.
References mips_ejtag::config, MIPS32_CONFIG0_AR_MASK, and MIPS32_CONFIG0_AR_SHIFT.
Referenced by mips32_cpu_support_hazard_barrier().
|
static |
Definition at line 943 of file mips32.c.
References mips_ejtag::prid, PRID_COMP_LEXRA, and PRID_COMP_MASK.
Referenced by mips32_cpu_support_sync().
int mips32_cpu_probe | ( | struct target * | target | ) |
mips32_cpu_probe - Detects processor type and applies necessary quirks.
[in] | target | The target CPU to probe. |
This function probes the CPU, reads its PRID (Processor ID), and determines the CPU type. It applies any quirks necessary for specific processor types.
NOTE: The proper detection of certain CPUs can become quite complicated. Please consult the following Linux kernel code when adding new CPUs: arch/mips/include/asm/cpu.h arch/mips/kernel/cpu-probe.c
Definition at line 995 of file mips32.c.
References mips32_common::cp0_mask, mips32_common::cpu_info, cpu_entry::cpu_name, mips32_common::cpu_quirks, EJTAG_QUIRK_PAD_DRET, ERROR_OK, LOG_DEBUG, mips32_find_cpu_by_prid(), mips32_read_c0_prid(), MIPS_CP0_IAPTIV, MIPS_CP0_MAPTIV_UC, MIPS_CP0_MAPTIV_UP, MIPS_CP0_MK4, cpu_entry::prid, mips32_common::prid, PRID_COMP_INGENIC_E1, PRID_COMP_MASK, PRID_COMP_MTI, PRID_IMP_IAPTIV, PRID_IMP_IAPTIV_CM, PRID_IMP_M5150, PRID_IMP_MAPTIV_UC, PRID_IMP_MAPTIV_UP, PRID_IMP_MASK, PRID_IMP_XBURST_REV1, and target_to_mips32().
Referenced by mips_m4k_debug_entry().
bool mips32_cpu_support_hazard_barrier | ( | struct mips_ejtag * | ejtag_info | ) |
mips32_cpu_support_hazard_barrier - Checks CPU supports hazard barrier
[in] | ejtag_info | MIPS EJTAG information structure. |
hazard barrier instructions EHB and *.HB was introduced to MIPS from release 2.
Definition at line 976 of file mips32.c.
References mips32_cpu_get_release(), and MIPS32_RELEASE_1.
Referenced by mips32_cp0_read(), mips32_cp0_write(), mips32_pracc_fastdata_xfer(), mips32_pracc_write_mem(), and mips32_pracc_write_regs().
bool mips32_cpu_support_sync | ( | struct mips_ejtag * | ejtag_info | ) |
mips32_cpu_support_sync - Checks CPU supports ordering
[in] | ejtag_info | MIPS EJTAG information structure. |
MIPS ISA implemented on Lexra CPUs is MIPS-I, similar to R3000, which does not have the SYNC instruction alone with unaligned load/store instructions.
Definition at line 963 of file mips32.c.
References mips32_cpu_is_lexra().
Referenced by mips32_pracc_fastdata_xfer(), mips32_pracc_read_mem(), mips32_pracc_read_u32(), and mips32_pracc_write_mem().
|
static |
mips32_detect_fpr_mode_change - Detect changes in floating-point register mode
[in] | mips32 | MIPS32 common structure |
[in] | cp0_status | Value of the CP0 status register |
Detects changes in the floating-point register mode based on the CP0 status register. If changes are detected, it updates the internal state and logs a warning message indicating the mode change.
Definition at line 307 of file mips32.c.
References BIT, mips32_common::fp_imp, mips32_common::fpu_enabled, mips32_common::fpu_in_64bit, LOG_WARNING, MIPS32_CP0_STATUS_CU1_SHIFT, MIPS32_CP0_STATUS_FR_SHIFT, and mips32_set_all_fpr_width().
Referenced by mips32_read_core_reg(), and mips32_write_core_reg().
|
static |
mips32_dsp_enable - Enable access to DSP registers
[in] | ctx | Context information for the pracc queue |
[in] | isa | Instruction Set Architecture identifier |
Enables access to DSP registers by modifying the status register.
This function adds instructions to the context queue for enabling access to DSP registers by modifying the status register.
Definition at line 1725 of file mips32.c.
References mips_ejtag::isa, LOWER16, MIPS32_DSP_ENABLE, MIPS32_ISA_OR, MIPS32_LUI, MIPS32_MFC0, MIPS32_MTC0, MIPS32_ORI, pracc_add(), and UPPER16.
Referenced by mips32_pracc_read_dsp_reg(), and mips32_pracc_write_dsp_reg().
|
static |
mips32_dsp_find_register_by_name - Find DSP register index by name
[in] | reg_name | Name of the DSP register to find |
Searches for a DSP register by name and returns its index. If no match is found, it returns MIPS32NUMDSPREGS.
Definition at line 2120 of file mips32.c.
References mips32_dsp_regs, MIPS32NUMDSPREGS, and name.
Referenced by mips32_dsp_get_register(), and mips32_dsp_set_register().
|
static |
mips32_dsp_get_all_regs - Get values of all MIPS32 DSP registers
[in] | cmd | Command invocation context |
[in] | ejtag_info | EJTAG information structure |
This function iterates through all DSP registers, reads their values, and prints each register name along with its corresponding value.
Definition at line 2140 of file mips32.c.
References CMD, command_print(), mips32_common::core_cache, mips32_common::core_regs, reg::dirty, mips32_core_regs::dsp, mips32_common::ejtag_info, ERROR_OK, mips32_dsp_regs, mips32_pracc_read_dsp_reg(), MIPS32_REGLIST_DSP_INDEX, MIPS32NUMDSPREGS, name, and reg_cache::reg_list.
Referenced by COMMAND_HANDLER().
|
static |
mips32_dsp_get_register - Get the value of a MIPS32 DSP register
[in] | cmd | Command invocation context |
[in] | ejtag_info | EJTAG information structure |
Retrieves the value of a specified MIPS32 DSP register. If the register is found, it reads the register value and prints the result. If the register is not found, it prints an error message.
Definition at line 2168 of file mips32.c.
References CMD, CMD_ARGV, command_print(), mips32_common::core_cache, mips32_common::core_regs, reg::dirty, mips32_core_regs::dsp, mips32_common::ejtag_info, ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, mips32_dsp_find_register_by_name(), mips32_pracc_read_dsp_reg(), MIPS32_REGLIST_DSP_INDEX, MIPS32NUMDSPREGS, and reg_cache::reg_list.
Referenced by COMMAND_HANDLER().
|
static |
mips32_dsp_restore - Restore DSP status registers to the previous setting
[in] | ctx | Context information pracc queue |
[in] | isa | isa identifier |
Restores the DSP status registers to their previous setting.
This function adds instructions to the context queue for restoring the DSP status registers to their values before the operation.
Definition at line 1754 of file mips32.c.
References mips_ejtag::isa, MIPS32_MTC0, MIPS32_NOP, and pracc_add().
Referenced by mips32_pracc_read_dsp_reg(), and mips32_pracc_write_dsp_reg().
|
static |
mips32_dsp_set_register - Set the value of a MIPS32 DSP register
[in] | cmd | Command invocation context |
[in] | ejtag_info | EJTAG information structure |
Sets the value of a specified MIPS32 DSP register. If the register is found, it writes provided value to the register. If the register is not found or there is an error in writing the value, it prints an error message.
Definition at line 2206 of file mips32.c.
References CMD, CMD_ARGV, COMMAND_PARSE_NUMBER, command_print(), mips32_common::core_cache, mips32_common::core_regs, reg::dirty, mips32_core_regs::dsp, mips32_common::ejtag_info, ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, mips32_dsp_find_register_by_name(), mips32_pracc_write_dsp_reg(), MIPS32_REGLIST_DSP_INDEX, MIPS32NUMDSPREGS, and reg_cache::reg_list.
Referenced by COMMAND_HANDLER().
int mips32_enable_interrupts | ( | struct target * | target, |
int | enable | ||
) |
Definition at line 860 of file mips32.c.
References EJTAG_DCR, EJTAG_DCR_INTE, ERROR_OK, target_read_u32(), and target_write_u32().
Referenced by mips_m4k_internal_restore(), mips_m4k_single_step_core(), and mips_m4k_step().
int mips32_examine | ( | struct target * | target | ) |
Definition at line 732 of file mips32.c.
References mips32_common::bp_scanned, ERROR_OK, mips32_common::num_data_bpoints, mips32_common::num_data_bpoints_avail, mips32_common::num_inst_bpoints, mips32_common::num_inst_bpoints_avail, target_set_examined(), target_to_mips32(), and target_was_examined().
Referenced by mips_m4k_examine().
|
static |
mips32_find_cpu_by_prid - Find CPU information by processor ID.
[in] | prid | Processor ID of the CPU. |
This function looks up the CPU entry in the mips32_cpu_entry array based on the provided processor ID. It also handles special cases like AMD/Alchemy CPUs that use Company Options instead of Processor IDs.
Definition at line 920 of file mips32.c.
References MIPS32_CORE_MASK, mips32_cpu_entry, MIPS32_NUM_CPU_ENTRIES, cpu_entry::prid, PRID_COMP_ALCHEMY, and PRID_COMP_MASK.
Referenced by mips32_cpu_probe().
|
static |
Definition at line 239 of file mips32.c.
References reg::arch_info, ERROR_TARGET_NOT_HALTED, mips32_core_reg::num, mips32_common::read_core_reg, target::state, mips32_core_reg::target, TARGET_HALTED, and target_to_mips32().
int mips32_get_gdb_reg_list | ( | struct target * | target, |
struct reg ** | reg_list[], | ||
int * | reg_list_size, | ||
enum target_register_class | reg_class | ||
) |
Definition at line 429 of file mips32.c.
References mips32_common::core_cache, ERROR_OK, MIPS32_NUM_REGS, reg_cache::reg_list, and target_to_mips32().
int mips32_init_arch_info | ( | struct target * | target, |
struct mips32_common * | mips32, | ||
struct jtag_tap * | tap | ||
) |
Definition at line 560 of file mips32.c.
References target::arch_info, mips32_common::bp_scanned, mips32_common::common_magic, mips_ejtag::config_regs, mips32_common::data_break_list, mips32_common::ejtag_info, mips_ejtag::endianness, target::endianness, ERROR_OK, mips32_common::fast_data_area, mips_ejtag::isa, mips32_common::isa_imp, MIPS32_COMMON_MAGIC, MIPS32_ONLY, mips32_read_core_reg(), MIPS32_SCAN_DELAY_LEGACY_MODE, mips32_write_core_reg(), mips_ejtag::mode, NULL, mips32_common::read_core_reg, mips_ejtag::scan_delay, mips_ejtag::tap, TARGET_BIG_ENDIAN, and mips32_common::write_core_reg.
Referenced by mips_m4k_init_arch_info().
|
static |
mips32_pracc_read_dsp_reg - Read a value from a MIPS32 DSP register
[in] | ejtag_info | EJTAG information structure |
[out] | val | Pointer to store the read value |
[in] | reg | Index of the DSP register to read |
Reads the value from the specified MIPS32 DSP register using EJTAG access.
This function initiates a sequence of instructions to read the value from the specified DSP register. It will enable dsp module if its not enabled and restoring the status registers after the read operation.
Definition at line 1774 of file mips32.c.
References pracc_queue_info::code_count, pracc_queue_info::ejtag_info, ERROR_OK, pracc_queue_info::isa, mips_ejtag::isa, LOWER16, pracc_queue_info::max_code, MIPS32_B, mips32_dsp_enable(), MIPS32_DSP_MFHI, MIPS32_DSP_MFLO, MIPS32_DSP_RDDSP, mips32_dsp_restore(), MIPS32_LUI, MIPS32_MFC0, MIPS32_ORI, MIPS32_PRACC_PARAM_OUT, mips32_pracc_queue_exec(), MIPS32_SW, MIPS32_SYNC, NEG16, NULL, pracc_add(), pracc_queue_info::pracc_list, PRACC_OUT_OFFSET, pracc_queue_free(), pracc_queue_init(), PRACC_UPPER_BASE_ADDR, mips_ejtag::reg8, mips_ejtag::reg9, pracc_queue_info::retval, t0, and UPPER16.
Referenced by mips32_dsp_get_all_regs(), and mips32_dsp_get_register().
|
static |
mips32_pracc_write_dsp_reg - Write a value to a MIPS32 DSP register
[in] | ejtag_info | EJTAG information structure |
[in] | val | Value to be written to the register |
[in] | reg | Index of the DSP register to write |
Writes the specified value to the specified MIPS32 DSP register.
This function initiates a sequence of instructions to write the given value to the specified DSP register.
Definition at line 1849 of file mips32.c.
References pracc_queue_info::code_count, pracc_queue_info::ejtag_info, ERROR_OK, pracc_queue_info::isa, LOWER16, pracc_queue_info::max_code, MIPS32_B, mips32_dsp_enable(), MIPS32_DSP_MTHI, MIPS32_DSP_MTLO, mips32_dsp_restore(), MIPS32_DSP_WRDSP, MIPS32_LUI, MIPS32_MFC0, MIPS32_NOP, MIPS32_ORI, mips32_pracc_queue_exec(), NEG16, NULL, pracc_add(), pracc_queue_free(), pracc_queue_init(), mips_ejtag::reg8, mips_ejtag::reg9, pracc_queue_info::retval, t0, and UPPER16.
Referenced by mips32_dsp_set_register().
|
static |
Definition at line 895 of file mips32.c.
References mips32_common::ejtag_info, ERROR_OK, LOG_ERROR, mips32_cp0_read(), mips32_common::prid, and target_to_mips32().
Referenced by mips32_cpu_probe().
|
static |
Definition at line 1051 of file mips32.c.
References BIT, mips_ejtag::config, mips32_common::dsp_imp, ERROR_OK, LOG_ERROR, LOG_USER, MIPS32_C0_STATUS, MIPS32_CONFIG3_DSPP_MASK, MIPS32_CONFIG3_DSPP_SHIFT, MIPS32_CONFIG3_DSPREV_MASK, MIPS32_CONFIG3_DSPREV_SHIFT, mips32_cp0_read(), and MIPS32_CP0_STATUS_MX_SHIFT.
Referenced by COMMAND_HANDLER(), and mips32_read_config_regs().
|
static |
mips32_read_config_fdc - Read Fast Debug Channel configuration
[in,out] | mips32 | MIPS32 common structure |
[in] | ejtag_info | EJTAG information structure |
[in] | dcr | Device Configuration Register value |
Checks if the current target implements the Common Device Memory Map (CDMM) and Fast Debug Channel (FDC).
This function examines the configuration registers and the Device Configuration Register (DCR) to determine if the current MIPS32 target supports the Common Device Memory Map (CDMM) and the Fast Debug Channel (FDC). If supported, it sets the corresponding flags in the MIPS32 common structure.
NOTE:These are defined on MD00090, page 67 and MD00047F, page 82, respectively. MIPS Documents are pretty much all available online, it should pop up first when you search "MDxxxxx"
Definition at line 1143 of file mips32.c.
References mips_ejtag::config, EJTAG_DCR_FDC, mips32_common::fdc, MIPS32_CONFIG3_CDMM_MASK, and mips32_common::semihosting.
Referenced by mips32_read_config_regs().
|
static |
Definition at line 1073 of file mips32.c.
References BIT, mips_ejtag::config, ERROR_OK, mips32_common::fp_imp, mips32_common::fpu_enabled, mips32_common::fpu_in_64bit, LOG_ERROR, LOG_USER, MIPS32_C0_STATUS, MIPS32_CONFIG1_FP_MASK, MIPS32_CONFIG1_FP_SHIFT, mips32_cp0_read(), MIPS32_CP0_STATUS_CU1_SHIFT, MIPS32_CP0_STATUS_FR_SHIFT, mips32_cp1_control_read(), MIPS32_CP1_FIR_F64_SHIFT, MIPS32_FP_IMP_64, MIPS32_FP_IMP_NONE, MIPS32_FP_IMP_UNKNOWN, and mips32_set_all_fpr_width().
Referenced by COMMAND_HANDLER(), and mips32_read_config_regs().
|
static |
mips32_read_config_mmu - Reads MMU configuration and logs relevant information.
[in] | ejtag_info | EJTAG interface information. |
Reads the MMU configuration from the CP0 register and calculates the number of TLB entries, ways, and sets. Handles different MMU types like VTLB only, root RPU/Fixed, and VTLB and FTLB.
Definition at line 1405 of file mips32.c.
References BIT, mips_ejtag::config, ERROR_OK, LOG_USER, and mips32_cp0_read().
Referenced by COMMAND_HANDLER().
int mips32_read_config_regs | ( | struct target * | target | ) |
Definition at line 1155 of file mips32.c.
References mips_ejtag::config, mips_ejtag::config_regs, EJTAG_DCR, EJTAG_IMP_MIPS16, mips32_common::ejtag_info, ERROR_OK, mips32_common::fp_imp, mips_ejtag::impcode, mips32_common::isa_imp, mips32_common::isa_rel, LOG_DEBUG, LOG_ERROR, LOG_USER, MIPS32_CONFIG0_AR_MASK, MIPS32_CONFIG0_AR_SHIFT, MIPS32_CONFIG3_ISA_MASK, MIPS32_CONFIG3_ISA_SHIFT, mips32_cp0_read(), MIPS32_FP_IMP_NONE, MIPS32_MIPS16, MIPS32_MMIPS32, MIPS32_ONLY, mips32_read_config_dsp(), mips32_read_config_fdc(), mips32_read_config_fpu(), MIPS32_RELEASE_1, MIPS32_RELEASE_2, MIPS32_RELEASE_6, MMIPS32_ONLY, target_read_u32(), and target_to_mips32().
Referenced by mips_m4k_debug_entry().
|
static |
Definition at line 334 of file mips32.c.
References buf_set_u32(), buf_set_u64(), mips32_common::core_cache, mips32_common::core_regs, mips32_core_regs::cp0, reg::dirty, mips32_core_regs::dsp, ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, mips32_core_regs::fpcr, mips32_core_regs::fpr, mips32_core_regs::gpr, LOG_DEBUG, mips32_detect_fpr_mode_change(), MIPS32_NUM_REGS, MIPS32_REG_C0_STATUS_INDEX, MIPS32_REGLIST_C0_INDEX, MIPS32_REGLIST_DSP_INDEX, MIPS32_REGLIST_FP_INDEX, MIPS32_REGLIST_FPC_INDEX, MIPS32_REGLIST_GP_INDEX, reg_cache::reg_list, target_to_mips32(), reg::valid, and reg::value.
Referenced by mips32_init_arch_info().
int mips32_restore_context | ( | struct target * | target | ) |
Definition at line 468 of file mips32.c.
References mips32_common::core_cache, reg::dirty, MIPS32_NUM_REGS, mips32_pracc_write_regs(), reg_cache::reg_list, target_to_mips32(), and mips32_common::write_core_reg.
Referenced by mips_m4k_internal_restore(), and mips_m4k_step().
int mips32_run_algorithm | ( | struct target * | target, |
int | num_mem_params, | ||
struct mem_param * | mem_params, | ||
int | num_reg_params, | ||
struct reg_param * | reg_params, | ||
target_addr_t | entry_point, | ||
target_addr_t | exit_point, | ||
unsigned int | timeout_ms, | ||
void * | arch_info | ||
) |
Definition at line 616 of file mips32.c.
References buf_get_u32(), buf_set_u32(), mips32_common::common_magic, mips32_common::core_cache, direction, reg::dirty, ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, ERROR_TARGET_INVALID, ERROR_TARGET_NOT_HALTED, mips32_common::isa_mode, mips32_algorithm::isa_mode, LOG_DEBUG, LOG_ERROR, LOG_TARGET_ERROR, MIPS32_COMMON_MAGIC, MIPS32_NUM_REGS, mips32_run_and_wait(), mips32_set_core_reg(), reg::name, PARAM_IN, PARAM_OUT, mips32_common::read_core_reg, reg_cache::reg_list, reg_param::reg_name, register_get_by_name(), reg_param::size, size, reg::size, target::state, TARGET_HALTED, target_read_buffer(), target_to_mips32(), target_write_buffer(), reg::valid, and reg::value.
|
static |
Definition at line 584 of file mips32.c.
References buf_get_u32(), mips32_common::core_cache, ERROR_OK, ERROR_TARGET_TIMEOUT, LOG_DEBUG, MIPS32_REGLIST_C0_PC_INDEX, reg_cache::reg_list, target::state, target_halt(), TARGET_HALTED, target_resume(), target_wait_state(), and reg::value.
Referenced by mips32_run_algorithm().
int mips32_save_context | ( | struct target * | target | ) |
Definition at line 446 of file mips32.c.
References mips32_common::core_cache, ERROR_OK, LOG_ERROR, MIPS32_NUM_REGS, mips32_pracc_read_regs(), mips32_common::read_core_reg, reg_cache::reg_list, target_to_mips32(), and reg::valid.
Referenced by mips_m4k_debug_entry().
|
static |
mips32_set_all_fpr_width - Set the width of all floating-point registers
[in] | mips32 | MIPS32 common structure |
[in] | fp64 | Flag indicating whether to set the width to 64 bits (double precision) |
Sets the width of all floating-point registers based on the specified flag.
Definition at line 286 of file mips32.c.
References mips32_common::core_cache, MIPS32_REG_FP_COUNT, MIPS32_REGLIST_FP_INDEX, reg::reg_data_type, reg_cache::reg_list, REG_TYPE_IEEE_DOUBLE, REG_TYPE_IEEE_SINGLE, reg::size, and reg_data_type::type.
Referenced by mips32_detect_fpr_mode_change(), and mips32_read_config_fpu().
|
static |
Definition at line 254 of file mips32.c.
References reg::arch_info, buf_get_u32(), buf_get_u64(), buf_set_u32(), buf_set_u64(), reg::dirty, ERROR_OK, ERROR_TARGET_NOT_HALTED, reg::size, target::state, mips32_core_reg::target, TARGET_HALTED, reg::valid, and reg::value.
Referenced by mips32_run_algorithm().
|
static |
Definition at line 1386 of file mips32.c.
References cmd, command_print(), mips32_common::common_magic, ERROR_OK, ERROR_TARGET_INVALID, and MIPS32_COMMON_MAGIC.
Referenced by COMMAND_HANDLER().
|
static |
Definition at line 382 of file mips32.c.
References buf_get_u32(), buf_get_u64(), mips32_common::core_cache, mips32_common::core_regs, mips32_core_regs::cp0, reg::dirty, mips32_core_regs::dsp, ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, mips32_core_regs::fpcr, mips32_core_regs::fpr, mips32_core_regs::gpr, LOG_DEBUG, mips32_detect_fpr_mode_change(), MIPS32_NUM_REGS, MIPS32_REG_C0_STATUS_INDEX, MIPS32_REGLIST_C0_INDEX, MIPS32_REGLIST_DSP_INDEX, MIPS32_REGLIST_FP_INDEX, MIPS32_REGLIST_FPC_INDEX, MIPS32_REGLIST_GP_INDEX, reg_cache::reg_list, target_to_mips32(), reg::valid, and reg::value.
Referenced by mips32_init_arch_info().
const char* feature |
Definition at line 41 of file mips32.c.
Referenced by mips32_build_reg_cache().
const struct command_registration mips32_command_handlers[] |
const { ... } mips32_dsp_regs[MIPS32NUMDSPREGS] |
Referenced by mips32_dsp_find_register_by_name(), and mips32_dsp_get_all_regs().
|
static |
|
static |
Definition at line 484 of file mips32.c.
Referenced by mips32_build_reg_cache().
const { ... } mips32_regs[] |
Referenced by mips32_build_reg_cache().
|
static |
Definition at line 26 of file mips32.c.
Referenced by mips32_arch_state().
const char* name |
Definition at line 38 of file mips32.c.
Referenced by COMMAND_HANDLER(), mips32_cp0_find_register_by_name(), mips32_cp0_get_all_regs(), mips32_dsp_find_register_by_name(), and mips32_dsp_get_all_regs().
int size |
Definition at line 42 of file mips32.c.
Referenced by mips32_blank_check_memory(), and mips32_run_algorithm().