From patchwork Mon Feb 16 19:55:14 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Holmes X-Patchwork-Id: 44729 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f70.google.com (mail-wg0-f70.google.com [74.125.82.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 717CE21544 for ; Mon, 16 Feb 2015 19:56:25 +0000 (UTC) Received: by mail-wg0-f70.google.com with SMTP id y19sf20608631wgg.1 for ; Mon, 16 Feb 2015 11:56:24 -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=XW8RNMeIsCHK7CWzUwazJEzrIiUAIR7lQNWa5yBsdZo=; b=YGH9ExvPeA+2D+MnBG8hiax2Crim4LFoK3786RtuWjGfpjlzk4DEec1nSLr9WAPtzD bfhg/CmasAY26MfvWHYnHyL1fhWrN/nj1tcTO0bIXv2NY2kxaskxxGNLtH3tMOnhOUf9 0yBwluZ4heUSU9EGo0sZrLfaoNHxvP5+9avW2K8KVccGgyq7mPihk89/LZkAxL+zoKcV 4DF4Od/ZgHt3AalntGTOdU4fD+/E56x8zyR/jdHfZjybY33S0dzDi7w8q5g5JBW9jkVD sSgjJqS6xz6BnuCAr6qnFfbpeRjWzv9e5/Uk4odVFThMo4n/awUHTNp2NGNQkcTm5u3y fIZg== X-Gm-Message-State: ALoCoQmjFc86ATRGCpbPnTbc8Q3NJIdo7XZcPyJgHOb8HkyrmmN4e3lXLYuT5aD7tWR7VbmiWFCp X-Received: by 10.112.189.227 with SMTP id gl3mr1430846lbc.2.1424116584775; Mon, 16 Feb 2015 11:56:24 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.204.12 with SMTP id ku12ls399057lac.105.gmail; Mon, 16 Feb 2015 11:56:24 -0800 (PST) X-Received: by 10.152.37.225 with SMTP id b1mr24832036lak.93.1424116584562; Mon, 16 Feb 2015 11:56:24 -0800 (PST) Received: from mail-la0-f50.google.com (mail-la0-f50.google.com. [209.85.215.50]) by mx.google.com with ESMTPS id l10si484518lah.3.2015.02.16.11.56.24 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 16 Feb 2015 11:56:24 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.50 as permitted sender) client-ip=209.85.215.50; Received: by lams18 with SMTP id s18so31862884lam.13 for ; Mon, 16 Feb 2015 11:56:24 -0800 (PST) X-Received: by 10.152.8.33 with SMTP id o1mr25753714laa.56.1424116584415; Mon, 16 Feb 2015 11:56:24 -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 h5csp1787965lbj; Mon, 16 Feb 2015 11:56:23 -0800 (PST) X-Received: by 10.236.98.65 with SMTP id u41mr17279692yhf.57.1424116580775; Mon, 16 Feb 2015 11:56:20 -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 j8si15376231qan.55.2015.02.16.11.56.19 (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 16 Feb 2015 11:56:20 -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 1YNRmD-0007aN-VE; Mon, 16 Feb 2015 19:56:17 +0000 Received: from mail-qg0-f43.google.com ([209.85.192.43]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YNRls-0007S5-CL for lng-odp@lists.linaro.org; Mon, 16 Feb 2015 19:55:56 +0000 Received: by mail-qg0-f43.google.com with SMTP id i50so24943082qgf.2 for ; Mon, 16 Feb 2015 11:55:51 -0800 (PST) X-Received: by 10.140.145.4 with SMTP id 4mr25613qhr.52.1424116551209; Mon, 16 Feb 2015 11:55:51 -0800 (PST) Received: from mike-desktop.?.holmesfamily.ws (c-98-221-136-245.hsd1.nj.comcast.net. [98.221.136.245]) by mx.google.com with ESMTPSA id o10sm4832854qag.9.2015.02.16.11.55.50 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 16 Feb 2015 11:55:50 -0800 (PST) From: Mike Holmes To: lng-odp@lists.linaro.org Date: Mon, 16 Feb 2015 14:55:14 -0500 Message-Id: <1424116520-20381-5-git-send-email-mike.holmes@linaro.org> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1424116520-20381-1-git-send-email-mike.holmes@linaro.org> References: <1424116520-20381-1-git-send-email-mike.holmes@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCH v2 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-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.215.50 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 Sonming Signed-off-by: Mike Holmes --- platform/linux-generic/include/odp_internal.h | 1 + platform/linux-generic/odp_init.c | 5 +++++ platform/linux-generic/odp_schedule.c | 25 +++++++++++++++++++++++++ 3 files changed, 31 insertions(+) diff --git a/platform/linux-generic/include/odp_internal.h b/platform/linux-generic/include/odp_internal.h index 0120c53..d244c75 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 cdce239..2788e46 100644 --- a/platform/linux-generic/odp_init.c +++ b/platform/linux-generic/odp_init.c @@ -91,6 +91,11 @@ int odp_term_global(void) return -1; } + if (odp_schedule_term_global()) { + ODP_ERR("ODP schedule term failed.\n"); + return -1; + } + return 0; } diff --git a/platform/linux-generic/odp_schedule.c b/platform/linux-generic/odp_schedule.c index 3427082..be5149b 100644 --- a/platform/linux-generic/odp_schedule.c +++ b/platform/linux-generic/odp_schedule.c @@ -144,6 +144,31 @@ int odp_schedule_init_global(void) return 0; } +int odp_schedule_term_global(void) +{ + odp_shm_t shm; + int ret = 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"); + return -1; + } + + shm = odp_shm_lookup("odp_scheduler"); + if (shm == ODP_SHM_INVALID) { + ODP_ERR("Sched term: Shm lookup fail.\n"); + return -1; + } + ret = odp_shm_free(shm); + + return ret; +} int odp_schedule_init_local(void) {