|
OpenOCD
|

Go to the source code of this file.
Functions | |
| static unsigned int | get_len_or_sprintf (char *buf, unsigned int curr, const char *format,...) |
| static unsigned int | print_number (char *buf, unsigned int offset, uint64_t value) |
| static unsigned int | riscv_debug_reg_field_to_s (char *buf, unsigned int offset, struct riscv_debug_reg_field_info field, struct riscv_debug_reg_ctx context, uint64_t field_value) |
| static uint64_t | riscv_debug_reg_field_value (struct riscv_debug_reg_field_info field, uint64_t value) |
| static unsigned int | riscv_debug_reg_field_value_to_s (char *buf, unsigned int offset, const char *const *field_value_names, uint64_t field_value) |
| static unsigned int | riscv_debug_reg_fields_to_s (char *buf, unsigned int offset, struct riscv_debug_reg_field_list(*get_next)(struct riscv_debug_reg_ctx contex), struct riscv_debug_reg_ctx context, uint64_t value, enum riscv_debug_reg_show show) |
| unsigned int | riscv_debug_reg_to_s (char *buf, enum riscv_debug_reg_ordinal reg_ordinal, struct riscv_debug_reg_ctx context, uint64_t value, enum riscv_debug_reg_show show) |
| This function is used to fill a buffer with a decoded string representation of register's value. More... | |
|
static |
Definition at line 10 of file debug_reg_printer.c.
Referenced by print_number(), riscv_debug_reg_field_to_s(), riscv_debug_reg_field_value_to_s(), riscv_debug_reg_fields_to_s(), and riscv_debug_reg_to_s().
|
static |
Definition at line 26 of file debug_reg_printer.c.
References get_len_or_sprintf(), and offset.
Referenced by riscv_debug_reg_field_value_to_s(), and riscv_debug_reg_to_s().
|
static |
Definition at line 45 of file debug_reg_printer.c.
References field_value(), get_len_or_sprintf(), riscv_debug_reg_field_info::name, offset, riscv_debug_reg_field_value_to_s(), and riscv_debug_reg_field_info::values.
Referenced by riscv_debug_reg_fields_to_s().
|
static |
Definition at line 55 of file debug_reg_printer.c.
References riscv_debug_reg_field_info::lsb, and riscv_debug_reg_field_info::msb.
Referenced by riscv_debug_reg_fields_to_s().
|
static |
Definition at line 33 of file debug_reg_printer.c.
References field_value(), get_len_or_sprintf(), NULL, offset, and print_number().
Referenced by riscv_debug_reg_field_to_s().
|
static |
Definition at line 63 of file debug_reg_printer.c.
References field_value(), get_len_or_sprintf(), riscv_debug_reg_field_list::get_next, offset, riscv_debug_reg_field_to_s(), riscv_debug_reg_field_value(), RISCV_DEBUG_REG_HIDE_ALL_0, RISCV_DEBUG_REG_HIDE_UNNAMED_0, and RISCV_DEBUG_REG_SHOW_ALL.
Referenced by riscv_debug_reg_to_s().
| unsigned int riscv_debug_reg_to_s | ( | char * | buf, |
| enum riscv_debug_reg_ordinal | reg_ordinal, | ||
| struct riscv_debug_reg_ctx | context, | ||
| uint64_t | value, | ||
| enum riscv_debug_reg_show | show | ||
| ) |
This function is used to fill a buffer with a decoded string representation of register's value.
| buf | If non-NULL, the buffer to write the string into. Otherwise, the function does not perform any writes, it just calculates the number of characters used. |
| reg_ordinal | The ordinal of the register. |
| context | The structure, containing the information about the target, necessary to decode the register. |
| value | The value to be decoded. |
Returns the number of characters used by the string representation (excluding '\0').
Example: const struct struct riscv_debug_reg_ctx context = { .abits = { .value = <abits value>, .is_set = true } }; char buf[riscv_debug_reg_to_s(NULL, DTM_DMI_ORDINAL, context, <dmi value>) + 1] riscv_debug_reg_to_s(buf, DTM_DMI_ORDINAL, context, <dmi value>);
Definition at line 91 of file debug_reg_printer.c.
References get_len_or_sprintf(), get_riscv_debug_reg_info(), length, reg::name, print_number(), and riscv_debug_reg_fields_to_s().
Referenced by decode_dmi(), and log_debug_reg().