mirror of https://github.com/xemu-project/xemu.git
accel/tcg: Merge gen_mem_wrapped with plugin_gen_empty_mem_callback
As gen_mem_wrapped is only used in plugin_gen_empty_mem_callback, we can avoid the curiosity of union mem_gen_fn by inlining it. Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
parent
76cef4b233
commit
f5c346ac41
|
@ -202,35 +202,17 @@ static void plugin_gen_empty_callback(enum plugin_gen_from from)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
union mem_gen_fn {
|
void plugin_gen_empty_mem_callback(TCGv addr, uint32_t info)
|
||||||
void (*mem_fn)(TCGv, uint32_t);
|
|
||||||
void (*inline_fn)(void);
|
|
||||||
};
|
|
||||||
|
|
||||||
static void gen_mem_wrapped(enum plugin_gen_cb type,
|
|
||||||
const union mem_gen_fn *f, TCGv addr,
|
|
||||||
uint32_t info, bool is_mem)
|
|
||||||
{
|
{
|
||||||
enum qemu_plugin_mem_rw rw = get_plugin_meminfo_rw(info);
|
enum qemu_plugin_mem_rw rw = get_plugin_meminfo_rw(info);
|
||||||
|
|
||||||
gen_plugin_cb_start(PLUGIN_GEN_FROM_MEM, type, rw);
|
gen_plugin_cb_start(PLUGIN_GEN_FROM_MEM, PLUGIN_GEN_CB_MEM, rw);
|
||||||
if (is_mem) {
|
gen_empty_mem_cb(addr, info);
|
||||||
f->mem_fn(addr, info);
|
|
||||||
} else {
|
|
||||||
f->inline_fn();
|
|
||||||
}
|
|
||||||
tcg_gen_plugin_cb_end();
|
tcg_gen_plugin_cb_end();
|
||||||
}
|
|
||||||
|
|
||||||
void plugin_gen_empty_mem_callback(TCGv addr, uint32_t info)
|
gen_plugin_cb_start(PLUGIN_GEN_FROM_MEM, PLUGIN_GEN_CB_INLINE, rw);
|
||||||
{
|
gen_empty_inline_cb();
|
||||||
union mem_gen_fn fn;
|
tcg_gen_plugin_cb_end();
|
||||||
|
|
||||||
fn.mem_fn = gen_empty_mem_cb;
|
|
||||||
gen_mem_wrapped(PLUGIN_GEN_CB_MEM, &fn, addr, info, true);
|
|
||||||
|
|
||||||
fn.inline_fn = gen_empty_inline_cb;
|
|
||||||
gen_mem_wrapped(PLUGIN_GEN_CB_INLINE, &fn, 0, info, false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static TCGOp *find_op(TCGOp *op, TCGOpcode opc)
|
static TCGOp *find_op(TCGOp *op, TCGOpcode opc)
|
||||||
|
|
Loading…
Reference in New Issue