From patchwork Fri Jan 30 02:46:54 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Holmes X-Patchwork-Id: 44006 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f197.google.com (mail-lb0-f197.google.com [209.85.217.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 9369024128 for ; Fri, 30 Jan 2015 02:48:05 +0000 (UTC) Received: by mail-lb0-f197.google.com with SMTP id b6sf26191133lbj.0 for ; Thu, 29 Jan 2015 18:48:04 -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=N+1tAO/ipi0zpHQ2F8XLiyk75w4bRX2eERTNCbeg6aA=; b=V6HvrFK3wiSYe8swIoy/+LHyftS58hc4fy9lKRf8m7dXEHUZu2aMnTld7UPw+HpdLa lPnrcLgwuuD7gtDsGWzu2QBsODcKL24EMC38DaRDAdmCqGEhY8UjuWQwGIDn+fqk7wsL /26+gRto9jvBgfavWlpmTLiyctd45UImwrJ6dduRAa08WkJqX+p978r0lP4s1yRh+x4X U+HPAQSO2hDzNWrW5wSsAY3DhQ+IkGYIyr3fwsr5ECh61jztfMFSc1LGzDCqZ03GYLqw zHKksdPESBrbYAtvQcLaG5FNWuFOx8R3RxSMefF1SMAU2kn4npZmJmG3Aof4XJ9j+Tq7 h5dg== X-Gm-Message-State: ALoCoQkkWf/0g6SIbd7lp1SKIWHA0Cj7zU0jGqOJma5suCOA7Y3UUqult1PWJP/BApLsTUGkC0JC X-Received: by 10.112.154.233 with SMTP id vr9mr500280lbb.9.1422586084301; Thu, 29 Jan 2015 18:48:04 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.120.193 with SMTP id le1ls383291lab.11.gmail; Thu, 29 Jan 2015 18:48:04 -0800 (PST) X-Received: by 10.112.47.135 with SMTP id d7mr4356932lbn.54.1422586084088; Thu, 29 Jan 2015 18:48:04 -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 u2si9070034lae.110.2015.01.29.18.48.04 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 29 Jan 2015 18:48:04 -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 hs14so21397084lab.9 for ; Thu, 29 Jan 2015 18:48:04 -0800 (PST) X-Received: by 10.112.25.104 with SMTP id b8mr4220646lbg.69.1422586083997; Thu, 29 Jan 2015 18:48:03 -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 h5csp140868lbj; Thu, 29 Jan 2015 18:48:03 -0800 (PST) X-Received: by 10.229.1.72 with SMTP id 8mr8146548qce.25.1422586082784; Thu, 29 Jan 2015 18:48:02 -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 n4si12785386qat.4.2015.01.29.18.48.01 (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 29 Jan 2015 18:48:02 -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 1YH1cm-0002mG-3x; Fri, 30 Jan 2015 02:48:00 +0000 Received: from mail-qg0-f50.google.com ([209.85.192.50]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YH1c4-0002hU-0F for lng-odp@lists.linaro.org; Fri, 30 Jan 2015 02:47:16 +0000 Received: by mail-qg0-f50.google.com with SMTP id f51so36444310qge.9 for ; Thu, 29 Jan 2015 18:47:10 -0800 (PST) X-Received: by 10.224.120.130 with SMTP id d2mr8018732qar.81.1422586030867; Thu, 29 Jan 2015 18:47:10 -0800 (PST) Received: from mike-desktop.?.holmesfamily.ws ([98.221.136.245]) by mx.google.com with ESMTPSA id n4sm8829452qas.20.2015.01.29.18.47.10 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 29 Jan 2015 18:47:10 -0800 (PST) From: Mike Holmes To: lng-odp@lists.linaro.org Date: Thu, 29 Jan 2015 21:46:54 -0500 Message-Id: <1422586015-29874-9-git-send-email-mike.holmes@linaro.org> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1422586015-29874-1-git-send-email-mike.holmes@linaro.org> References: <1422586015-29874-1-git-send-email-mike.holmes@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCH 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-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.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 From: Yan Sonming Signed-off-by: Yan Songming Signed-off-by: Mike Holmes --- platform/linux-generic/include/odp_internal.h | 1 + platform/linux-generic/odp_init.c | 5 +++++ platform/linux-generic/odp_shared_memory.c | 8 ++++++++ 3 files changed, 14 insertions(+) diff --git a/platform/linux-generic/include/odp_internal.h b/platform/linux-generic/include/odp_internal.h index d6a89ff..5b81570 100644 --- a/platform/linux-generic/include/odp_internal.h +++ b/platform/linux-generic/include/odp_internal.h @@ -32,6 +32,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_buffer_pool_init_global(void); diff --git a/platform/linux-generic/odp_init.c b/platform/linux-generic/odp_init.c index 6a27b42..8e61368 100644 --- a/platform/linux-generic/odp_init.c +++ b/platform/linux-generic/odp_init.c @@ -107,6 +107,11 @@ int odp_term_global(void) return -1; } + if (odp_shm_term_global()) { + ODP_ERR("ODP shm term failed.\n"); + return -1; + } + return 0; } diff --git a/platform/linux-generic/odp_shared_memory.c b/platform/linux-generic/odp_shared_memory.c index 96d10e8..01cfdb0 100644 --- a/platform/linux-generic/odp_shared_memory.c +++ b/platform/linux-generic/odp_shared_memory.c @@ -96,6 +96,14 @@ int odp_shm_init_global(void) return 0; } +int odp_shm_term_global(void) +{ + int ret = 0; + + ret = munmap(odp_shm_tbl, sizeof(odp_shm_table_t)); + return ret; +} + int odp_shm_init_local(void) {