From patchwork Mon Feb 23 20:36:06 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robbie King X-Patchwork-Id: 44920 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f200.google.com (mail-wi0-f200.google.com [209.85.212.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id D64EF21562 for ; Mon, 23 Feb 2015 20:37:55 +0000 (UTC) Received: by mail-wi0-f200.google.com with SMTP id r20sf11653533wiv.3 for ; Mon, 23 Feb 2015 12:37:55 -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=wVEFvvzmwsQllvWj2hPCsonYKUovYLx8MhFOL/RhUEk=; b=Bu5wGGnjOzT03bcra8IDAM8wBOiAD0assWivmUUhyVf2MESLB3puk1E4DFVIdXEHQz FQcEaZGaBJ7ixeA5Mo4tbCKMl7JV3viaGcCZ149AIpwm0oRyqnzB8GRgvpzal87piGh5 DVJ72sl0Brv+UIu9mtvKdsa0Y9Gq4xhg8eJqz4W4DeSQ7D1W+I7SpNoYPFJz5mVqaTnR GVnO2G9qIqruglpIKMmJvgqXs6llJWn8U3+RCNlDnRXlWPX97rAsX9y1wtg5qbRgEY7k 6+jpRMM6+9p/qpHmfqZrRi1HcnBvlAWNNchSkS28Kq7+f5kXmnGzkHIlz9g7ps/Mudr5 sMog== X-Gm-Message-State: ALoCoQlbSPwx+OfDr8/cJej7z3u5Hz4osZIrEvxy6PuDfsqwdnKfbgn80OwWPslgyrWshSI8uPna X-Received: by 10.112.124.142 with SMTP id mi14mr1595147lbb.1.1424723875170; Mon, 23 Feb 2015 12:37:55 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.28.42 with SMTP id y10ls585015lag.71.gmail; Mon, 23 Feb 2015 12:37:54 -0800 (PST) X-Received: by 10.112.142.134 with SMTP id rw6mr11636743lbb.100.1424723874889; Mon, 23 Feb 2015 12:37:54 -0800 (PST) Received: from mail-la0-x234.google.com (mail-la0-x234.google.com. [2a00:1450:4010:c03::234]) by mx.google.com with ESMTPS id ao6si24865836lbc.86.2015.02.23.12.37.54 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 23 Feb 2015 12:37:54 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c03::234 as permitted sender) client-ip=2a00:1450:4010:c03::234; Received: by labgq15 with SMTP id gq15so21178628lab.6 for ; Mon, 23 Feb 2015 12:37:54 -0800 (PST) X-Received: by 10.152.26.199 with SMTP id n7mr11322540lag.29.1424723874776; Mon, 23 Feb 2015 12:37:54 -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 h5csp1500570lbj; Mon, 23 Feb 2015 12:37:54 -0800 (PST) X-Received: by 10.140.233.84 with SMTP id e81mr1924517qhc.94.1424723873522; Mon, 23 Feb 2015 12:37:53 -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 j131si28800226qhc.130.2015.02.23.12.37.51 (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 23 Feb 2015 12:37:53 -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 1YPzlG-0002pz-41; Mon, 23 Feb 2015 20:37:50 +0000 Received: from alln-iport-3.cisco.com ([173.37.142.90]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YPzkT-0002d1-O2 for lng-odp@lists.linaro.org; Mon, 23 Feb 2015 20:37:01 +0000 X-IronPort-AV: E=Sophos;i="5.09,633,1418083200"; d="scan'208";a="126179340" Received: from alln-core-1.cisco.com ([173.36.13.131]) by alln-iport-3.cisco.com with ESMTP; 23 Feb 2015 20:36:56 +0000 Received: from cpp-rtpbld-55.cisco.com (cpp-rtpbld-55.cisco.com [172.18.5.199]) by alln-core-1.cisco.com (8.14.5/8.14.5) with ESMTP id t1NKatYY001394 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 23 Feb 2015 20:36:56 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 t1NKattO030655; Mon, 23 Feb 2015 15:36:55 -0500 Received: (from robking@localhost) by cpp-rtpbld-55.cisco.com (8.13.8/8.13.8/Submit) id t1NKas7C030654; Mon, 23 Feb 2015 15:36:54 -0500 From: Robbie King To: lng-odp@lists.linaro.org Date: Mon, 23 Feb 2015 15:36:06 -0500 Message-Id: <1424723769-8762-8-git-send-email-robking@cisco.com> X-Mailer: git-send-email 1.8.2.1 In-Reply-To: <1424723769-8762-1-git-send-email-robking@cisco.com> References: <1424723769-8762-1-git-send-email-robking@cisco.com> X-Topics: patch Subject: [lng-odp] [PATCHv3 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:c03::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_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 82735b0..cdc4565 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..ead440b 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 = 0; + + 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) {