accel-user.c 509 B

123456789101112131415161718192021222324
  1. /*
  2. * QEMU accel class, user-mode components
  3. *
  4. * Copyright 2021 SUSE LLC
  5. *
  6. * This work is licensed under the terms of the GNU GPL, version 2 or later.
  7. * See the COPYING file in the top-level directory.
  8. */
  9. #include "qemu/osdep.h"
  10. #include "qemu/accel.h"
  11. AccelState *current_accel(void)
  12. {
  13. static AccelState *accel;
  14. if (!accel) {
  15. AccelClass *ac = accel_find("tcg");
  16. g_assert(ac != NULL);
  17. accel = ACCEL(object_new_with_class(OBJECT_CLASS(ac)));
  18. }
  19. return accel;
  20. }