plugin-api.c.inc 1002 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /*
  2. * QEMU Plugin API - *-user-mode only implementations
  3. *
  4. * Common user-mode only APIs are in plugins/api-user. These helpers
  5. * are only specific to the *-user frontends.
  6. *
  7. * Copyright (C) 2017, Emilio G. Cota <cota@braap.org>
  8. * Copyright (C) 2019-2025, Linaro
  9. *
  10. * SPDX-License-Identifier: GPL-2.0-or-later
  11. */
  12. #include "qemu/osdep.h"
  13. #include "qemu/main-loop.h"
  14. #include "qemu/plugin.h"
  15. #include "qemu.h"
  16. /*
  17. * Binary path, start and end locations. Host specific due to TaskState.
  18. */
  19. const char *qemu_plugin_path_to_binary(void)
  20. {
  21. TaskState *ts = get_task_state(current_cpu);
  22. return g_strdup(ts->bprm->filename);
  23. }
  24. uint64_t qemu_plugin_start_code(void)
  25. {
  26. TaskState *ts = get_task_state(current_cpu);
  27. return ts->info->start_code;
  28. }
  29. uint64_t qemu_plugin_end_code(void)
  30. {
  31. TaskState *ts = get_task_state(current_cpu);
  32. return ts->info->end_code;
  33. }
  34. uint64_t qemu_plugin_entry_code(void)
  35. {
  36. TaskState *ts = get_task_state(current_cpu);
  37. return ts->info->entry;
  38. }