diff options
author | Abdiel Janulgue <abdiel.janulgue@linux.intel.com> | 2016-11-16 21:38:20 +0200 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2016-11-29 11:32:44 +0000 |
commit | d529a5748f28bafd2aa74a1166e391c9468bf49d (patch) | |
tree | f16821dc6c578379ac7f685bbeba43433cba1cd5 /lib | |
parent | f2428552bbc43f8aa5714554b6cdf162d21e5303 (diff) |
lib: Make signal helper definitions reusable
Lots of test cases are re-declaring this.
v2: Remove definition in benchmarks/gem_syslatency.c
Signed-off-by: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/igt_aux.c | 11 | ||||
-rw-r--r-- | lib/igt_aux.h | 10 | ||||
-rw-r--r-- | lib/igt_core.c | 3 |
3 files changed, 10 insertions, 14 deletions
diff --git a/lib/igt_aux.c b/lib/igt_aux.c index 421f6d4e..b5ae8543 100644 --- a/lib/igt_aux.c +++ b/lib/igt_aux.c @@ -75,17 +75,6 @@ * fit into any other topic. */ - -/* signal interrupt helpers */ - -#define MSEC_PER_SEC (1000) -#define USEC_PER_SEC (1000*MSEC_PER_SEC) -#define NSEC_PER_SEC (1000*USEC_PER_SEC) - -/* signal interrupt helpers */ -#define gettid() syscall(__NR_gettid) -#define sigev_notify_thread_id _sigev_un._tid - static struct __igt_sigiter_global { pid_t tid; timer_t timer; diff --git a/lib/igt_aux.h b/lib/igt_aux.h index d30196b9..d4da499a 100644 --- a/lib/igt_aux.h +++ b/lib/igt_aux.h @@ -35,6 +35,16 @@ extern drm_intel_bo **trash_bos; extern int num_trash_bos; +/* signal interrupt helpers */ + +#define MSEC_PER_SEC (1000) +#define USEC_PER_SEC (1000*MSEC_PER_SEC) +#define NSEC_PER_SEC (1000*USEC_PER_SEC) + +/* signal interrupt helpers */ +#define gettid() syscall(__NR_gettid) +#define sigev_notify_thread_id _sigev_un._tid + /* auxialiary igt helpers from igt_aux.c */ /* generally useful helpers */ void igt_fork_signal_helper(void); diff --git a/lib/igt_core.c b/lib/igt_core.c index 9cd5f98d..f64c809a 100644 --- a/lib/igt_core.c +++ b/lib/igt_core.c @@ -398,9 +398,6 @@ error: return -errno; } -#define MSEC_PER_SEC (1000) -#define USEC_PER_SEC (1000*MSEC_PER_SEC) -#define NSEC_PER_SEC (1000*USEC_PER_SEC) uint64_t igt_nsec_elapsed(struct timespec *start) { struct timespec now; |