2
0

api-user.c 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /*
  2. * QEMU Plugin API - user-mode only implementations
  3. *
  4. * This provides the APIs that have a user-mode specific
  5. * implementations or are only relevant to user-mode.
  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/plugin.h"
  14. #include "exec/log.h"
  15. /*
  16. * Virtual Memory queries - these are all NOPs for user-mode which
  17. * only ever has visibility of virtual addresses.
  18. */
  19. struct qemu_plugin_hwaddr *qemu_plugin_get_hwaddr(qemu_plugin_meminfo_t info,
  20. uint64_t vaddr)
  21. {
  22. return NULL;
  23. }
  24. bool qemu_plugin_hwaddr_is_io(const struct qemu_plugin_hwaddr *haddr)
  25. {
  26. return false;
  27. }
  28. uint64_t qemu_plugin_hwaddr_phys_addr(const struct qemu_plugin_hwaddr *haddr)
  29. {
  30. return 0;
  31. }
  32. const char *qemu_plugin_hwaddr_device_name(const struct qemu_plugin_hwaddr *h)
  33. {
  34. return g_intern_static_string("Invalid");
  35. }
  36. /*
  37. * Time control - for user mode the only real time is wall clock time
  38. * so realistically all you can do in user mode is slow down execution
  39. * which doesn't require the ability to mess with the clock.
  40. */
  41. const void *qemu_plugin_request_time_control(void)
  42. {
  43. return NULL;
  44. }
  45. void qemu_plugin_update_ns(const void *handle, int64_t new_time)
  46. {
  47. qemu_log_mask(LOG_UNIMP, "user-mode can't control time");
  48. }