From patchwork Tue Feb 24 16:00:44 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robbie King X-Patchwork-Id: 44948 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 91F5B2029F for ; Tue, 24 Feb 2015 16:02:05 +0000 (UTC) Received: by lamq1 with SMTP id q1sf17789913lam.0 for ; Tue, 24 Feb 2015 08:02: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=djjYEOHjEPpXMm2IBO/1POneqd/WzKFdjse2BfiXMlc=; b=KB7L2i5BIabcvGQ9j60VTqUTXYmmJlHMEMEWU/btG5UYzDNM9GysKpaf0uWoa2QFJd I0sJaOdnpxzlv2kqkdHBQHhLGOEmu+SAtfc/CykWyCtP3I8UYP3toDYEU7w/kQ4/Sqy3 R5YRWZPPZwShvjw9PjpFV+M6sDZGcDUOoDF3VQKICtj4cgS+Hl2RtiwAOkYWwU+l4yDm Fup9NcAOwRTreoyBnK/wYYWp3JWy4dtg5+O7X2v2oyTn6Htauc7VzbULbgt9HjKMuj1b KfIKwNogjUp4Y5Ke0Ir+kL63Tfg7wggs3guDzyh16mm8qgPmgeyzd82tLhQf5E0WeOdG IVtA== X-Gm-Message-State: ALoCoQnrIgGOgW19W5/A+NsReYtGCvAWqA8U8zfuw2tSZmSiIRaeRurshoYzwNSZVMIwIeUW8QX7 X-Received: by 10.112.77.101 with SMTP id r5mr2322696lbw.4.1424793724547; Tue, 24 Feb 2015 08:02:04 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.153.5.9 with SMTP id ci9ls701089lad.40.gmail; Tue, 24 Feb 2015 08:02:04 -0800 (PST) X-Received: by 10.152.5.6 with SMTP id o6mr15167834lao.59.1424793724361; Tue, 24 Feb 2015 08:02:04 -0800 (PST) Received: from mail-lb0-x22f.google.com (mail-lb0-x22f.google.com. [2a00:1450:4010:c04::22f]) by mx.google.com with ESMTPS id i7si20773061laf.49.2015.02.24.08.02.04 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Feb 2015 08:02:04 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c04::22f as permitted sender) client-ip=2a00:1450:4010:c04::22f; Received: by lbdu14 with SMTP id u14so25768985lbd.1 for ; Tue, 24 Feb 2015 08:02:04 -0800 (PST) X-Received: by 10.112.57.139 with SMTP id i11mr15029186lbq.106.1424793724264; Tue, 24 Feb 2015 08:02:04 -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 h5csp2000825lbj; Tue, 24 Feb 2015 08:02:03 -0800 (PST) X-Received: by 10.140.102.19 with SMTP id v19mr36326573qge.32.1424793722628; Tue, 24 Feb 2015 08:02: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 w99si31311309qge.15.2015.02.24.08.01.59 (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 24 Feb 2015 08:02: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 1YQHvq-0006fW-1S; Tue, 24 Feb 2015 16:01:58 +0000 Received: from rcdn-iport-4.cisco.com ([173.37.86.75]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YQHvV-0006aq-Pj for lng-odp@lists.linaro.org; Tue, 24 Feb 2015 16:01:37 +0000 X-IronPort-AV: E=Sophos;i="5.09,639,1418083200"; d="scan'208";a="398776229" Received: from alln-core-4.cisco.com ([173.36.13.137]) by rcdn-iport-4.cisco.com with ESMTP; 24 Feb 2015 16:01:32 +0000 Received: from cpp-rtpbld-55.cisco.com (cpp-rtpbld-55.cisco.com [172.18.5.199]) by alln-core-4.cisco.com (8.14.5/8.14.5) with ESMTP id t1OG1WZ3019954 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 24 Feb 2015 16:01:32 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 t1OG1VQI028885; Tue, 24 Feb 2015 11:01:31 -0500 Received: (from robking@localhost) by cpp-rtpbld-55.cisco.com (8.13.8/8.13.8/Submit) id t1OG1VP7028884; Tue, 24 Feb 2015 11:01:31 -0500 From: Robbie King To: lng-odp@lists.linaro.org Date: Tue, 24 Feb 2015 11:00:44 -0500 Message-Id: <1424793647-28572-8-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 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-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::22f 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_thread.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 c82012d..dad844f 100644 --- a/platform/linux-generic/include/odp_internal.h +++ b/platform/linux-generic/include/odp_internal.h @@ -34,6 +34,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 b09e9b3..4f2b94a 100644 --- a/platform/linux-generic/odp_init.c +++ b/platform/linux-generic/odp_init.c @@ -108,6 +108,11 @@ int odp_term_global(void) rc = -1; } + if (odp_thread_term_global()) { + ODP_ERR("ODP thread term failed.\n"); + rc = -1; + } + return rc; } diff --git a/platform/linux-generic/odp_thread.c b/platform/linux-generic/odp_thread.c index f6c900b..c6813f5 100644 --- a/platform/linux-generic/odp_thread.c +++ b/platform/linux-generic/odp_thread.c @@ -65,6 +65,17 @@ int odp_thread_init_global(void) return 0; } +int odp_thread_term_global(void) +{ + int ret; + + ret = odp_shm_free(odp_shm_lookup("odp_thread_globals")); + if (ret < 0) + ODP_ERR("shm free failed for odp_thread_globals"); + + return ret; +} + static int thread_id(void) {