From patchwork Thu Nov 6 20:12:01 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Holmes X-Patchwork-Id: 40369 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f199.google.com (mail-wi0-f199.google.com [209.85.212.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 72C7824687 for ; Thu, 6 Nov 2014 20:12:28 +0000 (UTC) Received: by mail-wi0-f199.google.com with SMTP id r20sf1118303wiv.10 for ; Thu, 06 Nov 2014 12:12:27 -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: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=jGSaJmQwnjhFABcy7OBn1O7iZ5X1Sg8bsMk7l3k1ZSM=; b=hnWhQ96XRY+z5Xu/2Up2i8LDobQeIGxI5HS/X41RdfYL8qd9zfWZCt8N7WpoPwRWne Zi3VxH7OFkwvEk8DaVSlXK1z5EUBJBSZUll/g86rXQX2HCj5/DXeH837CGYJHj8wu4ub YYFAV22v3fO2XzPE2Oz652fH7kNRbLYk22ayoBHgr7Z/MkMsmLZLMClSFJZEr1A8hPEg ZwcyDzTrSpKhGvwb4IGkhsV84bpwAIdlTy5mKMFGTknPBX+0qIhIHN7cjGJZjyXULP9k HkrsBBly+vLQL6Dnof5gmWU3CC0qN9zsN5bMPBxJuCnHfaBITabRrkbeK8yndHzSqfc2 vBMQ== X-Gm-Message-State: ALoCoQl8JNFJ45YmrGmEQym32HmRY6bv5upWcxYhOI2Pk0yni+M2Km4HFuH/Zrux+mFrrERgdvBQ X-Received: by 10.112.16.35 with SMTP id c3mr717161lbd.13.1415304747680; Thu, 06 Nov 2014 12:12:27 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.22.130 with SMTP id d2ls141896laf.32.gmail; Thu, 06 Nov 2014 12:12:27 -0800 (PST) X-Received: by 10.152.3.229 with SMTP id f5mr5964920laf.94.1415304747374; Thu, 06 Nov 2014 12:12:27 -0800 (PST) Received: from mail-la0-f48.google.com (mail-la0-f48.google.com. [209.85.215.48]) by mx.google.com with ESMTPS id l10si12756530lbd.29.2014.11.06.12.12.27 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 06 Nov 2014 12:12:27 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.48 as permitted sender) client-ip=209.85.215.48; Received: by mail-la0-f48.google.com with SMTP id gq15so3246220lab.21 for ; Thu, 06 Nov 2014 12:12:27 -0800 (PST) X-Received: by 10.112.202.104 with SMTP id kh8mr7223213lbc.46.1415304747273; Thu, 06 Nov 2014 12:12:27 -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 ew9csp101162lbc; Thu, 6 Nov 2014 12:12:26 -0800 (PST) X-Received: by 10.224.61.7 with SMTP id r7mr10530385qah.9.1415304745835; Thu, 06 Nov 2014 12:12:25 -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 z68si13581156qgd.46.2014.11.06.12.12.25 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 06 Nov 2014 12:12:25 -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 1XmTPr-0000PP-4O; Thu, 06 Nov 2014 20:12:23 +0000 Received: from mail-qa0-f43.google.com ([209.85.216.43]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1XmTPk-0000PF-R1 for lng-odp@lists.linaro.org; Thu, 06 Nov 2014 20:12:16 +0000 Received: by mail-qa0-f43.google.com with SMTP id j7so1329198qaq.30 for ; Thu, 06 Nov 2014 12:12:11 -0800 (PST) X-Received: by 10.224.65.133 with SMTP id j5mr10526311qai.96.1415304731635; Thu, 06 Nov 2014 12:12:11 -0800 (PST) Received: from fedora1.holmesfamily.ws ([98.221.136.245]) by mx.google.com with ESMTPSA id 45sm4285172qgg.37.2014.11.06.12.12.10 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 06 Nov 2014 12:12:11 -0800 (PST) From: Mike Holmes To: lng-odp@lists.linaro.org Date: Thu, 6 Nov 2014 15:12:01 -0500 Message-Id: <1415304721-48632-1-git-send-email-mike.holmes@linaro.org> X-Mailer: git-send-email 2.1.0 X-Topics: patch Subject: [lng-odp] [PATCH] api/odp_shared_memory.h: add odp_shm_free 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: mike.holmes@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.48 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 Signed-off-by: Mike Holmes --- platform/linux-generic/include/api/odp_shared_memory.h | 13 +++++++++++++ platform/linux-generic/odp_shared_memory.c | 6 ++++++ 2 files changed, 19 insertions(+) diff --git a/platform/linux-generic/include/api/odp_shared_memory.h b/platform/linux-generic/include/api/odp_shared_memory.h index d8d40dd..1a59824 100644 --- a/platform/linux-generic/include/api/odp_shared_memory.h +++ b/platform/linux-generic/include/api/odp_shared_memory.h @@ -72,6 +72,19 @@ odp_shm_t odp_shm_reserve(const char *name, uint64_t size, uint64_t align, uint32_t flags); /** + * Free a contiguous block of shared memory + * + * Frees a previously reserved block of shared memory. + * @note Freeing memory that is in use will result in UNDEFINED behaviour. + * + * @param[in] shm Block handle + * + * @retval 0 for success + * @retval 1 on failure + */ +int odp_shm_free(odp_shm_t shm); + +/** * Lookup for a block of shared memory * * @param name Name of the block diff --git a/platform/linux-generic/odp_shared_memory.c b/platform/linux-generic/odp_shared_memory.c index c770a80..479ea4d 100644 --- a/platform/linux-generic/odp_shared_memory.c +++ b/platform/linux-generic/odp_shared_memory.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include @@ -219,6 +220,11 @@ odp_shm_t odp_shm_reserve(const char *name, uint64_t size, uint64_t align, return block->hdl; } +int odp_shm_free(odp_shm_t shmi ODP_UNUSED) +{ + ODP_UNIMPLEMENTED(); + return 0; +} odp_shm_t odp_shm_lookup(const char *name) {