aboutsummaryrefslogtreecommitdiff
path: root/accel/accel-user.c
diff options
context:
space:
mode:
authorClaudio Fontana <cfontana@suse.de>2021-02-04 17:39:24 +0100
committerRichard Henderson <richard.henderson@linaro.org>2021-02-05 10:24:15 -1000
commit940e43aa30e0f793bd18b79221296cdf17724018 (patch)
tree9ab6484293ad85368f66aaf72ee944493cf3913c /accel/accel-user.c
parent78271684719f34c1cc19f895e089f2f19b69698d (diff)
downloadqemu-940e43aa30e0f793bd18b79221296cdf17724018.zip
qemu-940e43aa30e0f793bd18b79221296cdf17724018.tar.gz
qemu-940e43aa30e0f793bd18b79221296cdf17724018.tar.bz2
accel: extend AccelState and AccelClass to user-mode
Signed-off-by: Claudio Fontana <cfontana@suse.de> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> [claudio: rebased on Richard's splitwx work] Signed-off-by: Claudio Fontana <cfontana@suse.de> Message-Id: <20210204163931.7358-17-cfontana@suse.de> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'accel/accel-user.c')
-rw-r--r--accel/accel-user.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/accel/accel-user.c b/accel/accel-user.c
new file mode 100644
index 0000000..22b6a1a
--- /dev/null
+++ b/accel/accel-user.c
@@ -0,0 +1,24 @@
+/*
+ * QEMU accel class, user-mode components
+ *
+ * Copyright 2021 SUSE LLC
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2 or later.
+ * See the COPYING file in the top-level directory.
+ */
+
+#include "qemu/osdep.h"
+#include "qemu/accel.h"
+
+AccelState *current_accel(void)
+{
+ static AccelState *accel;
+
+ if (!accel) {
+ AccelClass *ac = accel_find("tcg");
+
+ g_assert(ac != NULL);
+ accel = ACCEL(object_new_with_class(OBJECT_CLASS(ac)));
+ }
+ return accel;
+}