From patchwork Mon Oct 6 10:23:19 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ciprian Barbu X-Patchwork-Id: 38360 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f69.google.com (mail-la0-f69.google.com [209.85.215.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id EAC35202E7 for ; Mon, 6 Oct 2014 10:24:02 +0000 (UTC) Received: by mail-la0-f69.google.com with SMTP id q1sf2570573lam.8 for ; Mon, 06 Oct 2014 03:24:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:subject:precedence:list-id:list-unsubscribe:list-archive :list-post:list-help:list-subscribe:mime-version:errors-to:sender :x-original-sender:x-original-authentication-results:mailing-list :content-type:content-transfer-encoding; bh=t3icpscXa/jpPGh6pzeTDTs452hhjV6gz6UMa9LIYzA=; b=WASEmKkVl7YeZgxNGHm42vF2EDW3pJCNxERPi34VxR4vLxoJVWtWi34mBidA8dg9Hk v679AeCCMd3YBmj5jztoQH3vWQngj98gCLoXjtED2eu0CAhjmcLUpD31U4L+GhBgzXmt kLRuQX6Y/uPZBVxB/dSHvP4OXboEvXul4dmHvHYP9wCvVaH7LY1LgCeXm9xTdOQD/xJT NSXPGC0NWq0L0aNv9JHt5u93aubW/C5iyj7SExk5Zksim82iU122+qtc19psrwsUl0o3 BhxpDSDwXZCduXP+Qs6qJMOeiQGkxNkdM7SHX7P7SIC7Go8uhWXaGezirxuR246sIm1S vcBg== X-Gm-Message-State: ALoCoQn4Cw56DS/9y0nriKNxeg1gV2YSrPLVAaRt/+moccmnwLeSm4LgqO6Ygnxr+8MXFY47DWvX X-Received: by 10.112.137.230 with SMTP id ql6mr238912lbb.13.1412591041301; Mon, 06 Oct 2014 03:24:01 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.205.74 with SMTP id le10ls465752lac.1.gmail; Mon, 06 Oct 2014 03:24:01 -0700 (PDT) X-Received: by 10.152.23.199 with SMTP id o7mr24287978laf.26.1412591040995; Mon, 06 Oct 2014 03:24:00 -0700 (PDT) Received: from mail-la0-f52.google.com (mail-la0-f52.google.com [209.85.215.52]) by mx.google.com with ESMTPS id d2si23316275lbv.18.2014.10.06.03.24.00 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 06 Oct 2014 03:24:00 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.52 as permitted sender) client-ip=209.85.215.52; Received: by mail-la0-f52.google.com with SMTP id hz20so4023678lab.39 for ; Mon, 06 Oct 2014 03:24:00 -0700 (PDT) X-Received: by 10.152.7.145 with SMTP id j17mr13902357laa.67.1412591040868; Mon, 06 Oct 2014 03:24:00 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.130.169 with SMTP id of9csp157241lbb; Mon, 6 Oct 2014 03:24:00 -0700 (PDT) X-Received: by 10.229.219.65 with SMTP id ht1mr29117067qcb.2.1412591039592; Mon, 06 Oct 2014 03:23:59 -0700 (PDT) Received: from ip-10-35-177-41.ec2.internal (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTPS id 33si24357382qgl.127.2014.10.06.03.23.58 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 06 Oct 2014 03:23:59 -0700 (PDT) Received-SPF: none (google.com: lng-odp-bounces@lists.linaro.org does not designate permitted sender hosts) client-ip=54.225.227.206; Received: from localhost ([127.0.0.1] helo=ip-10-35-177-41.ec2.internal) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1Xb5SQ-0004vo-7o; Mon, 06 Oct 2014 10:23:58 +0000 Received: from mail-la0-f48.google.com ([209.85.215.48]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1Xb5SF-0004vJ-7J for lng-odp@lists.linaro.org; Mon, 06 Oct 2014 10:23:47 +0000 Received: by mail-la0-f48.google.com with SMTP id gi9so4110521lab.35 for ; Mon, 06 Oct 2014 03:23:41 -0700 (PDT) X-Received: by 10.152.9.132 with SMTP id z4mr24279956laa.8.1412591020986; Mon, 06 Oct 2014 03:23:40 -0700 (PDT) Received: from cipriantemp.enea.se (sestofw01.enea.se. [192.36.1.252]) by mx.google.com with ESMTPSA id d9sm5575882lbp.49.2014.10.06.03.23.39 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 06 Oct 2014 03:23:40 -0700 (PDT) From: Ciprian Barbu To: lng-odp@lists.linaro.org Date: Mon, 6 Oct 2014 13:23:19 +0300 Message-Id: <1412591001-6850-2-git-send-email-ciprian.barbu@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1412591001-6850-1-git-send-email-ciprian.barbu@linaro.org> References: <1412591001-6850-1-git-send-email-ciprian.barbu@linaro.org> X-Topics: patch Subject: [lng-odp] [lng-odp-dpdk][PATCH 1/3] linux-dpdk: Add ODP_ABORT X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: lng-odp-bounces@lists.linaro.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ciprian.barbu@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.52 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 Signed-off-by: Ciprian Barbu --- platform/linux-dpdk/include/api/odp_debug.h | 87 +++++++++++++++++++++++++++++ platform/linux-dpdk/include/odp_debug.h | 75 ------------------------- 2 files changed, 87 insertions(+), 75 deletions(-) create mode 100644 platform/linux-dpdk/include/api/odp_debug.h delete mode 100644 platform/linux-dpdk/include/odp_debug.h diff --git a/platform/linux-dpdk/include/api/odp_debug.h b/platform/linux-dpdk/include/api/odp_debug.h new file mode 100644 index 0000000..6b145b5 --- /dev/null +++ b/platform/linux-dpdk/include/api/odp_debug.h @@ -0,0 +1,87 @@ +/* Copyright (c) 2013, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ +/** + * @file + * + * ODP debug + */ + +#ifndef ODP_DEBUG_H_ +#define ODP_DEBUG_H_ + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef __GNUC__ + +/** + * Indicate deprecated variables, functions or types + */ +#define ODP_DEPRECATED __attribute__((__deprecated__)) + +/** + * Intentionally unused variables ot functions + */ +#define ODP_UNUSED __attribute__((__unused__)) + +#else + +#define ODP_DEPRECATED +#define ODP_UNUSED + +#endif + +/** + * Runtime assertion-macro - aborts if 'cond' is false. + */ +#ifndef ODP_NO_DEBUG +#define ODP_ASSERT(cond, msg) \ + do { if (!(cond)) {ODP_ERR("%s\n", msg); abort(); } } while (0) +#else +#define ODP_ASSERT(cond, msg) +#endif + +/** + * Compile time assertion-macro - fail compilation if cond is false. + * @note This macro has zero runtime overhead + */ +#define ODP_STATIC_ASSERT(cond, msg) _Static_assert(1, msg) + +/** + * Debug printing macro, which prints output when DEBUG flag is set. + */ +#define ODP_DBG(fmt, ...) \ + do { if (ODP_DEBUG_PRINT == 1) \ + printf(fmt, ##__VA_ARGS__); \ + } while (0) + +/** + * Print output to stderr (file, line and function). + */ +#define ODP_ERR(fmt, ...) \ +do { fprintf(stderr, "%s:%d:%s(): " fmt, __FILE__, \ + __LINE__, __func__, ##__VA_ARGS__); \ +} while (0) + +/** + * Print output to stderr (file, line and function), + * then abort. + */ +#define ODP_ABORT(fmt, ...) \ +do { fprintf(stderr, "%s:%d:%s(): " fmt, __FILE__, \ + __LINE__, __func__, ##__VA_ARGS__); \ + abort(); \ +} while (0) + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/platform/linux-dpdk/include/odp_debug.h b/platform/linux-dpdk/include/odp_debug.h deleted file mode 100644 index 489a22e..0000000 --- a/platform/linux-dpdk/include/odp_debug.h +++ /dev/null @@ -1,75 +0,0 @@ -/* Copyright (c) 2013, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -/** - * @file - * - * ODP debug - */ - -#ifndef ODP_DEBUG_H_ -#define ODP_DEBUG_H_ - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef __GNUC__ - -/** - * Indicate deprecated variables, functions or types - */ -#define ODP_DEPRECATED __attribute__((__deprecated__)) - -/** - * Intentionally unused variables ot functions - */ -#define ODP_UNUSED __attribute__((__unused__)) - -#else - -#define ODP_DEPRECATED -#define ODP_UNUSED - -#endif - -/** - * Runtime assertion-macro - aborts if 'cond' is false. - */ -#ifndef ODP_NO_DEBUG -#define ODP_ASSERT(cond, msg) \ - do { if (!(cond)) {ODP_ERR("%s\n", msg); abort(); } } while (0) -#else -#define ODP_ASSERT(cond, msg) -#endif - -/** - * Compile time assertion-macro - fail compilation if cond is false. - * @note This macro has zero runtime overhead - */ -#define ODP_STATIC_ASSERT(cond, msg) _Static_assert(1, msg) - -/** - * Debug printing macro, which prints output when DEBUG flag is set. - */ -#define ODP_DBG(fmt, ...) \ - do { if (ODP_DEBUG_PRINT == 1) \ - printf(fmt, ##__VA_ARGS__); \ - } while (0) - -/** - * Print output to stderr (file, line and function). - */ -#define ODP_ERR(fmt, ...) \ - fprintf(stderr, "%s:%d:%s(): " fmt, __FILE__, \ - __LINE__, __func__, ##__VA_ARGS__) - -#ifdef __cplusplus -} -#endif - -#endif