plugin-gen.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /*
  2. * Copyright (C) 2017, Emilio G. Cota <cota@braap.org>
  3. *
  4. * License: GNU GPL, version 2 or later.
  5. * See the COPYING file in the top-level directory.
  6. *
  7. * plugin-gen.h - TCG-dependent definitions for generating plugin code
  8. *
  9. * This header should be included only from plugin.c and C files that emit
  10. * TCG code.
  11. */
  12. #ifndef QEMU_PLUGIN_GEN_H
  13. #define QEMU_PLUGIN_GEN_H
  14. #include "tcg/tcg.h"
  15. struct DisasContextBase;
  16. #ifdef CONFIG_PLUGIN
  17. bool plugin_gen_tb_start(CPUState *cpu, const struct DisasContextBase *db);
  18. void plugin_gen_tb_end(CPUState *cpu, size_t num_insns);
  19. void plugin_gen_insn_start(CPUState *cpu, const struct DisasContextBase *db);
  20. void plugin_gen_insn_end(void);
  21. void plugin_gen_disable_mem_helpers(void);
  22. #else /* !CONFIG_PLUGIN */
  23. static inline
  24. bool plugin_gen_tb_start(CPUState *cpu, const struct DisasContextBase *db)
  25. {
  26. return false;
  27. }
  28. static inline
  29. void plugin_gen_insn_start(CPUState *cpu, const struct DisasContextBase *db)
  30. { }
  31. static inline void plugin_gen_insn_end(void)
  32. { }
  33. static inline void plugin_gen_tb_end(CPUState *cpu, size_t num_insns)
  34. { }
  35. static inline void plugin_gen_disable_mem_helpers(void)
  36. { }
  37. #endif /* CONFIG_PLUGIN */
  38. #endif /* QEMU_PLUGIN_GEN_H */