Skip to content

Commit

Permalink
include/qemu/plugin: Inline qemu_plugin_disable_mem_helpers
Browse files Browse the repository at this point in the history
Now that we've broken the include loop with cpu.h,
we can bring this inline.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20230310195252.210956-8-richard.henderson@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20230315174331.2959-18-alex.bennee@linaro.org>
  • Loading branch information
rth7680 authored and stsquad committed Mar 17, 2023
1 parent b29af34 commit 0255e21
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 12 deletions.
6 changes: 5 additions & 1 deletion include/qemu/plugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include "qemu/option.h"
#include "qemu/plugin-event.h"
#include "exec/memopidx.h"
#include "hw/core/cpu.h"

/*
* Option parsing/processing.
Expand Down Expand Up @@ -204,7 +205,10 @@ void qemu_plugin_atexit_cb(void);

void qemu_plugin_add_dyn_cb_arr(GArray *arr);

void qemu_plugin_disable_mem_helpers(CPUState *cpu);
static inline void qemu_plugin_disable_mem_helpers(CPUState *cpu)
{
cpu->plugin_mem_cbs = NULL;
}

/**
* qemu_plugin_user_exit(): clean-up callbacks before calling exit callbacks
Expand Down
11 changes: 0 additions & 11 deletions plugins/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -553,17 +553,6 @@ void qemu_plugin_user_postfork(bool is_child)
}
}


/*
* Call this function after longjmp'ing to the main loop. It's possible that the
* last instruction of a TB might have used helpers, and therefore the
* "disable" instruction will never execute because it ended up as dead code.
*/
void qemu_plugin_disable_mem_helpers(CPUState *cpu)
{
cpu->plugin_mem_cbs = NULL;
}

static bool plugin_dyn_cb_arr_cmp(const void *ap, const void *bp)
{
return ap == bp;
Expand Down

0 comments on commit 0255e21

Please sign in to comment.