Handle tsc rollover.
[seabios.git] / src / usb-ohci.c
index f1ca559d24e8d5fae5ffb7622407bb16c177481e..71202f84232669d842021860ffb8c185ba622b62 100644 (file)
@@ -34,7 +34,7 @@ start_ohci(struct usb_s *cntl, struct ohci_hcca *hcca)
         u32 status = readl(&cntl->ohci.regs->cmdstatus);
         if (! status & OHCI_HCR)
             break;
-        if (rdtscll() > end) {
+        if (check_time(end)) {
             dprintf(1, "Timeout on ohci software reset\n");
             return -1;
         }
@@ -181,7 +181,7 @@ wait_ed(struct ohci_ed *ed)
     for (;;) {
         if (ed->hwHeadP == ed->hwTailP)
             return 0;
-        if (rdtscll() > end) {
+        if (check_time(end)) {
             dprintf(1, "Timeout on wait_ed %p\n", ed);
             return -1;
         }