target: Add new methods for read/write individual regs.
This commit is contained in:
parent
71b8a4e081
commit
9f4cf4124e
|
@ -62,6 +62,8 @@ size_t target_regs_size(target *t);
|
|||
const char *target_tdesc(target *t);
|
||||
void target_regs_read(target *t, void *data);
|
||||
void target_regs_write(target *t, const void *data);
|
||||
ssize_t target_reg_read(target *t, int reg, void *data, size_t max);
|
||||
ssize_t target_reg_write(target *t, int reg, const void *data, size_t size);
|
||||
|
||||
/* Halt/resume functions */
|
||||
enum target_halt_reason {
|
||||
|
|
|
@ -337,6 +337,16 @@ int target_mem_write(target *t, target_addr dest, const void *src, size_t len)
|
|||
}
|
||||
|
||||
/* Register access functions */
|
||||
ssize_t target_reg_read(target *t, int reg, void *data, size_t max)
|
||||
{
|
||||
return t->reg_read(t, reg, data, max);
|
||||
}
|
||||
|
||||
ssize_t target_reg_write(target *t, int reg, const void *data, size_t size)
|
||||
{
|
||||
return t->reg_write(t, reg, data, size);
|
||||
}
|
||||
|
||||
void target_regs_read(target *t, void *data) { t->regs_read(t, data); }
|
||||
void target_regs_write(target *t, const void *data) { t->regs_write(t, data); }
|
||||
|
||||
|
|
|
@ -92,6 +92,8 @@ struct target_s {
|
|||
const char *tdesc;
|
||||
void (*regs_read)(target *t, void *data);
|
||||
void (*regs_write)(target *t, const void *data);
|
||||
ssize_t (*reg_read)(target *t, int reg, void *data, size_t max);
|
||||
ssize_t (*reg_write)(target *t, int reg, const void *data, size_t size);
|
||||
|
||||
/* Halt/resume functions */
|
||||
void (*reset)(target *t);
|
||||
|
|
Loading…
Reference in New Issue