From patchwork Fri Nov 21 08:53:41 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Balasubramanian Manoharan X-Patchwork-Id: 41287 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f197.google.com (mail-wi0-f197.google.com [209.85.212.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 31708244B0 for ; Fri, 21 Nov 2014 08:54:24 +0000 (UTC) Received: by mail-wi0-f197.google.com with SMTP id l15sf3008284wiw.8 for ; Fri, 21 Nov 2014 00:54:23 -0800 (PST) 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:content-type :content-transfer-encoding:errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=/LRixeNezvPIBhkAT8O6PRae0K3rpeASDNMSw3JuHsY=; b=NGf1CIQpvvGDY995yCpzCsVDV9i6on+CD2po9WdPLgjL7Hlo6hJ6+XtMtKcrukYaJ9 NNLm7CDpKztiGmT16yZd/LIJ672Zum7fyeTi7Ty6Nrz4MzKZXesBKr5LOU1AGZuzfbvP HDWoW2P8WX6xvy2pZ01DrQtpPt8rgmiNEg8wVbRSxq7Y/7B3xIXds0Xr97gQbgreZnj4 TeyInese42vN0kNHwozoDRTM8xAynzm/7fC8GGKmx2iv1pL+V5RoaehqbRJ/N8ZsL6PW kCuQ4Sh7czAVZzucMkWu2/3FnMEf540BK9HPB4EO73n1ekPpxO/9/aR0nLfVMHACApXO s3sg== X-Gm-Message-State: ALoCoQlXgX7Pdg8Xh1Kz1LjBeBxqUsgmlHqKF/6u5ujzwT+QuADRqPdAuJJMzra7oIzxpscmC/DC X-Received: by 10.180.106.67 with SMTP id gs3mr10862666wib.3.1416560063456; Fri, 21 Nov 2014 00:54:23 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.44.166 with SMTP id f6ls160068lam.8.gmail; Fri, 21 Nov 2014 00:54:23 -0800 (PST) X-Received: by 10.112.219.3 with SMTP id pk3mr2956216lbc.18.1416560063203; Fri, 21 Nov 2014 00:54:23 -0800 (PST) Received: from mail-la0-f50.google.com (mail-la0-f50.google.com. [209.85.215.50]) by mx.google.com with ESMTPS id qi2si4414256lbb.47.2014.11.21.00.54.23 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 21 Nov 2014 00:54:23 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.50 as permitted sender) client-ip=209.85.215.50; Received: by mail-la0-f50.google.com with SMTP id pv20so3897610lab.9 for ; Fri, 21 Nov 2014 00:54:23 -0800 (PST) X-Received: by 10.152.42.226 with SMTP id r2mr2853160lal.29.1416560063043; Fri, 21 Nov 2014 00:54:23 -0800 (PST) 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.184.201 with SMTP id ew9csp47006lbc; Fri, 21 Nov 2014 00:54:22 -0800 (PST) X-Received: by 10.140.39.201 with SMTP id v67mr4607946qgv.45.1416560061817; Fri, 21 Nov 2014 00:54:21 -0800 (PST) Received: from ip-10-35-177-41.ec2.internal (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTPS id hd10si5996905qcb.38.2014.11.21.00.54.21 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 21 Nov 2014 00:54:21 -0800 (PST) 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 1Xrjyt-0002Ha-L5; Fri, 21 Nov 2014 08:54:19 +0000 Received: from mail-yh0-f49.google.com ([209.85.213.49]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1Xrjyk-0002Gz-HB for lng-odp@lists.linaro.org; Fri, 21 Nov 2014 08:54:10 +0000 Received: by mail-yh0-f49.google.com with SMTP id f10so2146939yha.22 for ; Fri, 21 Nov 2014 00:54:05 -0800 (PST) X-Received: by 10.236.38.234 with SMTP id a70mr1348322yhb.63.1416560045349; Fri, 21 Nov 2014 00:54:05 -0800 (PST) Received: from bala-PowerEdge-T110-II.caveonetworks.com ([111.93.218.67]) by mx.google.com with ESMTPSA id y67sm2345495yhc.11.2014.11.21.00.54.03 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 21 Nov 2014 00:54:05 -0800 (PST) From: Balasubramanian Manoharan To: lng-odp@lists.linaro.org Date: Fri, 21 Nov 2014 14:23:41 +0530 Message-Id: <1416560024-20661-2-git-send-email-bala.manoharan@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1416560024-20661-1-git-send-email-bala.manoharan@linaro.org> References: <1416560024-20661-1-git-send-email-bala.manoharan@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCH v1 2/5] Linux-generic:Buffer: Move static inlines functions to header 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: bala.manoharan@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.50 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 This patch moves the static inline functions and typedefs in buffer implementation to internal header file. This is needed for accessing inline functions from other modules. Signed-off-by: Balasubramanian Manoharan --- platform/linux-generic/include/odp_buffer_pool_internal.h | 10 ++++++++++ platform/linux-generic/odp_buffer_pool.c | 10 ---------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/platform/linux-generic/include/odp_buffer_pool_internal.h b/platform/linux-generic/include/odp_buffer_pool_internal.h index e0210bd..bdbefff 100644 --- a/platform/linux-generic/include/odp_buffer_pool_internal.h +++ b/platform/linux-generic/include/odp_buffer_pool_internal.h @@ -64,6 +64,12 @@ struct pool_entry_s { size_t hdr_size; }; +typedef union pool_entry_u { + struct pool_entry_s s; + + uint8_t pad[ODP_CACHE_LINE_SIZE_ROUNDUP(sizeof(struct pool_entry_s))]; + +} pool_entry_t; extern void *pool_entry_ptr[]; @@ -73,6 +79,10 @@ static inline void *get_pool_entry(uint32_t pool_id) return pool_entry_ptr[pool_id]; } +static inline uint32_t pool_handle_to_index(odp_buffer_pool_t pool_hdl) +{ + return pool_hdl - 1; +} static inline odp_buffer_hdr_t *odp_buf_to_hdr(odp_buffer_t buf) { diff --git a/platform/linux-generic/odp_buffer_pool.c b/platform/linux-generic/odp_buffer_pool.c index a48d7d6..57393dd 100644 --- a/platform/linux-generic/odp_buffer_pool.c +++ b/platform/linux-generic/odp_buffer_pool.c @@ -56,12 +56,6 @@ typedef struct { } odp_any_buffer_hdr_t; -typedef union pool_entry_u { - struct pool_entry_s s; - - uint8_t pad[ODP_CACHE_LINE_SIZE_ROUNDUP(sizeof(struct pool_entry_s))]; - -} pool_entry_t; typedef struct pool_table_t { @@ -86,10 +80,6 @@ static inline odp_buffer_pool_t pool_index_to_handle(uint32_t pool_id) } -static inline uint32_t pool_handle_to_index(odp_buffer_pool_t pool_hdl) -{ - return pool_hdl -1; -} static inline void set_handle(odp_buffer_hdr_t *hdr,