Simplify reg_read/reg_write, obtaining a perf boost.

Single reg_read/reg_write is now about 25% faster.
This commit is contained in:
Robert Xiao
2023-05-11 22:54:03 -07:00
parent 074566cf69
commit 30d202b89e
40 changed files with 563 additions and 1403 deletions

View File

@@ -62,20 +62,14 @@ typedef struct _mmio_cbs {
typedef uc_err (*query_t)(struct uc_struct *uc, uc_query_type type,
size_t *result);
// return 0 on success, -1 on failure
typedef int (*reg_read_t)(struct uc_struct *uc, unsigned int *regs,
void *const *vals, size_t *sizes, int count);
typedef int (*reg_write_t)(struct uc_struct *uc, unsigned int *regs,
const void *const *vals, size_t *sizes, int count);
typedef uc_err (*reg_read_t)(void *env, int mode, unsigned int regid,
void *value, size_t *size);
typedef uc_err (*reg_write_t)(void *env, int mode, unsigned int regid,
const void *value, size_t *size, int *setpc);
typedef int (*context_reg_read_t)(struct uc_context *ctx, unsigned int *regs,
void *const *vals, size_t *sizes, int count);
typedef int (*context_reg_write_t)(struct uc_context *ctx, unsigned int *regs,
const void *const *vals, size_t *sizes,
int count);
typedef struct {
context_reg_read_t context_reg_read;
context_reg_write_t context_reg_write;
reg_read_t read;
reg_write_t write;
} context_reg_rw_t;
typedef void (*reg_reset_t)(struct uc_struct *uc);