@@ -23,6 +23,8 @@
* Authors: Paulo Zanoni <paulo.r.zanoni@intel.com>
*
*/
+
+#include <sys/time.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
@@ -311,6 +313,14 @@ static void setup_alarm(void)
sigaction(SIGALRM, &sa, NULL);
}
+static void set_alarm(time_t sec, suseconds_t usec) {
+ struct itimerval timerval = {{0, 0}, {sec, usec}};
+
+ alarm_received = false;
+ igt_assert(setitimer(ITIMER_REAL, &timerval, NULL) == 0); }
+
static void unset_mode(void)
{
int rc;
@@ -370,8 +380,7 @@ static void wait_until_idle(void)
uint64_t tsc, pc, res;