mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 07:43:54 -06:00
plugins: Move function pointer in qemu_plugin_dyn_cb
The out-of-line function pointer is mutually exclusive with inline expansion, so move it into the union. Wrap the pointer in a structure named 'regular' to match PLUGIN_CB_REGULAR. Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
parent
25875fe92e
commit
aff56de576
3 changed files with 9 additions and 7 deletions
|
@ -342,7 +342,7 @@ void plugin_register_dyn_cb__udata(GArray **arr,
|
|||
|
||||
dyn_cb->userp = udata;
|
||||
/* Note flags are discarded as unused. */
|
||||
dyn_cb->f.vcpu_udata = cb;
|
||||
dyn_cb->regular.f.vcpu_udata = cb;
|
||||
dyn_cb->type = PLUGIN_CB_REGULAR;
|
||||
}
|
||||
|
||||
|
@ -359,7 +359,7 @@ void plugin_register_vcpu_mem_cb(GArray **arr,
|
|||
/* Note flags are discarded as unused. */
|
||||
dyn_cb->type = PLUGIN_CB_REGULAR;
|
||||
dyn_cb->rw = rw;
|
||||
dyn_cb->f.generic = cb;
|
||||
dyn_cb->regular.f.vcpu_mem = cb;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -511,8 +511,8 @@ void qemu_plugin_vcpu_mem_cb(CPUState *cpu, uint64_t vaddr,
|
|||
}
|
||||
switch (cb->type) {
|
||||
case PLUGIN_CB_REGULAR:
|
||||
cb->f.vcpu_mem(cpu->cpu_index, make_plugin_meminfo(oi, rw),
|
||||
vaddr, cb->userp);
|
||||
cb->regular.f.vcpu_mem(cpu->cpu_index, make_plugin_meminfo(oi, rw),
|
||||
vaddr, cb->userp);
|
||||
break;
|
||||
case PLUGIN_CB_INLINE:
|
||||
exec_inline_op(cb, cpu->cpu_index);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue