From patchwork Fri Jan 30 02:46:53 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Holmes X-Patchwork-Id: 44005 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f199.google.com (mail-lb0-f199.google.com [209.85.217.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id F08B524128 for ; Fri, 30 Jan 2015 02:48:00 +0000 (UTC) Received: by mail-lb0-f199.google.com with SMTP id f15sf4812352lbj.2 for ; Thu, 29 Jan 2015 18:47:59 -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=mT1junkFsTqTI6+CU3jCwt4wCKtTTiaJOiyu7tlRXw8=; b=dWvyaDeUGoDetMRL9k5XfdWIr0q3E26+KTmLvh4ibBhJ/A/DfORWF/p/x7sDeznHyI Ahz1ewzkJQrIDfK7N/NZvTGRzjGn6jFOmptNrVtI9BQmKEXX6F515QH6vtArAXk8rwRL pwoOCeOoTo8IJEHIlF7jnwwPkXufskF9Ycps7haYExS3rpSfVImVpz0pdw+k3ZQOAyhH IgRF/w+hcv3LbIhAq56UJO/OcZxZt/fvUBoKNVTPWtIjkYzX2r49tPJvXj6X9X29DYbM N+cK/DaHz6gMs+6MRvHnCAuFxN56xlGOJr0XSByzCghxYg+ClXzaAsJD3fo3c0HqzQAT y8uQ== X-Gm-Message-State: ALoCoQle6CPLOhS8UXycv1U0JkXx84VKJxrbeSxxFmeu7Kvzq2u7LDibN/4PuPISAhMqeE9gFFtM X-Received: by 10.112.140.65 with SMTP id re1mr513204lbb.4.1422586079942; Thu, 29 Jan 2015 18:47:59 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.6.229 with SMTP id e5ls313000laa.105.gmail; Thu, 29 Jan 2015 18:47:59 -0800 (PST) X-Received: by 10.152.163.100 with SMTP id yh4mr4153907lab.98.1422586079661; Thu, 29 Jan 2015 18:47:59 -0800 (PST) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com. [209.85.217.182]) by mx.google.com with ESMTPS id e4si3413749lag.114.2015.01.29.18.47.59 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 29 Jan 2015 18:47:59 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.182 as permitted sender) client-ip=209.85.217.182; Received: by mail-lb0-f182.google.com with SMTP id l4so34207998lbv.13 for ; Thu, 29 Jan 2015 18:47:59 -0800 (PST) X-Received: by 10.112.131.1 with SMTP id oi1mr4380057lbb.2.1422586079581; Thu, 29 Jan 2015 18:47:59 -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 h5csp140851lbj; Thu, 29 Jan 2015 18:47:59 -0800 (PST) X-Received: by 10.140.91.201 with SMTP id z67mr4344642qgd.27.1422586078397; Thu, 29 Jan 2015 18:47:58 -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 j5si11946712qch.48.2015.01.29.18.47.57 (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 29 Jan 2015 18:47:58 -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 1YH1ch-0002lV-K8; Fri, 30 Jan 2015 02:47:55 +0000 Received: from mail-qg0-f47.google.com ([209.85.192.47]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YH1c3-0002hL-B5 for lng-odp@lists.linaro.org; Fri, 30 Jan 2015 02:47:15 +0000 Received: by mail-qg0-f47.google.com with SMTP id z60so36483975qgd.6 for ; Thu, 29 Jan 2015 18:47:10 -0800 (PST) X-Received: by 10.140.102.170 with SMTP id w39mr4145604qge.100.1422586030146; 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.09 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 29 Jan 2015 18:47:09 -0800 (PST) From: Mike Holmes To: lng-odp@lists.linaro.org Date: Thu, 29 Jan 2015 21:46:53 -0500 Message-Id: <1422586015-29874-8-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 07/10] linux-generic: thread: 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.217.182 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_thread.c | 13 +++++++++++++ 3 files changed, 19 insertions(+) diff --git a/platform/linux-generic/include/odp_internal.h b/platform/linux-generic/include/odp_internal.h index cdd6a9b..d6a89ff 100644 --- a/platform/linux-generic/include/odp_internal.h +++ b/platform/linux-generic/include/odp_internal.h @@ -29,6 +29,7 @@ int odp_system_info_init(void); int odp_thread_init_global(void); int odp_thread_init_local(void); int odp_thread_term_local(void); +int odp_thread_term_global(void); int odp_shm_init_global(void); int odp_shm_init_local(void); diff --git a/platform/linux-generic/odp_init.c b/platform/linux-generic/odp_init.c index f5be742..6a27b42 100644 --- a/platform/linux-generic/odp_init.c +++ b/platform/linux-generic/odp_init.c @@ -102,6 +102,11 @@ int odp_term_global(void) return -1; } + if (odp_thread_term_global()) { + ODP_ERR("ODP thread term failed.\n"); + return -1; + } + return 0; } diff --git a/platform/linux-generic/odp_thread.c b/platform/linux-generic/odp_thread.c index e66b8c1..80cf700 100644 --- a/platform/linux-generic/odp_thread.c +++ b/platform/linux-generic/odp_thread.c @@ -64,6 +64,19 @@ int odp_thread_init_global(void) return 0; } +int odp_thread_term_global(void) +{ + odp_shm_t shm; + int ret = 0; + + shm = odp_shm_lookup("odp_thread_globals"); + if (shm == ODP_SHM_INVALID) + return -1; + ret = odp_shm_free(shm); + + return ret; +} + static int thread_id(void) {