From patchwork Wed Nov 16 21:18:00 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abdiel Janulgue X-Patchwork-Id: 9431503 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 601866021C for ; Wed, 16 Nov 2016 13:22:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5480128652 for ; Wed, 16 Nov 2016 13:22:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4977028671; Wed, 16 Nov 2016 13:22:22 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.3 required=2.0 tests=BAYES_00, DATE_IN_FUTURE_06_12, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0C41428652 for ; Wed, 16 Nov 2016 13:22:21 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 872E56E6A0; Wed, 16 Nov 2016 13:22:21 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by gabe.freedesktop.org (Postfix) with ESMTPS id 954046E6A0 for ; Wed, 16 Nov 2016 13:22:17 +0000 (UTC) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga105.jf.intel.com with ESMTP; 16 Nov 2016 05:22:17 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,500,1473145200"; d="scan'208";a="5018744" Received: from skylake-nuc.fi.intel.com ([10.237.68.38]) by orsmga002.jf.intel.com with ESMTP; 16 Nov 2016 05:22:15 -0800 From: Abdiel Janulgue To: intel-gfx@lists.freedesktop.org Date: Wed, 16 Nov 2016 23:18:00 +0200 Message-Id: <1479331084-11891-2-git-send-email-abdiel.janulgue@linux.intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1479331084-11891-1-git-send-email-abdiel.janulgue@linux.intel.com> References: <1479331084-11891-1-git-send-email-abdiel.janulgue@linux.intel.com> Subject: [Intel-gfx] [i-g-t PATCH v7 1/5] lib: Make signal helper definitions reusable X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP More and more test-cases are using this. Signed-off-by: Abdiel Janulgue --- lib/igt_aux.c | 11 ----------- lib/igt_aux.h | 10 ++++++++++ lib/igt_core.c | 3 --- tests/drv_hangman.c | 1 - 4 files changed, 10 insertions(+), 15 deletions(-) diff --git a/lib/igt_aux.c b/lib/igt_aux.c index 421f6d4..b5ae854 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 d30196b..d4da499 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 9cd5f98..f64c809 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; diff --git a/tests/drv_hangman.c b/tests/drv_hangman.c index f80d65d..db0a077 100644 --- a/tests/drv_hangman.c +++ b/tests/drv_hangman.c @@ -293,7 +293,6 @@ static void test_error_state_capture(unsigned ring_id, * case and it takes a lot more time to wrap, so the acthd can potentially keep * increasing for a long time */ -#define NSEC_PER_SEC 1000000000LL static void hangcheck_unterminated(void) { int fd;