From patchwork Tue Feb 24 16:00:45 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robbie King X-Patchwork-Id: 44949 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f70.google.com (mail-la0-f70.google.com [209.85.215.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 067DC2029F for ; Tue, 24 Feb 2015 16:02:09 +0000 (UTC) Received: by lamq1 with SMTP id q1sf17790670lam.0 for ; Tue, 24 Feb 2015 08:02:08 -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=MmOfg2/idLeE5krkuz3dmqV0qrxE4qIzMG98l6dTCUQ=; b=Ih8z58+WUwf7A7boVH0csHLitm6HLuOWcSfM3UeVmZzzJna6D+bdcBmvY5MO5BwZB2 xbOR2z9O0vbsOikSISHUwDg14eQbriFxbfdPNEr6ZC4Zr3HYBzvnFHSi6VP3/ocnok3O fwFwNqS4sbW9K9JwURyfEpNU7EALgU+j6z5m2eoLl4HzEaH5ZWrmvPhyb5pH8MfxxCfP pyPvbFOMOzsbIA7CaIzrtemliFwUphv1TS8rHk2QNQ8YaTu/rdQ6xYUaftmOo0U7yCOr f2neAprqCxlKQNfkgNXkInC1CrWUwX49ncCSEgwYBcBJNXzwjPgnodVS2HCC9ML40W/R 5bXw== X-Gm-Message-State: ALoCoQmNXkRmh8TCdMyenPIE3kxe7iOmgWkqJHiZnpEi7Gj/OvYzpJOr5Aj3FCWzxlqjz5OS9hUp X-Received: by 10.180.182.44 with SMTP id eb12mr2218046wic.4.1424793728039; Tue, 24 Feb 2015 08:02:08 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.191.168 with SMTP id gz8ls630735lac.16.gmail; Tue, 24 Feb 2015 08:02:07 -0800 (PST) X-Received: by 10.152.7.162 with SMTP id k2mr14517079laa.92.1424793727849; Tue, 24 Feb 2015 08:02:07 -0800 (PST) Received: from mail-lb0-x234.google.com (mail-lb0-x234.google.com. [2a00:1450:4010:c04::234]) by mx.google.com with ESMTPS id lt9si26524874lac.133.2015.02.24.08.02.07 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Feb 2015 08:02:07 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c04::234 as permitted sender) client-ip=2a00:1450:4010:c04::234; Received: by lbvn10 with SMTP id n10so25934972lbv.4 for ; Tue, 24 Feb 2015 08:02:07 -0800 (PST) X-Received: by 10.152.21.201 with SMTP id x9mr4231707lae.72.1424793727765; Tue, 24 Feb 2015 08:02:07 -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.35.133 with SMTP id h5csp2000867lbj; Tue, 24 Feb 2015 08:02:06 -0800 (PST) X-Received: by 10.202.214.206 with SMTP id n197mr11176077oig.2.1424793725370; Tue, 24 Feb 2015 08:02:05 -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 i9si14610516qaz.69.2015.02.24.08.02.04 (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 24 Feb 2015 08:02:05 -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 1YQHvu-0006gG-G3; Tue, 24 Feb 2015 16:02:02 +0000 Received: from rcdn-iport-2.cisco.com ([173.37.86.73]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YQHvW-0006au-Qn for lng-odp@lists.linaro.org; Tue, 24 Feb 2015 16:01:38 +0000 X-IronPort-AV: E=Sophos;i="5.09,639,1418083200"; d="scan'208";a="399056178" Received: from alln-core-2.cisco.com ([173.36.13.135]) by rcdn-iport-2.cisco.com with ESMTP; 24 Feb 2015 16:01:33 +0000 Received: from cpp-rtpbld-55.cisco.com (cpp-rtpbld-55.cisco.com [172.18.5.199]) by alln-core-2.cisco.com (8.14.5/8.14.5) with ESMTP id t1OG1WEH001977 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 24 Feb 2015 16:01:33 GMT Received: from cpp-rtpbld-55.cisco.com (localhost.localdomain [127.0.0.1]) by cpp-rtpbld-55.cisco.com (8.13.8/8.13.8) with ESMTP id t1OG1Wbd028889; Tue, 24 Feb 2015 11:01:32 -0500 Received: (from robking@localhost) by cpp-rtpbld-55.cisco.com (8.13.8/8.13.8/Submit) id t1OG1V0u028888; Tue, 24 Feb 2015 11:01:31 -0500 From: Robbie King To: lng-odp@lists.linaro.org Date: Tue, 24 Feb 2015 11:00:45 -0500 Message-Id: <1424793647-28572-9-git-send-email-robking@cisco.com> X-Mailer: git-send-email 1.8.2.1 In-Reply-To: <1424793647-28572-1-git-send-email-robking@cisco.com> References: <1424793647-28572-1-git-send-email-robking@cisco.com> X-Topics: patch Subject: [lng-odp] [PATCHv4 08/10] linux-generic: shm: add term_global 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-Original-Sender: robking@cisco.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c04::234 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org; dkim=fail header.i=@cisco.com Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 From: Yan Sonming Signed-off-by: Yan Songming Signed-off-by: Mike Holmes Signed-off-by: Robbie King --- platform/linux-generic/include/odp_internal.h | 1 + platform/linux-generic/odp_init.c | 5 +++++ platform/linux-generic/odp_shared_memory.c | 11 +++++++++++ 3 files changed, 17 insertions(+) diff --git a/platform/linux-generic/include/odp_internal.h b/platform/linux-generic/include/odp_internal.h index dad844f..4b9630c 100644 --- a/platform/linux-generic/include/odp_internal.h +++ b/platform/linux-generic/include/odp_internal.h @@ -37,6 +37,7 @@ int odp_thread_term_local(void); int odp_thread_term_global(void); int odp_shm_init_global(void); +int odp_shm_term_global(void); int odp_shm_init_local(void); int odp_pool_init_global(void); diff --git a/platform/linux-generic/odp_init.c b/platform/linux-generic/odp_init.c index 4f2b94a..0cb6cf8 100644 --- a/platform/linux-generic/odp_init.c +++ b/platform/linux-generic/odp_init.c @@ -113,6 +113,11 @@ int odp_term_global(void) rc = -1; } + if (odp_shm_term_global()) { + ODP_ERR("ODP shm term failed.\n"); + rc = -1; + } + return rc; } diff --git a/platform/linux-generic/odp_shared_memory.c b/platform/linux-generic/odp_shared_memory.c index dbaec22..9f6ce1e 100644 --- a/platform/linux-generic/odp_shared_memory.c +++ b/platform/linux-generic/odp_shared_memory.c @@ -96,6 +96,17 @@ int odp_shm_init_global(void) return 0; } +int odp_shm_term_global(void) +{ + int ret; + + ret = munmap(odp_shm_tbl, sizeof(odp_shm_table_t)); + if (ret) + ODP_ERR("unable to munmap\n."); + + return ret; +} + int odp_shm_init_local(void) {