]> Git Repo - qemu.git/commitdiff
xhci: move register update into xhci_intr_raise
authorGerd Hoffmann <[email protected]>
Thu, 30 Aug 2012 12:04:04 +0000 (14:04 +0200)
committerGerd Hoffmann <[email protected]>
Tue, 11 Sep 2012 05:43:02 +0000 (07:43 +0200)
Now that we have a separate function to raise an IRQ we can move
some comon code into the function.

Signed-off-by: Gerd Hoffmann <[email protected]>
hw/usb/hcd-xhci.c

index 19bbb164e69b6036711d691a7e8d6d14937fd6dc..8dc9986e5339e019644813d797839ecd6d0a96ff 100644 (file)
@@ -662,8 +662,11 @@ static void xhci_msix_update(XHCIState *xhci)
 
 static void xhci_intr_raise(XHCIState *xhci)
 {
-    if (!(xhci->iman & IMAN_IP) ||
-        !(xhci->iman & IMAN_IE)) {
+    xhci->erdp_low |= ERDP_EHB;
+    xhci->iman |= IMAN_IP;
+    xhci->usbsts |= USBSTS_EINT;
+
+    if (!(xhci->iman & IMAN_IE)) {
         return;
     }
 
@@ -784,9 +787,6 @@ static void xhci_events_update(XHCIState *xhci)
     }
 
     if (do_irq) {
-        xhci->erdp_low |= ERDP_EHB;
-        xhci->iman |= IMAN_IP;
-        xhci->usbsts |= USBSTS_EINT;
         xhci_intr_raise(xhci);
     }
 
@@ -847,10 +847,6 @@ static void xhci_event(XHCIState *xhci, XHCIEvent *event)
         xhci_write_event(xhci, event);
     }
 
-    xhci->erdp_low |= ERDP_EHB;
-    xhci->iman |= IMAN_IP;
-    xhci->usbsts |= USBSTS_EINT;
-
     xhci_intr_raise(xhci);
 }
 
This page took 0.026538 seconds and 4 git commands to generate.