Patchwork [RFC,2/3] target-s390x: Prepare qtest hypercall support

login
register
mail settings
Submitter Andreas Färber
Date Jan. 23, 2013, 10:01 a.m.
Message ID <1358935314-18768-3-git-send-email-afaerber@suse.de>
Download mbox | patch
Permalink /patch/214876/
State New
Headers show

Comments

Andreas Färber - Jan. 23, 2013, 10:01 a.m.
Signed-off-by: Andreas Färber <afaerber@suse.de>
---
 hw/s390x/s390-virtio-hcall.c |   17 +++++++++++++++++
 1 Datei geändert, 17 Zeilen hinzugefügt(+)

Patch

diff --git a/hw/s390x/s390-virtio-hcall.c b/hw/s390x/s390-virtio-hcall.c
index d7938c0..6d044f8 100644
--- a/hw/s390x/s390-virtio-hcall.c
+++ b/hw/s390x/s390-virtio-hcall.c
@@ -11,6 +11,7 @@ 
 
 #include "cpu.h"
 #include "hw/s390-virtio.h"
+#include "sysemu/qtest.h"
 
 #define MAX_DIAG_SUBCODES 255
 
@@ -34,3 +35,19 @@  int s390_virtio_hypercall(CPUS390XState *env)
 
     return fn(&env->regs[2]);
 }
+
+int qtest_hypercall(uint64_t code, uint64_t *args)
+{
+    s390_virtio_fn fn = s390_diag500_table[code];
+
+    if (fn == NULL) {
+        return -EINVAL;
+    }
+
+    return fn(args);
+}
+
+bool qtest_hypercall_supported(void)
+{
+    return true;
+}