From patchwork Tue Feb 24 16:00:41 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robbie King X-Patchwork-Id: 44945 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f69.google.com (mail-la0-f69.google.com [209.85.215.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 20DAB2029F for ; Tue, 24 Feb 2015 16:01:48 +0000 (UTC) Received: by lamq1 with SMTP id q1sf17785651lam.0 for ; Tue, 24 Feb 2015 08:01:47 -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=vKjlQs+pL2q/5K2cubS/Yj6GGsuHLEMKWJ9Gc859Hus=; b=aH2PLyzbIMa+7TNn5s2PmYDGld6wXstDc08N2kpy1iWwmoPJQLhsNT2VAG7Q0RLkPm MnmRv0EyW5bb93y49KG43MuUGRSgH7GFYnqFhosnwC5EGMt+60W6z7zYNrrlrJ4adFvy arN5sB55rgrCwZjHBovZGvMkdGZcG6SgOjLmKMrr7abqUbqsdAP+xYtKyHHBRZAk1RNN P9QpGcySSCdZQhM592jSTrpjCa/b/s/bxk4jd73pTaOI/sgrXrTAxoGYK6ATf0jUfFfo 0TYdyNXXb6J10FUNKFiAkZJbve6ImnL6odOWb3KMuUjGS5Ekj2YB8Sgo5sJ1oFCkf0jG 6IGA== X-Gm-Message-State: ALoCoQmiARPkQzR3GHDL0uYLba+mDwJD/f0Mv5EdbZl2ijuEh65jst7McjK5ZPcotyxGUM09F+2X X-Received: by 10.152.36.132 with SMTP id q4mr2261847laj.6.1424793707034; Tue, 24 Feb 2015 08:01:47 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.234.232 with SMTP id uh8ls688792lac.82.gmail; Tue, 24 Feb 2015 08:01:46 -0800 (PST) X-Received: by 10.112.167.231 with SMTP id zr7mr15051251lbb.123.1424793706837; Tue, 24 Feb 2015 08:01:46 -0800 (PST) Received: from mail-la0-x232.google.com (mail-la0-x232.google.com. [2a00:1450:4010:c03::232]) by mx.google.com with ESMTPS id lt9si26524209lac.133.2015.02.24.08.01.46 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Feb 2015 08:01:46 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c03::232 as permitted sender) client-ip=2a00:1450:4010:c03::232; Received: by labge10 with SMTP id ge10so26550531lab.12 for ; Tue, 24 Feb 2015 08:01:46 -0800 (PST) X-Received: by 10.112.118.211 with SMTP id ko19mr15076800lbb.19.1424793706743; Tue, 24 Feb 2015 08:01:46 -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 h5csp2000587lbj; Tue, 24 Feb 2015 08:01:46 -0800 (PST) X-Received: by 10.236.36.110 with SMTP id v74mr14848184yha.186.1424793705285; Tue, 24 Feb 2015 08:01:45 -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 a10si31756880qac.24.2015.02.24.08.01.42 (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 24 Feb 2015 08:01:45 -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 1YQHvY-0006cb-0S; Tue, 24 Feb 2015 16:01:40 +0000 Received: from alln-iport-1.cisco.com ([173.37.142.88]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YQHvJ-0006Zu-1K for lng-odp@lists.linaro.org; Tue, 24 Feb 2015 16:01:25 +0000 X-IronPort-AV: E=Sophos;i="5.09,639,1418083200"; d="scan'208";a="126417112" Received: from alln-core-12.cisco.com ([173.36.13.134]) by alln-iport-1.cisco.com with ESMTP; 24 Feb 2015 16:01:25 +0000 Received: from cpp-rtpbld-55.cisco.com (cpp-rtpbld-55.cisco.com [172.18.5.199]) by alln-core-12.cisco.com (8.14.5/8.14.5) with ESMTP id t1OG1O6x003232 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 24 Feb 2015 16:01:24 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 t1OG1IPR028844; Tue, 24 Feb 2015 11:01:18 -0500 Received: (from robking@localhost) by cpp-rtpbld-55.cisco.com (8.13.8/8.13.8/Submit) id t1OG1IWK028843; Tue, 24 Feb 2015 11:01:18 -0500 From: Robbie King To: lng-odp@lists.linaro.org Date: Tue, 24 Feb 2015 11:00:41 -0500 Message-Id: <1424793647-28572-5-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 04/10] linux-generic: schedule: 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::232 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 Sonming 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_schedule.c | 24 ++++++++++++++++++++++++ 3 files changed, 30 insertions(+) diff --git a/platform/linux-generic/include/odp_internal.h b/platform/linux-generic/include/odp_internal.h index e43608d..83b0beb 100644 --- a/platform/linux-generic/include/odp_internal.h +++ b/platform/linux-generic/include/odp_internal.h @@ -53,6 +53,7 @@ int odp_crypto_init_global(void); int odp_crypto_term_global(void); int odp_schedule_init_global(void); +int odp_schedule_term_global(void); int odp_schedule_init_local(void); int odp_timer_init_global(void); diff --git a/platform/linux-generic/odp_init.c b/platform/linux-generic/odp_init.c index d6382fb..966009a 100644 --- a/platform/linux-generic/odp_init.c +++ b/platform/linux-generic/odp_init.c @@ -93,6 +93,11 @@ int odp_term_global(void) rc = -1; } + if (odp_schedule_term_global()) { + ODP_ERR("ODP schedule term failed.\n"); + rc = -1; + } + return rc; } diff --git a/platform/linux-generic/odp_schedule.c b/platform/linux-generic/odp_schedule.c index 3427082..0749b67 100644 --- a/platform/linux-generic/odp_schedule.c +++ b/platform/linux-generic/odp_schedule.c @@ -144,6 +144,30 @@ int odp_schedule_init_global(void) return 0; } +int odp_schedule_term_global(void) +{ + int ret = 0; + int rc = 0; + int i, j; + + for (i = 0; i < ODP_CONFIG_SCHED_PRIOS; i++) { + for (j = 0; j < QUEUES_PER_PRIO; j++) + odp_queue_destroy(sched->pri_queue[i][j]); + } + + if (odp_pool_destroy(sched->pool) != 0) { + ODP_ERR("Sched term: Pool destroy fail.\n"); + rc = -1; + } + + ret = odp_shm_free(odp_shm_lookup("odp_scheduler")); + if (ret < 0) { + ODP_ERR("Sched term: shm free failed for odp_scheduler"); + rc = -1; + } + + return rc; +} int odp_schedule_init_local(void) {