From patchwork Mon Feb 23 20:36:03 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robbie King X-Patchwork-Id: 44917 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f71.google.com (mail-wg0-f71.google.com [74.125.82.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id A701D21562 for ; Mon, 23 Feb 2015 20:37:42 +0000 (UTC) Received: by wghk14 with SMTP id k14sf694202wgh.0 for ; Mon, 23 Feb 2015 12:37:42 -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=Qd4swrojnsQwyxlXTjALncCAyEH2/nfogFNMuvTtP2o=; b=QVQIwC3X59C1gzkXcCSjm93tbLyjXiUcmehJQuvDAXidefHj2c7UjoH3qxSb/OEDj2 +Nzi00NQb/C9LprgsgryVbpU2lS1SAXyQdEg9JTCyq1mRLZz2VPo29yDfpXXpQLehuqa Yq083HKxXwdnuHzm+y64WEbfb27nRqJBhmmFoOVK1QILhfOBxlPjNHwmhfKUWjhBY+F2 q6od1CuJcdlAAinl2bulPJnliY8bxXtjIVtNv/c/xOAFQUA1uzcH4PEAOQcZuJV3J0FB H2Mz5ojd+ReFoQFf3FjPhc7X4gRVgiKlh1IcqpyOz7+InQxfNgIKqtIgMufXBPRykvG9 QhhQ== X-Gm-Message-State: ALoCoQmCcahuqCT6gxHLazE8qt3DjZXENoP2/wBT/tTQsu4h9U8iXFw0aGItgEutDnxpGV99Hs28 X-Received: by 10.112.130.70 with SMTP id oc6mr1676508lbb.13.1424723861949; Mon, 23 Feb 2015 12:37:41 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.6.68 with SMTP id y4ls603957lay.12.gmail; Mon, 23 Feb 2015 12:37:41 -0800 (PST) X-Received: by 10.112.78.37 with SMTP id y5mr11197044lbw.91.1424723861640; Mon, 23 Feb 2015 12:37:41 -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 jg8si24904748lbc.96.2015.02.23.12.37.41 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 23 Feb 2015 12:37:41 -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 lamq1 with SMTP id q1so21096429lam.5 for ; Mon, 23 Feb 2015 12:37:41 -0800 (PST) X-Received: by 10.152.21.201 with SMTP id x9mr798406lae.72.1424723861533; Mon, 23 Feb 2015 12:37:41 -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 h5csp1500492lbj; Mon, 23 Feb 2015 12:37:40 -0800 (PST) X-Received: by 10.140.233.79 with SMTP id e76mr29100510qhc.100.1424723860119; Mon, 23 Feb 2015 12:37:40 -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 j8si37117324qgf.57.2015.02.23.12.37.38 (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 23 Feb 2015 12:37:40 -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 1YPzl2-0002lk-IX; Mon, 23 Feb 2015 20:37:36 +0000 Received: from rcdn-iport-1.cisco.com ([173.37.86.72]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YPzkQ-0002co-Ks for lng-odp@lists.linaro.org; Mon, 23 Feb 2015 20:36:58 +0000 X-IronPort-AV: E=Sophos;i="5.09,633,1418083200"; d="scan'208";a="395330051" Received: from alln-core-9.cisco.com ([173.36.13.129]) by rcdn-iport-1.cisco.com with ESMTP; 23 Feb 2015 20:36:53 +0000 Received: from cpp-rtpbld-55.cisco.com (cpp-rtpbld-55.cisco.com [172.18.5.199]) by alln-core-9.cisco.com (8.14.5/8.14.5) with ESMTP id t1NKaqVU009236 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 23 Feb 2015 20:36:53 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 t1NKalTK030630; Mon, 23 Feb 2015 15:36:47 -0500 Received: (from robking@localhost) by cpp-rtpbld-55.cisco.com (8.13.8/8.13.8/Submit) id t1NKalpU030621; Mon, 23 Feb 2015 15:36:47 -0500 From: Robbie King To: lng-odp@lists.linaro.org Date: Mon, 23 Feb 2015 15:36:03 -0500 Message-Id: <1424723769-8762-5-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 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 48bc9a2..4f6eeb9 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) {