From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dispatch1-us1.ppe-hosted.com (dispatch1-us1.ppe-hosted.com [67.231.154.164]) by dpdk.org (Postfix) with ESMTP id 50ED84C90 for ; Mon, 10 Sep 2018 11:33:51 +0200 (CEST) X-Virus-Scanned: Proofpoint Essentials engine Received: from webmail.solarflare.com (webmail.solarflare.com [12.187.104.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mx1-us1.ppe-hosted.com (Proofpoint Essentials ESMTP Server) with ESMTPS id 70739780055 for ; Mon, 10 Sep 2018 09:33:50 +0000 (UTC) Received: from ocex03.SolarFlarecom.com (10.20.40.36) by ocex03.SolarFlarecom.com (10.20.40.36) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Mon, 10 Sep 2018 02:33:47 -0700 Received: from opal.uk.solarflarecom.com (10.17.10.1) by ocex03.SolarFlarecom.com (10.20.40.36) with Microsoft SMTP Server (TLS) id 15.0.1395.4 via Frontend Transport; Mon, 10 Sep 2018 02:33:47 -0700 Received: from ukv-loginhost.uk.solarflarecom.com (ukv-loginhost.uk.solarflarecom.com [10.17.10.39]) by opal.uk.solarflarecom.com (8.13.8/8.13.8) with ESMTP id w8A9Xj9C023790; Mon, 10 Sep 2018 10:33:45 +0100 Received: from ukv-loginhost.uk.solarflarecom.com (localhost [127.0.0.1]) by ukv-loginhost.uk.solarflarecom.com (Postfix) with ESMTP id 6F05F1626D2; Mon, 10 Sep 2018 10:33:45 +0100 (BST) From: Andrew Rybchenko To: CC: Martin Harvey , Andrew Lee Date: Mon, 10 Sep 2018 10:33:10 +0100 Message-ID: <1536572016-18134-12-git-send-email-arybchenko@solarflare.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1536572016-18134-1-git-send-email-arybchenko@solarflare.com> References: <1536572016-18134-1-git-send-email-arybchenko@solarflare.com> MIME-Version: 1.0 Content-Type: text/plain X-TM-AS-Product-Ver: SMEX-12.5.0.1300-8.5.1010-24084.005 X-TM-AS-Result: No-4.904600-4.000000-10 X-TMASE-MatchedRID: pw66t0jdljUkFVbXj/dAre7KTDtx8CggVBDQSDMig9Hfc2Xd6VJ+ygaT alM8C773OxoI4BJbLh7KpWtpDsSS4FdI3z1FMme3wM5GqAoqJiqzy3IeH3LNTndWmDvFPih8FSd bd7Inc5nYHOC/v3JS19Dq8P9PcwDe9NDkghlX3z740JAO63QrhQkN8Uvsy+ntv8D7QPW2jo8HYI aKxjkuVkHNY7W6Yix9gDLqnrRlXrZ8nn9tnqel2K6NVEWSRWyb9n3GJSasXOZESC1D+mZ6DoV0e uhab4u3BOprvqx/XZ9WHRI7DsMhAF6b7oAnBUAT4TaJa/uOlxlOVQeu/eQ+YOAZa4GNsAsF8Oyc cFNBL2TKhETi2//sjuP9Cb59K8ACZrS+A8PszW+YV38c4KFOjw== X-TM-AS-User-Approved-Sender: No X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10--4.904600-4.000000 X-TMASE-Version: SMEX-12.5.0.1300-8.5.1010-24084.005 X-MDID: 1536572031-6QiqPhfj5nGU Subject: [dpdk-dev] [PATCH 11/37] net/sfc/base: move empty efsys definitions to EFX headers X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Sep 2018 09:33:51 -0000 From: Martin Harvey Move empty definitions for platform-specific annotations from efsys.h to EFX headers. Signed-off-by: Martin Harvey Signed-off-by: Andrew Lee Signed-off-by: Andrew Rybchenko --- drivers/net/sfc/base/efx.h | 1 + drivers/net/sfc/base/efx_annote.h | 101 ++++++++++++++++++++++++++++++ drivers/net/sfc/efsys.h | 38 ----------- 3 files changed, 102 insertions(+), 38 deletions(-) create mode 100644 drivers/net/sfc/base/efx_annote.h diff --git a/drivers/net/sfc/base/efx.h b/drivers/net/sfc/base/efx.h index baeffd934..4c8983387 100644 --- a/drivers/net/sfc/base/efx.h +++ b/drivers/net/sfc/base/efx.h @@ -7,6 +7,7 @@ #ifndef _SYS_EFX_H #define _SYS_EFX_H +#include "efx_annote.h" #include "efsys.h" #include "efx_check.h" #include "efx_phy_ids.h" diff --git a/drivers/net/sfc/base/efx_annote.h b/drivers/net/sfc/base/efx_annote.h new file mode 100644 index 000000000..603260e22 --- /dev/null +++ b/drivers/net/sfc/base/efx_annote.h @@ -0,0 +1,101 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * + * Copyright (c) 2018 Solarflare Communications Inc. + * All rights reserved. + */ + +#ifndef _SYS_EFX_ANNOTE_H +#define _SYS_EFX_ANNOTE_H + +#if defined(_WIN32) || defined(_WIN64) +#define EFX_HAVE_WINDOWS_ANNOTATIONS 1 +#else +#define EFX_HAVE_WINDOWS_ANNOTATIONS 0 +#endif /* defined(_WIN32) || defined(_WIN64) */ + +#if defined(__sun) +#define EFX_HAVE_SOLARIS_ANNOTATIONS 1 +#else +#define EFX_HAVE_SOLARIS_ANNOTATIONS 0 +#endif /* defined(__sun) */ + +#if !EFX_HAVE_WINDOWS_ANNOTATIONS + +/* Ignore Windows SAL annotations on other platforms */ +#define __in +#define __in_opt +#define __in_ecount(_n) +#define __in_ecount_opt(_n) +#define __in_bcount(_n) +#define __in_bcount_opt(_n) + +#define __out +#define __out_opt +#define __out_ecount(_n) +#define __out_ecount_opt(_n) +#define __out_bcount(_n) +#define __out_bcount_opt(_n) +#define __out_bcount_part(_n, _l) +#define __out_bcount_part_opt(_n, _l) + +#define __deref_out + +#define __inout +#define __inout_opt +#define __inout_ecount(_n) +#define __inout_ecount_opt(_n) +#define __inout_bcount(_n) +#define __inout_bcount_opt(_n) +#define __inout_bcount_full_opt(_n) + +#define __deref_out_bcount_opt(n) + +#define __checkReturn +#define __success(_x) + +#define __drv_when(_p, _c) + +#endif /* !EFX_HAVE_WINDOWS_ANNOTATIONS */ + +#if !EFX_HAVE_SOLARIS_ANNOTATIONS + +#if EFX_HAVE_WINDOWS_ANNOTATIONS + +/* + * Support some SunOS/Solaris style _NOTE() annotations + * + * At present with the facilities provided in the WDL and the SAL we can only + * easily act upon _NOTE(ARGUNUSED(arglist)) annotations. + * + * Intermediate macros to expand individual _NOTE annotation types into + * something the WDK or SAL can understand. They shouldn't be used directly, + * for example EFX_NOTE_ARGUNUSED() is only used as an intermediate step on the + * transformation of _NOTE(ARGUNSED(arg1, arg2)) into + * UNREFERENCED_PARAMETER((arg1, arg2)); + */ +#define EFX_NOTE_ALIGNMENT(_fname, _n) +#define EFX_NOTE_ARGUNUSED(...) UNREFERENCED_PARAMETER((__VA_ARGS__)); +#define EFX_NOTE_CONSTANTCONDITION +#define EFX_NOTE_CONSTCOND +#define EFX_NOTE_EMPTY +#define EFX_NOTE_FALLTHROUGH +#define EFX_NOTE_FALLTHRU +#define EFX_NOTE_LINTED(_msg) +#define EFX_NOTE_NOTREACHED +#define EFX_NOTE_PRINTFLIKE(_n) +#define EFX_NOTE_SCANFLIKE(_n) +#define EFX_NOTE_VARARGS(_n) + +#define _NOTE(_annotation) EFX_NOTE_ ## _annotation + +#else + +/* Ignore Solaris annotations on other platforms */ + +#define _NOTE(_annotation) + +#endif /* EFX_HAVE_WINDOWS_ANNOTATIONS */ + +#endif /* !EFX_HAVE_SOLARIS_ANNOTATIONS */ + +#endif /* _SYS_EFX_ANNOTE_H */ diff --git a/drivers/net/sfc/efsys.h b/drivers/net/sfc/efsys.h index b9d2df581..0b4795da1 100644 --- a/drivers/net/sfc/efsys.h +++ b/drivers/net/sfc/efsys.h @@ -48,10 +48,6 @@ extern "C" { #include "efx_types.h" -#ifndef _NOTE -#define _NOTE(s) -#endif - typedef bool boolean_t; #ifndef B_FALSE @@ -106,40 +102,6 @@ prefetch_read_once(const volatile void *addr) rte_prefetch_non_temporal(addr); } -/* Modifiers used for Windows builds */ -#define __in -#define __in_opt -#define __in_ecount(_n) -#define __in_ecount_opt(_n) -#define __in_bcount(_n) -#define __in_bcount_opt(_n) - -#define __out -#define __out_opt -#define __out_ecount(_n) -#define __out_ecount_opt(_n) -#define __out_bcount(_n) -#define __out_bcount_opt(_n) -#define __out_bcount_part(_n, _l) -#define __out_bcount_part_opt(_n, _l) - -#define __deref_out - -#define __inout -#define __inout_opt -#define __inout_ecount(_n) -#define __inout_ecount_opt(_n) -#define __inout_bcount(_n) -#define __inout_bcount_opt(_n) -#define __inout_bcount_full_opt(_n) - -#define __deref_out_bcount_opt(n) - -#define __checkReturn -#define __success(_x) - -#define __drv_when(_p, _c) - /* Code inclusion options */ -- 2.17.1