xref: /openbmc/qemu/include/exec/plugin-gen.h (revision e5013259)
138b47b19SEmilio G. Cota /*
238b47b19SEmilio G. Cota  * Copyright (C) 2017, Emilio G. Cota <cota@braap.org>
338b47b19SEmilio G. Cota  *
438b47b19SEmilio G. Cota  * License: GNU GPL, version 2 or later.
538b47b19SEmilio G. Cota  *   See the COPYING file in the top-level directory.
638b47b19SEmilio G. Cota  *
738b47b19SEmilio G. Cota  * plugin-gen.h - TCG-dependent definitions for generating plugin code
838b47b19SEmilio G. Cota  *
938b47b19SEmilio G. Cota  * This header should be included only from plugin.c and C files that emit
1038b47b19SEmilio G. Cota  * TCG code.
1138b47b19SEmilio G. Cota  */
1238b47b19SEmilio G. Cota #ifndef QEMU_PLUGIN_GEN_H
1338b47b19SEmilio G. Cota #define QEMU_PLUGIN_GEN_H
1438b47b19SEmilio G. Cota 
1538b47b19SEmilio G. Cota #include "tcg/tcg.h"
1638b47b19SEmilio G. Cota 
1738b47b19SEmilio G. Cota struct DisasContextBase;
1838b47b19SEmilio G. Cota 
1938b47b19SEmilio G. Cota #ifdef CONFIG_PLUGIN
2038b47b19SEmilio G. Cota 
21*e5013259SRichard Henderson bool plugin_gen_tb_start(CPUState *cpu, const struct DisasContextBase *db);
22a392277dSMatt Borgerson void plugin_gen_tb_end(CPUState *cpu, size_t num_insns);
2338b47b19SEmilio G. Cota void plugin_gen_insn_start(CPUState *cpu, const struct DisasContextBase *db);
2438b47b19SEmilio G. Cota void plugin_gen_insn_end(void);
2538b47b19SEmilio G. Cota 
2638b47b19SEmilio G. Cota void plugin_gen_disable_mem_helpers(void);
2738b47b19SEmilio G. Cota 
2838b47b19SEmilio G. Cota #else /* !CONFIG_PLUGIN */
2938b47b19SEmilio G. Cota 
30*e5013259SRichard Henderson static inline
plugin_gen_tb_start(CPUState * cpu,const struct DisasContextBase * db)31*e5013259SRichard Henderson bool plugin_gen_tb_start(CPUState *cpu, const struct DisasContextBase *db)
3238b47b19SEmilio G. Cota {
3338b47b19SEmilio G. Cota     return false;
3438b47b19SEmilio G. Cota }
3538b47b19SEmilio G. Cota 
3638b47b19SEmilio G. Cota static inline
plugin_gen_insn_start(CPUState * cpu,const struct DisasContextBase * db)3738b47b19SEmilio G. Cota void plugin_gen_insn_start(CPUState *cpu, const struct DisasContextBase *db)
3838b47b19SEmilio G. Cota { }
3938b47b19SEmilio G. Cota 
plugin_gen_insn_end(void)4038b47b19SEmilio G. Cota static inline void plugin_gen_insn_end(void)
4138b47b19SEmilio G. Cota { }
4238b47b19SEmilio G. Cota 
plugin_gen_tb_end(CPUState * cpu,size_t num_insns)43a392277dSMatt Borgerson static inline void plugin_gen_tb_end(CPUState *cpu, size_t num_insns)
4438b47b19SEmilio G. Cota { }
4538b47b19SEmilio G. Cota 
plugin_gen_disable_mem_helpers(void)4638b47b19SEmilio G. Cota static inline void plugin_gen_disable_mem_helpers(void)
4738b47b19SEmilio G. Cota { }
4838b47b19SEmilio G. Cota 
4938b47b19SEmilio G. Cota #endif /* CONFIG_PLUGIN */
5038b47b19SEmilio G. Cota 
5138b47b19SEmilio G. Cota #endif /* QEMU_PLUGIN_GEN_H */
5238b47b19SEmilio G. Cota 
53