3 #ifndef OPENOCD_TARGET_RISCV_RISCV_REG_IMPL_H
4 #define OPENOCD_TARGET_RISCV_RISCV_REG_IMPL_H
23 const struct reg default_reg = {0};
24 assert(!memcmp(&default_reg,
reg,
sizeof(*
reg)));
51 uint32_t regno,
bool exist);
64 info->shared_reg_info.custom_number = 0;
93 info->vector_uint8.type = &type_uint8;
96 info->type_uint8_vector.id =
"bytes";
98 info->type_uint8_vector.reg_type_vector = &
info->vector_uint8;
100 info->vector_uint16.type = &type_uint16;
103 info->type_uint16_vector.id =
"shorts";
105 info->type_uint16_vector.reg_type_vector = &
info->vector_uint16;
107 info->vector_uint32.type = &type_uint32;
110 info->type_uint32_vector.id =
"words";
112 info->type_uint32_vector.reg_type_vector = &
info->vector_uint32;
114 info->vector_uint64.type = &type_uint64;
117 info->type_uint64_vector.id =
"longs";
119 info->type_uint64_vector.reg_type_vector = &
info->vector_uint64;
121 info->vector_uint128.type = &type_uint128;
124 info->type_uint128_vector.id =
"quads";
126 info->type_uint128_vector.reg_type_vector = &
info->vector_uint128;
128 info->vector_fields[0].name =
"b";
129 info->vector_fields[0].type = &
info->type_uint8_vector;
131 info->vector_fields[0].next =
info->vector_fields + 1;
132 info->vector_fields[1].name =
"s";
133 info->vector_fields[1].type = &
info->type_uint16_vector;
138 info->vector_fields[1].next =
info->vector_fields + 2;
139 info->vector_fields[2].name =
"w";
140 info->vector_fields[2].type = &
info->type_uint32_vector;
145 info->vector_fields[2].next =
info->vector_fields + 3;
146 info->vector_fields[3].name =
"l";
147 info->vector_fields[3].type = &
info->type_uint64_vector;
152 info->vector_fields[3].next =
info->vector_fields + 4;
153 info->vector_fields[4].name =
"q";
154 info->vector_fields[4].type = &
info->type_uint128_vector;
160 info->vector_union.fields =
info->vector_fields;
163 info->type_vector.id =
"riscv_vector";
165 info->type_vector.reg_type_union = &
info->vector_union;
enum esirisc_reg_num number
unsigned int riscv_vlenb(const struct target *target)
static bool riscv_reg_impl_is_initialized(const struct reg *reg)
This file describes the helpers to use during register cache initialization of a RISC-V target.
int riscv_reg_impl_set_exist(const struct target *target, uint32_t regno, bool exist)
Mark register as existing or not.
void riscv_reg_impl_hide_csrs(const struct target *target)
Hide additional CSRs, as specified by riscv_info_t::hide_csr list.
static void init_shared_reg_info(struct target *target)
bool riscv_reg_impl_gdb_regno_exist(const struct target *target, uint32_t regno)
For most registers, returns whether they exist or not.
struct target * riscv_reg_impl_get_target(const struct reg *reg)
Return the target that owns the cache entry.
int riscv_reg_impl_expose_csrs(const struct target *target)
Expose additional CSRs, as specified by riscv_info_t::expose_csr list.
int riscv_reg_impl_init_cache_entry(struct target *target, uint32_t regno, bool exist, const struct reg_arch_type *reg_type)
Initialize register.
int riscv_reg_impl_init_cache(struct target *target)
Initialize register cache.
static void riscv_reg_impl_init_vector_reg_type(const struct target *target)
TODO: vector register type description can be moved into riscv013_info_t, since 0....
struct reg * riscv_reg_impl_cache_entry(const struct target *target, uint32_t number)
Return the entry in the register cache of the target.
static bool riscv_reg_impl_gdb_regno_cacheable(enum gdb_regno regno, bool is_write)
If write is true: return true iff we are guaranteed that the register will contain exactly the value ...
struct reg_feature * feature
static struct ublast_lowlevel_priv info