stubs-system.c 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /*
  2. * Semihosting Stubs for system emulation
  3. *
  4. * Copyright (c) 2019 Linaro Ltd
  5. *
  6. * Stubs for system targets that don't actually do semihosting.
  7. *
  8. * SPDX-License-Identifier: GPL-2.0-or-later
  9. */
  10. #include "qemu/osdep.h"
  11. #include "qemu/option.h"
  12. #include "qemu/error-report.h"
  13. #include "semihosting/semihost.h"
  14. /* Empty config */
  15. QemuOptsList qemu_semihosting_config_opts = {
  16. .name = "",
  17. .head = QTAILQ_HEAD_INITIALIZER(qemu_semihosting_config_opts.head),
  18. .desc = {
  19. { /* end of list */ }
  20. },
  21. };
  22. /* Queries to config status default to off */
  23. bool semihosting_enabled(bool is_user)
  24. {
  25. return false;
  26. }
  27. /*
  28. * All the rest are empty subs. We could g_assert_not_reached() but
  29. * that adds extra weight to the final binary. Waste not want not.
  30. */
  31. void qemu_semihosting_enable(void)
  32. {
  33. }
  34. int qemu_semihosting_config_options(const char *optstr)
  35. {
  36. return 1;
  37. }
  38. const char *semihosting_get_arg(int i)
  39. {
  40. return NULL;
  41. }
  42. int semihosting_get_argc(void)
  43. {
  44. return 0;
  45. }
  46. const char *semihosting_get_cmdline(void)
  47. {
  48. return NULL;
  49. }
  50. void semihosting_arg_fallback(const char *file, const char *cmd)
  51. {
  52. }
  53. void qemu_semihosting_chardev_init(void)
  54. {
  55. }