]> Git Repo - qemu.git/commitdiff
s390-ccw.img: Enhance drain_irqs().
authorCornelia Huck <[email protected]>
Fri, 26 Apr 2013 02:12:53 +0000 (02:12 +0000)
committerAlexander Graf <[email protected]>
Fri, 26 Apr 2013 18:18:24 +0000 (20:18 +0200)
- Use tpi + tsch to get interrupts.
- Return an error if the irb indicates problems.

Signed-off-by: Cornelia Huck <[email protected]>
Signed-off-by: Alexander Graf <[email protected]>
pc-bios/s390-ccw/virtio.c

index 1968fc6619ef6769f49949e831ee9a5256326c5c..1bd17d4781e02efda9cd7547f9165a4304166f80 100644 (file)
@@ -38,12 +38,21 @@ static void virtio_notify(struct subchannel_id schid)
  *             Virtio functions                *
  ***********************************************/
 
-static void drain_irqs(struct subchannel_id schid)
+static int drain_irqs(struct subchannel_id schid)
 {
     struct irb irb = {};
+    int r = 0;
+
     while (1) {
+        /* FIXME: make use of TPI, for that enable subchannel and isc */
         if (tsch(schid, &irb)) {
-            return;
+            /* Might want to differentiate error codes later on. */
+            if (irb.scsw.cstat) {
+                r = -EIO;
+            } else if (irb.scsw.dstat != 0xc) {
+                r = -EIO;
+            }
+            return r;
         }
     }
 }
This page took 0.033863 seconds and 4 git commands to generate.