From patchwork Thu Nov 6 21:27:47 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Holmes X-Patchwork-Id: 40370 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f71.google.com (mail-la0-f71.google.com [209.85.215.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 13AA124687 for ; Thu, 6 Nov 2014 21:28:13 +0000 (UTC) Received: by mail-la0-f71.google.com with SMTP id gq15sf2276427lab.10 for ; Thu, 06 Nov 2014 13:28:11 -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=AnxCG5+4boRsjfddyBhLaYNzBGL0qlGzlCubfeZBoxI=; b=OlzIvuirXfLgwiBnfoz4DW+UDBqP/oLNoI9n87ziB5wOzbwWGdaz1DVPGr5Pczryrb 0s9Dtzo36evL42vFEdsZGAzMhRBVdt1tySGcGJwVhCl4S/nDZC69BEzV+O8OOYvq7e6V ZDyxKPWtEmXBKE7SMnZV/54msei4Ma8pT5LFSKSJrx9200CJT+ueDe8iwwu4HWkRP3wt ND2wAQ+sfxKw6MU/mNK4mcnCjwWgaKDEXnhbowBmDEaEA+NlNeCXhJjjofekAM4Exs4E E7j21cav6xRD7iOOiVB+q2vu+M2Kc+hvI5KJ1CzhWo6sPcVkq14Fu1eZUBuCGbgdR3Xl 2Rrw== X-Gm-Message-State: ALoCoQnNXQLQbejVkrZbn9ZciurOB1yjBJF28FgBVxVm4TMah4npz3CfGuk8ZDn55qacgICMy92d X-Received: by 10.181.8.194 with SMTP id dm2mr6951732wid.2.1415309291940; Thu, 06 Nov 2014 13:28:11 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.19.227 with SMTP id i3ls118040lae.28.gmail; Thu, 06 Nov 2014 13:28:11 -0800 (PST) X-Received: by 10.152.116.80 with SMTP id ju16mr1725434lab.13.1415309291262; Thu, 06 Nov 2014 13:28:11 -0800 (PST) Received: from mail-lb0-f181.google.com (mail-lb0-f181.google.com. [209.85.217.181]) by mx.google.com with ESMTPS id rf8si12683802lbb.139.2014.11.06.13.28.11 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 06 Nov 2014 13:28:11 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.181 as permitted sender) client-ip=209.85.217.181; Received: by mail-lb0-f181.google.com with SMTP id l4so1645018lbv.26 for ; Thu, 06 Nov 2014 13:28:11 -0800 (PST) X-Received: by 10.112.12.35 with SMTP id v3mr7404986lbb.80.1415309291099; Thu, 06 Nov 2014 13:28:11 -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 ew9csp109958lbc; Thu, 6 Nov 2014 13:28:10 -0800 (PST) X-Received: by 10.224.129.9 with SMTP id m9mr11281753qas.50.1415309289652; Thu, 06 Nov 2014 13:28:09 -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 j2si13948626qce.4.2014.11.06.13.28.08 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 06 Nov 2014 13:28:09 -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 1XmUbA-0003pk-5M; Thu, 06 Nov 2014 21:28:08 +0000 Received: from mail-qg0-f48.google.com ([209.85.192.48]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1XmUb4-0003oX-8J for lng-odp@lists.linaro.org; Thu, 06 Nov 2014 21:28:02 +0000 Received: by mail-qg0-f48.google.com with SMTP id q108so1453494qgd.7 for ; Thu, 06 Nov 2014 13:27:57 -0800 (PST) X-Received: by 10.224.127.133 with SMTP id g5mr11339237qas.24.1415309277032; Thu, 06 Nov 2014 13:27:57 -0800 (PST) Received: from fedora1.holmesfamily.ws ([98.221.136.245]) by mx.google.com with ESMTPSA id a10sm2027751qag.8.2014.11.06.13.27.56 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 06 Nov 2014 13:27:56 -0800 (PST) From: Mike Holmes To: lng-odp@lists.linaro.org Date: Thu, 6 Nov 2014 16:27:47 -0500 Message-Id: <1415309267-50564-1-git-send-email-mike.holmes@linaro.org> X-Mailer: git-send-email 2.1.0 X-Topics: patch Subject: [lng-odp] [PATCH v2] 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.217.181 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..4e0f05e 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 shm ODP_UNUSED) +{ + ODP_UNIMPLEMENTED(); + return 0; +} odp_shm_t odp_shm_lookup(const char *name) {