From patchwork Fri Jan 8 20:29:47 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Milard X-Patchwork-Id: 59389 Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp750652lbb; Fri, 8 Jan 2016 11:36:16 -0800 (PST) X-Received: by 10.55.76.84 with SMTP id z81mr56388087qka.17.1452281776075; Fri, 08 Jan 2016 11:36:16 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id u76si12675286qkl.113.2016.01.08.11.36.15; Fri, 08 Jan 2016 11:36:16 -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 A74BE6179C; Fri, 8 Jan 2016 19:36:15 +0000 (UTC) Authentication-Results: lists.linaro.org; dkim=fail reason="verification failed; unprotected key" header.d=linaro.org header.i=@linaro.org header.b=Fb2042rc; 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 CB09461C7D; Fri, 8 Jan 2016 19:31:55 +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 3577161B55; Fri, 8 Jan 2016 19:31:51 +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 4F30F616B9 for ; Fri, 8 Jan 2016 19:31:38 +0000 (UTC) Received: by mail-lf0-f48.google.com with SMTP id m198so33830379lfm.0 for ; Fri, 08 Jan 2016 11:31:38 -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:in-reply-to:references; bh=ea0q3JfZvg6JBKJevrFJcMCRSqt8FWvI6Upk+X9OTlQ=; b=Fb2042rcJpjjfhcFmVy9v1n0fxf5ucfFJ17iQm6W8pE+ypwH7icyzrMnRwruNjkZh5 C7/87KGg4Doli6G3sFv0nm+ItLM3FnHnkm60GY+kAKLyJy2JGdrdaE9EfZI6cKmMSgft VyRcsyDhIaPSXnQ1HNT3v4Eecc+XkxjMHTdvg= 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:in-reply-to :references; bh=ea0q3JfZvg6JBKJevrFJcMCRSqt8FWvI6Upk+X9OTlQ=; b=Z3u0YgDTmNtghIHmrPaSbS1sw8PKZFZul1f7ylqtd9ycselm/A/ZBbhUlBDFyGoBoU aUHpnEYV7HtGZQMS4iLkmSUzjz17vfVzeQlzoTpkbI97rED/gzoa4qEYWIIeVuA+Lr2Z t26yuagBLbdLtWKoTbKRGyuEmODqSwEIwxTFHGriO4P+2ETBnAZtJN1CJmTjSsTau3++ EtWgXyK9HH+EqEdBvwHQwFzhMsvwWSpjMAVx2mhonYvmig7GYevH+QlAxczbivSYFVTD umku3sPYhGluLFOyMXv4ywLpd3SP7Lq9+7Icx5aNWNYonjuebIileHUKlbAR5zXklR2m 0Csg== X-Gm-Message-State: ALoCoQnItqoW4vUVtVaxYuVsPcaUcHYO+MIW5vOG0z6nMPRtbpd8A3u2aIG12w2jZmgDkghlMqoEm3sA/jf5edK04fv7ENWNQA== X-Received: by 10.25.89.208 with SMTP id n199mr23158823lfb.160.1452281497294; Fri, 08 Jan 2016 11:31:37 -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 l204sm2085534lfg.49.2016.01.08.11.31.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 08 Jan 2016 11:31:36 -0800 (PST) From: Christophe Milard To: anders.roxell@linaro.org, mike.holmes@linaro.org, stuart.haslam@linaro.org, maxim.uvarov@linaro.org, bill.fischofer@linaro.org, petri.savolainen@linaro.org, edavis@broadcom.com Date: Fri, 8 Jan 2016 21:29:47 +0100 Message-Id: <1452285014-60320-5-git-send-email-christophe.milard@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1452285014-60320-1-git-send-email-christophe.milard@linaro.org> References: <1452285014-60320-1-git-send-email-christophe.milard@linaro.org> Cc: lng-odp@lists.linaro.org Subject: [lng-odp] [API-NEXT RFC 04/31] api: shared_memory: getting DMA descriptor 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" Adding a function to get a DMA descriptor (describing how to perform a DMA mapping on the given shared memory block). Also added a flag (ODP_SHM_DMA) to be given at block reservation time, when DMA reachable memory is required. Signed-off-by: Christophe Milard --- include/odp/api/shared_memory.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/include/odp/api/shared_memory.h b/include/odp/api/shared_memory.h index 5d851ce..01d6005 100644 --- a/include/odp/api/shared_memory.h +++ b/include/odp/api/shared_memory.h @@ -18,6 +18,7 @@ extern "C" { #endif +#include /** @defgroup odp_shared_memory ODP SHARED MEMORY * Operations on shared memory. @@ -49,6 +50,7 @@ extern "C" { /* Share level */ #define ODP_SHM_SW_ONLY 0x1 /**< Application SW only, no HW access */ #define ODP_SHM_PROC 0x2 /**< Share with external processes */ +#define ODP_SHM_DMA 0x4 /**< DMA reachable mem */ /** * Shared memory block info @@ -125,6 +127,18 @@ void *odp_shm_addr(odp_shm_t shm); */ int odp_shm_info(odp_shm_t shm, odp_shm_info_t *info); +/** + * Shared memory block DMA descriptor + * + * @param[in] shm Block handle + * The memory block must have been created with the + * ODP_SHM_DMA flag. + * + * @retval a single DMA descriptor describing the required DMA mapping for + * this memory area. + * Returns ODP_DMA_REGION_INVALID on error. + */ +odp_dma_map_t odp_shm_get_dma_map(odp_shm_t shm); /** * Print all shared memory blocks