… | |
… | |
196 | |
196 | |
197 | /*****************************************************************************/ |
197 | /*****************************************************************************/ |
198 | |
198 | |
199 | #define ETP_NUM_PRI (ETP_PRI_MAX - ETP_PRI_MIN + 1) |
199 | #define ETP_NUM_PRI (ETP_PRI_MAX - ETP_PRI_MIN + 1) |
200 | |
200 | |
201 | /* calculcate time difference in ~1/EIO_TICKS of a second */ |
201 | /* calculate time difference in ~1/EIO_TICKS of a second */ |
202 | static int tvdiff (struct timeval *tv1, struct timeval *tv2) |
202 | static int tvdiff (struct timeval *tv1, struct timeval *tv2) |
203 | { |
203 | { |
204 | return (tv2->tv_sec - tv1->tv_sec ) * EIO_TICKS |
204 | return (tv2->tv_sec - tv1->tv_sec ) * EIO_TICKS |
205 | + ((tv2->tv_usec - tv1->tv_usec) >> 10); |
205 | + ((tv2->tv_usec - tv1->tv_usec) >> 10); |
206 | } |
206 | } |
… | |
… | |
598 | } |
598 | } |
599 | |
599 | |
600 | static void etp_set_max_poll_time (double nseconds) |
600 | static void etp_set_max_poll_time (double nseconds) |
601 | { |
601 | { |
602 | if (WORDACCESS_UNSAFE) X_LOCK (reslock); |
602 | if (WORDACCESS_UNSAFE) X_LOCK (reslock); |
603 | max_poll_time = nseconds; |
603 | max_poll_time = nseconds * EIO_TICKS; |
604 | if (WORDACCESS_UNSAFE) X_UNLOCK (reslock); |
604 | if (WORDACCESS_UNSAFE) X_UNLOCK (reslock); |
605 | } |
605 | } |
606 | |
606 | |
607 | static void etp_set_max_poll_reqs (unsigned int maxreqs) |
607 | static void etp_set_max_poll_reqs (unsigned int maxreqs) |
608 | { |
608 | { |