From patchwork Fri Jan 30 02:46:50 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Holmes X-Patchwork-Id: 44002 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f198.google.com (mail-lb0-f198.google.com [209.85.217.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 850BA24128 for ; Fri, 30 Jan 2015 02:47:47 +0000 (UTC) Received: by mail-lb0-f198.google.com with SMTP id l4sf25998183lbv.1 for ; Thu, 29 Jan 2015 18:47:46 -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=ApWU40JjgCBakr3J3ZHtkNFP54XxFrptz/u5NHg36+U=; b=TtRTZGw9Fh3ATPuqdU5IpvfXsrkNNNO6YMHkAivLoynzAaKtymQQ+cNF8RJzXScLU5 A1J9gxyFlVLcu0KR3IPPmE84Vq131Xbk2ws11BRZJn5sAYGDhQIMCxLJsv1aEf+2t8LZ H82wxNh/3/4hZJNzFfjxX1SbCIK9K/W0QGDF5lk+XnKDz1z+iiSIdVsFi3CdWoAR8KNI 0g0azQ2D24+3an/bQ48L8R8hRFDwDRFlm4fxPGQSrgLccUFwSe/anb/eQv0uXT0R2LYA TKpBJr/jK0GZPPMK5fAwO6EgWV6RT/GglGD/4syj3wt1V0czE1Tp5bC5TtjSeYdMIrMa fnLA== X-Gm-Message-State: ALoCoQnQoDM/twzmc7R0wPTW0AoxHEl9z1q4iAH9an9DUtQNQYTryt0wKIyfpnOe3d/KniB50N20 X-Received: by 10.112.30.131 with SMTP id s3mr497900lbh.13.1422586066605; Thu, 29 Jan 2015 18:47:46 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.153.7.162 with SMTP id dd2ls12405lad.81.gmail; Thu, 29 Jan 2015 18:47:46 -0800 (PST) X-Received: by 10.152.23.195 with SMTP id o3mr4377548laf.70.1422586066264; Thu, 29 Jan 2015 18:47:46 -0800 (PST) Received: from mail-lb0-f176.google.com (mail-lb0-f176.google.com. [209.85.217.176]) by mx.google.com with ESMTPS id q4si9074656lag.103.2015.01.29.18.47.46 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 29 Jan 2015 18:47:46 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.176 as permitted sender) client-ip=209.85.217.176; Received: by mail-lb0-f176.google.com with SMTP id z12so34207914lbi.7 for ; Thu, 29 Jan 2015 18:47:46 -0800 (PST) X-Received: by 10.152.3.70 with SMTP id a6mr4241011laa.71.1422586066128; Thu, 29 Jan 2015 18:47: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 h5csp140815lbj; Thu, 29 Jan 2015 18:47:45 -0800 (PST) X-Received: by 10.224.2.71 with SMTP id 7mr8305198qai.94.1422586064761; Thu, 29 Jan 2015 18:47:44 -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 u47si12784209qge.5.2015.01.29.18.47.43 (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 29 Jan 2015 18:47:44 -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 1YH1cU-0002jY-2G; Fri, 30 Jan 2015 02:47:42 +0000 Received: from mail-qc0-f170.google.com ([209.85.216.170]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YH1c0-0002h5-VJ for lng-odp@lists.linaro.org; Fri, 30 Jan 2015 02:47:12 +0000 Received: by mail-qc0-f170.google.com with SMTP id p6so18663189qcv.1 for ; Thu, 29 Jan 2015 18:47:07 -0800 (PST) X-Received: by 10.224.14.84 with SMTP id f20mr7906165qaa.43.1422586027849; Thu, 29 Jan 2015 18:47:07 -0800 (PST) Received: from mike-desktop.?.holmesfamily.ws ([98.221.136.245]) by mx.google.com with ESMTPSA id n4sm8829452qas.20.2015.01.29.18.47.07 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 29 Jan 2015 18:47:07 -0800 (PST) From: Mike Holmes To: lng-odp@lists.linaro.org Date: Thu, 29 Jan 2015 21:46:50 -0500 Message-Id: <1422586015-29874-5-git-send-email-mike.holmes@linaro.org> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1422586015-29874-1-git-send-email-mike.holmes@linaro.org> References: <1422586015-29874-1-git-send-email-mike.holmes@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCH 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.217.176 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 b2b595c..79bf6e3 100644 --- a/platform/linux-generic/include/odp_internal.h +++ b/platform/linux-generic/include/odp_internal.h @@ -48,6 +48,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 97b4665..b91fca4 100644 --- a/platform/linux-generic/odp_init.c +++ b/platform/linux-generic/odp_init.c @@ -87,6 +87,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 999c800..32dcf50 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) {