From 40f33ff8c2bd97c9416867170dc6ed7a08f23a97 Mon Sep 17 00:00:00 2001 From: Volker Ruppert Date: Thu, 21 Jun 2012 17:06:57 +0000 Subject: [PATCH] - don't clear pending interrupt bits when setting the new status --- bochs/iodev/usb/usb_uhci.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bochs/iodev/usb/usb_uhci.cc b/bochs/iodev/usb/usb_uhci.cc index d027146b2..7ac8b58a6 100644 --- a/bochs/iodev/usb/usb_uhci.cc +++ b/bochs/iodev/usb/usb_uhci.cc @@ -832,7 +832,7 @@ void bx_usb_uhci_c::usb_timer(void) // set the status register bit:0 to 1 if SPD is enabled // and if interrupts not masked via interrupt register, raise irq interrupt. - BX_UHCI_THIS hub.usb_status.status2 = (shortpacket) ? 2 : 0; + if (shortpacket) BX_UHCI_THIS hub.usb_status.status2 |= 2; if (shortpacket && BX_UHCI_THIS hub.usb_enable.short_packet) { BX_DEBUG((" [SPD] We want it to fire here (Frame: %04i)", BX_UHCI_THIS hub.usb_frame_num.frame_num)); } @@ -845,7 +845,7 @@ void bx_usb_uhci_c::usb_timer(void) BX_DEBUG((" [IOC] We want it to fire here (Frame: %04i)", BX_UHCI_THIS hub.usb_frame_num.frame_num)); } - BX_UHCI_THIS hub.usb_status.error_interrupt = stalled; + BX_UHCI_THIS hub.usb_status.error_interrupt |= stalled; if (stalled && BX_UHCI_THIS hub.usb_enable.timeout_crc) { BX_DEBUG((" [stalled] We want it to fire here (Frame: %04i)", BX_UHCI_THIS hub.usb_frame_num.frame_num)); } @@ -856,7 +856,7 @@ void bx_usb_uhci_c::usb_timer(void) BX_UHCI_THIS hub.usb_frame_num.frame_num &= (1024-1); // The status.interrupt bit should be set regardless of the enable bits if a IOC or SPD is found - if (BX_UHCI_THIS hub.usb_status.status2 != 0) { + if (interrupt || shortpacket) { BX_UHCI_THIS hub.usb_status.interrupt = 1; } // if we needed to fire an interrupt now, lets do it *after* we increment the frame_num register