From patchwork Wed Feb 17 09:32:25 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Milard X-Patchwork-Id: 62094 Delivered-To: patch@linaro.org Received: by 10.112.43.199 with SMTP id y7csp2148189lbl; Wed, 17 Feb 2016 00:33:45 -0800 (PST) X-Received: by 10.50.30.2 with SMTP id o2mr16761687igh.13.1455698025382; Wed, 17 Feb 2016 00:33:45 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id ru5si41222794igb.7.2016.02.17.00.33.45; Wed, 17 Feb 2016 00:33:45 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dkim=neutral (body hash did not verify) header.i=@linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id B98C76679B; Wed, 17 Feb 2016 08:33:44 +0000 (UTC) Authentication-Results: lists.linaro.org; dkim=fail reason="verification failed; unprotected key" header.d=linaro.org header.i=@linaro.org header.b=XoKEe+0J; dkim-adsp=none (unprotected policy); dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, T_DKIM_INVALID, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id BBC7C617B4; Wed, 17 Feb 2016 08:33:39 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id C3BAF618E0; Wed, 17 Feb 2016 08:33:37 +0000 (UTC) Received: from mail-lf0-f48.google.com (mail-lf0-f48.google.com [209.85.215.48]) by lists.linaro.org (Postfix) with ESMTPS id CC4BC61796 for ; Wed, 17 Feb 2016 08:33:36 +0000 (UTC) Received: by mail-lf0-f48.google.com with SMTP id l143so5862523lfe.2 for ; Wed, 17 Feb 2016 00:33:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=YPjmQU+otaQ7TA7g+IfVypymkqgG7lCz7SazOG1oW0Y=; b=XoKEe+0JZ/Qi4Hv8w55lupNwhSaBMcAZKn7OixhZJNKcj9eK8tMuADfSfSm3KfXxa1 BYyB+anowNedld40B3XGCA++vDv4GNiKhGhGBqNIuzPcUeGhUNWHA2I6mNQN0TEFEtIE Y4T0UY7oUmNlhAndYnG/h1Qe3/zYImov1j/x8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=YPjmQU+otaQ7TA7g+IfVypymkqgG7lCz7SazOG1oW0Y=; b=h4YDnNXwqJN4CcuHAJBdN2ArRQuRg8vGpIMnZK4SC+QQ46ZXpMpRZRHI2MOypdQQib k+Y6IrzQVEHwkjkBUI8Pc1/Fz0r0g+OpVnwFcOH3EjoraqEzbTukRwsoERt5aCdUfCg7 //w5i3mzUyoezDvW2ergxl6Y7O8SfXL/nmNUUBcAIJTA7LMToz29uqXMu8yBszbXkWy9 nlOkhAvlcs6e1PzPW8prINu1tyYlrCNVVhTjSzHGzqL7p1jsCvIfnhbq7JH99YqTJzkn sOKnQ3DNX17/YPk2XR4A5ALgF9OUmyNEpEis5u9oPjf+jvQ6pCGmivUDDmwKVyms88Sx mW4A== X-Gm-Message-State: AG10YOQ4DpASFSsY68rIHBFIQeXI4USNpy/vOsJCHylP+hw8txM3fToM5WtJfyGmEcKw1h4A+Eg= X-Received: by 10.25.153.12 with SMTP id b12mr131659lfe.117.1455698015803; Wed, 17 Feb 2016 00:33:35 -0800 (PST) Received: from erachmi-ericsson.ki.sw.ericsson.se (c-83-233-90-46.cust.bredband2.com. [83.233.90.46]) by smtp.gmail.com with ESMTPSA id a14sm47275lfe.7.2016.02.17.00.33.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 17 Feb 2016 00:33:35 -0800 (PST) From: Christophe Milard To: anders.roxell@linaro.org, mike.holmes@linaro.org, bill.fischofer@linaro.org, petri.savolainen@linaro.org Date: Wed, 17 Feb 2016 10:32:25 +0100 Message-Id: <1455701546-48997-1-git-send-email-christophe.milard@linaro.org> X-Mailer: git-send-email 2.1.4 X-Topics: patch Cc: lng-odp@lists.linaro.org Subject: [lng-odp] [API-NEXT PATCHv2 1/2] drv: adding compiler.h X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" 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" The file is, of course, largely inspired from its equivalent on the application interface. Signed-off-by: Christophe Milard --- include/odp/drv/spec/compiler.h | 51 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 include/odp/drv/spec/compiler.h diff --git a/include/odp/drv/spec/compiler.h b/include/odp/drv/spec/compiler.h new file mode 100644 index 0000000..3198d21 --- /dev/null +++ b/include/odp/drv/spec/compiler.h @@ -0,0 +1,51 @@ +/* Copyright (c) 2016, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +/** + * @file + * + * Compiler related for ODP driver interface + */ + +#ifndef ODPDRV_COMPILER_H_ +#define ODPDRV_COMPILER_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +/** @addtogroup odpdrv_compiler_optim ODPDRV COMPILER / OPTIMIZATION + * Macro for old compilers + * @{ + */ + +/** @internal GNU compiler version */ +#define GCC_VERSION (__GNUC__ * 10000 \ + + __GNUC_MINOR__ * 100 \ + + __GNUC_PATCHLEVEL__) + +/** + * @internal + * Compiler __builtin_bswap16() is not available on all platforms + * until GCC 4.8.0 - work around this by offering __odpdrv_builtin_bswap16() + * Don't use this function directly, instead see odpdrv byteorder.h + */ +#if GCC_VERSION < 40800 +#define __odpdrv_builtin_bswap16(u16) \ + ((((u16)&0x00ff) << 8) | (((u16)&0xff00) >> 8)) +#else +#define __odpdrv_builtin_bswap16(u16) __builtin_bswap16(u16) +#endif + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif