|
qualcomm/qbox
|
Base class for QBox C++ plugins that bridge QEMU plugin callbacks. More...
#include <libqemu-plugin.h>


Public Member Functions | |
| LibQemuPlugin (const sc_core::sc_module_name &nm, qemu::LibQemu &inst) | |
| void | push_plugin_args (const std::string &plugin_path) |
| void | shutdown_bridge () |
| Stop bridge dispatch and drain in-flight callbacks. | |
| void * | handle_as_userdata () const |
Static Public Member Functions | |
| template<typename Body> | |
| static void | dispatch_userdata (void *userdata, Body body) |
Run body on the live plugin instance, holding a refcount for the duration. No-op when the handle is null or alive==false. | |
Protected Attributes | |
| cci::cci_param< uint64_t > | m_id |
| qemu::LibQemu & | m_inst |
| PluginHandle * | m_handle |
Base class for QBox C++ plugins that bridge QEMU plugin callbacks.
|
inlinestatic |
Run body on the live plugin instance, holding a refcount for the duration. No-op when the handle is null or alive==false.
Every subclass callback funnels through here:
m_inst.plugin_api().qemu_plugin_register_vcpu_init_cb(
m_id,
[](int idx, void* userdata) {
LibQemuPlugin::dispatch_userdata(userdata, [&](LibQemuPlugin* p) {
static_cast<MyPlugin*>(p)->my_cb(idx);
});
},
handle_as_userdata());
|
inline |
Stop bridge dispatch and drain in-flight callbacks.
m_handle->alive's exchange is the once-guard. Flips the handle dead so new dispatches bail, then waits for the shared refcount to drain. The handle itself is intentionally leaked.