Handle tsc rollover.
[seabios.git] / src / ps2port.c
index 01e8b3d607b45f4ef72f0eed21dac5da2c19386f..25d45446808573ec3b0f8f457104d75b824ebf20 100644 (file)
@@ -152,7 +152,7 @@ ps2_recvbyte(int aux, int needack, int timeout)
 {
     u64 end = calc_future_tsc(timeout);
     for (;;) {
-        if (rdtscll() > end) {
+        if (check_time(end)) {
             dprintf(1, "ps2_recvbyte timeout\n");
             return -1;
         }