|
OpenOCD
|

Go to the source code of this file.
Enumerations | |
| enum | misa_mxl { MISA_MXL_INVALID = 0 , MISA_MXL_32 = 1 , MISA_MXL_64 = 2 , MISA_MXL_128 = 3 } |
Functions | |
| static int | assume_reg_exist (struct target *target, uint32_t regno) |
| Some registers are optional (e.g. More... | |
| static int | check_misa_mxl (const struct target *target) |
| static int | examine_misa (struct target *target) |
| static int | examine_mtopi (struct target *target) |
| static int | examine_vlenb (struct target *target) |
| static int | examine_xlen (struct target *target) |
| static int | init_cache_entry (struct target *target, uint32_t regno) |
| unsigned int | mxl_to_xlen (enum misa_mxl mxl) |
| static const struct reg_arch_type * | riscv013_gdb_regno_reg_type (uint32_t regno) |
| int | riscv013_reg_examine_all (struct target *target) |
| This function assumes target's DM to be initialized (target is able to access DMs registers, execute program buffer, etc.) More... | |
| static int | riscv013_reg_get (struct reg *reg) |
| int | riscv013_reg_save (struct target *target, enum gdb_regno regid) |
| This function is used to save the value of a register in cache. More... | |
| static int | riscv013_reg_set (struct reg *reg, uint8_t *buf) |
| enum misa_mxl |
| Enumerator | |
|---|---|
| MISA_MXL_INVALID | |
| MISA_MXL_32 | |
| MISA_MXL_64 | |
| MISA_MXL_128 | |
Definition at line 165 of file riscv-013_reg.c.
|
static |
Some registers are optional (e.g.
"misa"). For such registers it is first assumed they exist (via "assume_reg_exist()"), then the read is attempted (via the usual "riscv_reg_get()") and if the read fails, the register is marked as non-existing (via "riscv_reg_impl_set_exist()").
Definition at line 101 of file riscv-013_reg.c.
References riscv013_gdb_regno_reg_type(), and riscv_reg_impl_init_cache_entry().
Referenced by examine_mtopi(), and examine_vlenb().
|
static |
Definition at line 187 of file riscv-013_reg.c.
References ERROR_FAIL, ERROR_OK, get_field(), LOG_TARGET_DEBUG, LOG_TARGET_ERROR, LOG_TARGET_WARNING, MISA_MXL_INVALID, mxl_to_xlen(), RISCV_INFO, and riscv_xlen().
Referenced by examine_misa().
|
static |
Definition at line 253 of file riscv-013_reg.c.
References check_misa_mxl(), ERROR_OK, GDB_REGNO_MISA, init_cache_entry(), RISCV_INFO, and riscv_reg_get().
Referenced by riscv013_reg_examine_all().
|
static |
Definition at line 267 of file riscv-013_reg.c.
References assume_reg_exist(), ERROR_OK, GDB_REGNO_MTOPEI, GDB_REGNO_MTOPI, LOG_TARGET_INFO, riscv_reg_get(), riscv_reg_impl_set_exist(), and reg::value.
Referenced by riscv013_reg_examine_all().
|
static |
Definition at line 126 of file riscv-013_reg.c.
References assume_reg_exist(), ERROR_OK, GDB_REGNO_MSTATUS, GDB_REGNO_VLENB, init_cache_entry(), LOG_TARGET_INFO, LOG_TARGET_WARNING, RISCV_INFO, riscv_reg_get(), riscv_reg_impl_set_exist(), and riscv_supports_extension().
Referenced by riscv013_reg_examine_all().
|
static |
Definition at line 107 of file riscv-013_reg.c.
References AC_ACCESS_REGISTER_TRANSFER, ERROR_FAIL, ERROR_OK, ERROR_TIMEOUT_REACHED, GDB_REGNO_S0, riscv013_access_register_command(), riscv013_execute_abstract_command(), and RISCV_INFO.
Referenced by riscv013_reg_examine_all().
|
static |
Definition at line 85 of file riscv-013_reg.c.
References ERROR_OK, riscv013_gdb_regno_reg_type(), riscv_reg_impl_cache_entry(), riscv_reg_impl_gdb_regno_exist(), riscv_reg_impl_init_cache_entry(), and riscv_reg_impl_is_initialized().
Referenced by examine_misa(), examine_vlenb(), and riscv013_reg_examine_all().
| unsigned int mxl_to_xlen | ( | enum misa_mxl | mxl | ) |
Definition at line 172 of file riscv-013_reg.c.
References MISA_MXL_128, MISA_MXL_32, MISA_MXL_64, and MISA_MXL_INVALID.
Referenced by check_misa_mxl().
|
static |
Definition at line 76 of file riscv-013_reg.c.
References reg_arch_type::get, riscv013_reg_get(), and riscv013_reg_set().
Referenced by assume_reg_exist(), and init_cache_entry().
| int riscv013_reg_examine_all | ( | struct target * | target | ) |
This function assumes target's DM to be initialized (target is able to access DMs registers, execute program buffer, etc.)
This file describes additional register cache interface available to the RISC-V Debug Specification v0.13+ targets.
Definition at line 296 of file riscv-013_reg.c.
References ERROR_OK, examine_misa(), examine_mtopi(), examine_vlenb(), examine_xlen(), GDB_REGNO_S0, GDB_REGNO_S1, init_cache_entry(), init_shared_reg_info(), reg_cache::num_regs, target::reg_cache, riscv_reg_impl_expose_csrs(), riscv_reg_impl_hide_csrs(), riscv_reg_impl_init_cache(), riscv_reg_impl_init_vector_reg_type(), target::state, and TARGET_HALTED.
Referenced by examine().
|
static |
Definition at line 16 of file riscv-013_reg.c.
References buf_set_u64(), buf_to_hex_str(), ERROR_FAIL, ERROR_OK, GDB_REGNO_V0, GDB_REGNO_V31, GDB_REGNO_XPR15, GDB_REGNO_XPR31, LOG_TARGET_DEBUG, reg::name, reg::number, riscv013_get_register_buf(), riscv_reg_get(), riscv_reg_impl_gdb_regno_cacheable(), riscv_reg_impl_get_target(), riscv_supports_extension(), reg::size, reg::valid, and reg::value.
Referenced by riscv013_gdb_regno_reg_type().
This function is used to save the value of a register in cache.
The register is marked as dirty, and writeback is delayed for as long as possible.
Definition at line 352 of file riscv-013_reg.c.
References reg::dirty, ERROR_FAIL, ERROR_OK, LOG_TARGET_DEBUG, LOG_TARGET_ERROR, reg::name, target::reg_cache, RISCV_INFO, riscv_reg_gdb_regno_name(), riscv_reg_get(), riscv_reg_impl_cache_entry(), riscv_reg_impl_gdb_regno_cacheable(), target::state, TARGET_HALTED, target_was_examined(), timeval_ms(), reg::valid, and reg::value.
Referenced by access_memory_progbuf(), csr_read_progbuf(), csr_write_progbuf(), examine_progbuf(), fpr_read_progbuf(), fpr_write_progbuf(), riscv013_get_register_buf(), riscv013_set_register_buf(), vl_write_progbuf(), vtype_write_progbuf(), and write_memory_progbuf().
|
static |
Definition at line 46 of file riscv-013_reg.c.
References buf_get_u64(), buf_to_hex_str(), DIV_ROUND_UP, ERROR_FAIL, ERROR_OK, GDB_REGNO_V0, GDB_REGNO_V31, GDB_REGNO_XPR15, GDB_REGNO_XPR31, LOG_TARGET_DEBUG, reg::name, reg::number, riscv013_set_register_buf(), riscv_reg_impl_gdb_regno_cacheable(), riscv_reg_impl_get_target(), riscv_reg_set(), riscv_supports_extension(), reg::size, reg::valid, and reg::value.
Referenced by riscv013_gdb_regno_reg_type().