From patchwork Thu May 22 14:11:12 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anders Roxell X-Patchwork-Id: 30629 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qg0-f71.google.com (mail-qg0-f71.google.com [209.85.192.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 2590E20671 for ; Thu, 22 May 2014 14:11:37 +0000 (UTC) Received: by mail-qg0-f71.google.com with SMTP id a108sf7631322qge.10 for ; Thu, 22 May 2014 07:11:36 -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=wmRrRpZz0gJfFjusyaHON66xPdtyKRllDG46O7qmehQ=; b=Y6H5roSPemgR7F0A478DxI5fOOaIiQoqzN7Rg7BeXR6vFdFulXrOWYmxnXerJ7zLIM PnqqNuvWFJEhyet7zvYWoVM4u+FPpEHjI/k+PBV6ryx3vIfySXT9kEmXlBzYXjE/lnpA zug5T7Td79U/VTpJKava2AF2ejHSv3Ncyb29Xhl76035IenSJgUtjZSa5B20gEpP20WH /dC5hkvMJu+1SUu04CSdrtnKojNR82tZkbzwjtqVCSQRw+9NGKV/CtPjWACiiR7+mmSc RXzCOz+AAPHwfnSVuxs+n/mB2gLU+CXJgKzxmMCKz3+xko+aJv1+zW6mGTONXwEAMYgF wq3g== X-Gm-Message-State: ALoCoQktUM5Jl9oMeHS/Ax5bjiAeBXmGiqyZazDTX6JUvZEKNmOMwq9Z3D8kJf4vPhatDGR7Vg1F X-Received: by 10.236.140.42 with SMTP id d30mr24831728yhj.2.1400767896954; Thu, 22 May 2014 07:11:36 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.97.99 with SMTP id l90ls1363542qge.13.gmail; Thu, 22 May 2014 07:11:36 -0700 (PDT) X-Received: by 10.220.68.83 with SMTP id u19mr661470vci.52.1400767896761; Thu, 22 May 2014 07:11:36 -0700 (PDT) Received: from mail-vc0-f174.google.com (mail-vc0-f174.google.com [209.85.220.174]) by mx.google.com with ESMTPS id qi12si3208718vdb.82.2014.05.22.07.11.36 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 22 May 2014 07:11:36 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.174 as permitted sender) client-ip=209.85.220.174; Received: by mail-vc0-f174.google.com with SMTP id if11so1124088vcb.33 for ; Thu, 22 May 2014 07:11:36 -0700 (PDT) X-Received: by 10.220.53.72 with SMTP id l8mr16193532vcg.16.1400767896677; Thu, 22 May 2014 07:11:36 -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.220.221.72 with SMTP id ib8csp202342vcb; Thu, 22 May 2014 07:11:36 -0700 (PDT) X-Received: by 10.58.245.2 with SMTP id xk2mr32575482vec.9.1400767896088; Thu, 22 May 2014 07:11:36 -0700 (PDT) Received: from ip-10-141-164-156.ec2.internal (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTPS id k8si9521130qca.24.2014.05.22.07.11.35 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 22 May 2014 07:11:36 -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-141-164-156.ec2.internal) by ip-10-141-164-156.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1WnThX-000216-C1; Thu, 22 May 2014 14:10:31 +0000 Received: from mail-lb0-f174.google.com ([209.85.217.174]) by ip-10-141-164-156.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1WnThR-000211-22 for lng-odp@lists.linaro.org; Thu, 22 May 2014 14:10:25 +0000 Received: by mail-lb0-f174.google.com with SMTP id n15so2658066lbi.19 for ; Thu, 22 May 2014 07:11:22 -0700 (PDT) X-Received: by 10.152.21.169 with SMTP id w9mr240988lae.90.1400767882612; Thu, 22 May 2014 07:11:22 -0700 (PDT) Received: from localhost (c-853670d5.07-21-73746f28.cust.bredbandsbolaget.se. [213.112.54.133]) by mx.google.com with ESMTPSA id bq6sm5003254lbb.34.2014.05.22.07.11.21 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 22 May 2014 07:11:21 -0700 (PDT) From: Anders Roxell To: lng-odp@lists.linaro.org Date: Thu, 22 May 2014 16:11:12 +0200 Message-Id: <1400767872-11823-1-git-send-email-anders.roxell@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1398685276-4610-1-git-send-email-taras.kondratiuk@linaro.org> References: <1398685276-4610-1-git-send-email-taras.kondratiuk@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCH] move typedefs to odp_types.h and plat/odp_types.h 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: anders.roxell@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.220.174 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 A start to move all typedefs to one file odp_types.h and move the platform specific stuff into plat/odp_types.h This will remove the cross referencing fom platform back to include. Only from top include to platform. Signed-off-by: Anders Roxell --- This patch should be applied ontop of Taras patchset ([LNG] [RFC PATCH 00/17] Split out platform-specific values from header files) http://lists.linaro.org/pipermail/lng-odp/2014-April/000539.html The drawback for this are that we are putting all the typdefs into one file. include/odp_atomic.h | 17 +-------- include/odp_types.h | 44 ++++++++++++++++++++++++ platform/linux-generic/include/plat/odp_atomic.h | 21 +---------- platform/linux-generic/include/plat/odp_types.h | 40 +++++++++++++++++++++ 4 files changed, 86 insertions(+), 36 deletions(-) create mode 100644 include/odp_types.h create mode 100644 platform/linux-generic/include/plat/odp_types.h diff --git a/include/odp_atomic.h b/include/odp_atomic.h index 439e804..b381b04 100644 --- a/include/odp_atomic.h +++ b/include/odp_atomic.h @@ -19,24 +19,9 @@ extern "C" { #endif -#include +#include #include -/** - * Atomic integer - */ -typedef plat_odp_atomic_int_t odp_atomic_int_t; - -/** - * Atomic unsigned integer 64 bits - */ -typedef plat_odp_atomic_u64_t odp_atomic_u64_t; - -/** - * Atomic unsigned integer 32 bits - */ -typedef plat_odp_atomic_u32_t odp_atomic_u32_t; - /** * Initialize atomic integer diff --git a/include/odp_types.h b/include/odp_types.h new file mode 100644 index 0000000..11ae229 --- /dev/null +++ b/include/odp_types.h @@ -0,0 +1,44 @@ +/* Copyright (c) 2014, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + + +/** + * @file + * + * ODP types + */ + +#ifndef ODP_TYPES_H_ +#define ODP_TYPES_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include + +/** + * Atomic integer + */ +typedef plat_odp_atomic_int_t odp_atomic_int_t; + + +/** + * Atomic unsigned integer 64 bits + */ +typedef plat_odp_atomic_u64_t odp_atomic_u64_t; + +/** + * Atomic unsigned integer 32 bits + */ +typedef plat_odp_atomic_u32_t odp_atomic_u32_t; + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/platform/linux-generic/include/plat/odp_atomic.h b/platform/linux-generic/include/plat/odp_atomic.h index 52a672a..ce39dae 100644 --- a/platform/linux-generic/include/plat/odp_atomic.h +++ b/platform/linux-generic/include/plat/odp_atomic.h @@ -15,26 +15,7 @@ #error This file should be included only into corresponding top level header #else -/** - * Atomic integer - */ -typedef volatile int32_t plat_odp_atomic_int_t; - -/** - * Atomic unsigned integer 64 bits - */ -typedef volatile uint64_t plat_odp_atomic_u64_t; - -/** - * Atomic unsigned integer 32 bits - */ -typedef volatile uint32_t plat_odp_atomic_u32_t; - -/* Define OPD types here to use them in inline functions below */ -typedef plat_odp_atomic_int_t odp_atomic_int_t; -typedef plat_odp_atomic_u64_t odp_atomic_u64_t; -typedef plat_odp_atomic_u32_t odp_atomic_u32_t; - +#include static inline void odp_atomic_init_int(odp_atomic_int_t *ptr) { diff --git a/platform/linux-generic/include/plat/odp_types.h b/platform/linux-generic/include/plat/odp_types.h new file mode 100644 index 0000000..29924ae --- /dev/null +++ b/platform/linux-generic/include/plat/odp_types.h @@ -0,0 +1,40 @@ +/* Copyright (c) 2014, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + + +/** + * @file + * + * ODP platform types + */ + +#ifndef ODP_PLAT_TYPES_H_ +#define ODP_PLAT_TYPES_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * Atomic integer + */ +typedef volatile int plat_odp_atomic_int_t; + +/** + * Atomic unsigned integer 64 bits + */ +typedef volatile uint64_t plat_odp_atomic_u64_t; + +/** + * Atomic unsigned integer 32 bits + */ +typedef volatile uint32_t plat_odp_atomic_u32_t; + +#ifdef __cplusplus +} +#endif + +#endif