MAINTAINERS: Make section QOM cover hw/core/*bus.c as well
[qemu/armbru.git] / include / exec / plugin-gen.h
blob4834a9e2f40a9fbf9f3ea0d7d3786063c0af5ed0
1 /*
2 * Copyright (C) 2017, Emilio G. Cota <cota@braap.org>
4 * License: GNU GPL, version 2 or later.
5 * See the COPYING file in the top-level directory.
7 * plugin-gen.h - TCG-dependent definitions for generating plugin code
9 * This header should be included only from plugin.c and C files that emit
10 * TCG code.
12 #ifndef QEMU_PLUGIN_GEN_H
13 #define QEMU_PLUGIN_GEN_H
15 #include "qemu/plugin.h"
16 #include "tcg/tcg.h"
18 struct DisasContextBase;
20 #ifdef CONFIG_PLUGIN
22 bool plugin_gen_tb_start(CPUState *cpu, const TranslationBlock *tb);
23 void plugin_gen_tb_end(CPUState *cpu);
24 void plugin_gen_insn_start(CPUState *cpu, const struct DisasContextBase *db);
25 void plugin_gen_insn_end(void);
27 void plugin_gen_disable_mem_helpers(void);
28 void plugin_gen_empty_mem_callback(TCGv addr, uint32_t info);
30 static inline void plugin_insn_append(const void *from, size_t size)
32 struct qemu_plugin_insn *insn = tcg_ctx->plugin_insn;
34 if (insn == NULL) {
35 return;
38 insn->data = g_byte_array_append(insn->data, from, size);
41 #else /* !CONFIG_PLUGIN */
43 static inline
44 bool plugin_gen_tb_start(CPUState *cpu, const TranslationBlock *tb)
46 return false;
49 static inline
50 void plugin_gen_insn_start(CPUState *cpu, const struct DisasContextBase *db)
51 { }
53 static inline void plugin_gen_insn_end(void)
54 { }
56 static inline void plugin_gen_tb_end(CPUState *cpu)
57 { }
59 static inline void plugin_gen_disable_mem_helpers(void)
60 { }
62 static inline void plugin_gen_empty_mem_callback(TCGv addr, uint32_t info)
63 { }
65 static inline void plugin_insn_append(const void *from, size_t size)
66 { }
68 #endif /* CONFIG_PLUGIN */
70 #endif /* QEMU_PLUGIN_GEN_H */