From patchwork Fri Jan 30 02:46:48 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Holmes X-Patchwork-Id: 44000 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f197.google.com (mail-lb0-f197.google.com [209.85.217.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 4945E24128 for ; Fri, 30 Jan 2015 02:47:31 +0000 (UTC) Received: by mail-lb0-f197.google.com with SMTP id b6sf26188933lbj.0 for ; Thu, 29 Jan 2015 18:47:30 -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=5ex5/iSwT7wUPct2R4sn5YNkZy6VKPMIwak7f6Cs8S8=; b=HCE0KSJhrAIyv9No7bYT9p9+oT0b+tfltWzr12PX+ycGRIIBtMVxOlVBwdy09TU7C0 Byvo4sSsHOJd+YSBlhR816dPJm4XjKQTMWwifrycZwr92cH784vT9slfJXNqLBQpUEWe h/6rp1eK2G0qAqkkljBiSW9slAlXnV/BPAdBddC8GcfwdtWUqCQtDhNb8Py4tqrZPQQF QhnjAbPiJLIQlVZF6O9vedMpCLa5WbS2ie4lnhpKa9P6xCDV+VRWk/UVU1jds859EV1a w+77kdSfDHRSJSoeCLp5Van9W2GDssEOUEpe+3dTtrQME3YdpXwMVOsQRp6cYuPw6NMT FT5A== X-Gm-Message-State: ALoCoQk289mV2RbtZJ/41L31IrVq5p5ijpX8zLtEZ4sKXrzbX8Zmj8r+zPyO/Zy2fahBDx00m69E X-Received: by 10.112.148.198 with SMTP id tu6mr485409lbb.3.1422586050347; Thu, 29 Jan 2015 18:47:30 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.26.165 with SMTP id m5ls107158lag.104.gmail; Thu, 29 Jan 2015 18:47:30 -0800 (PST) X-Received: by 10.112.44.230 with SMTP id h6mr4281680lbm.98.1422586050122; Thu, 29 Jan 2015 18:47:30 -0800 (PST) Received: from mail-la0-f54.google.com (mail-la0-f54.google.com. [209.85.215.54]) by mx.google.com with ESMTPS id kr3si9142924lac.22.2015.01.29.18.47.29 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 29 Jan 2015 18:47:29 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.54 as permitted sender) client-ip=209.85.215.54; Received: by mail-la0-f54.google.com with SMTP id hv19so21354617lab.13 for ; Thu, 29 Jan 2015 18:47:29 -0800 (PST) X-Received: by 10.152.116.43 with SMTP id jt11mr4252591lab.69.1422586049859; Thu, 29 Jan 2015 18:47:29 -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 h5csp140772lbj; Thu, 29 Jan 2015 18:47:29 -0800 (PST) X-Received: by 10.140.37.39 with SMTP id q36mr4380701qgq.89.1422586048650; Thu, 29 Jan 2015 18:47:28 -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 x1si11950959qcd.36.2015.01.29.18.47.27 (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 29 Jan 2015 18:47:28 -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 1YH1cD-0002iS-Tq; Fri, 30 Jan 2015 02:47:25 +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 1YH1bz-0002h1-HJ for lng-odp@lists.linaro.org; Fri, 30 Jan 2015 02:47:11 +0000 Received: by mail-qc0-f170.google.com with SMTP id p6so18663125qcv.1 for ; Thu, 29 Jan 2015 18:47:06 -0800 (PST) X-Received: by 10.229.83.196 with SMTP id g4mr8234416qcl.18.1422586026395; Thu, 29 Jan 2015 18:47:06 -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.05 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 29 Jan 2015 18:47:05 -0800 (PST) From: Mike Holmes To: lng-odp@lists.linaro.org Date: Thu, 29 Jan 2015 21:46:48 -0500 Message-Id: <1422586015-29874-3-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: crypto patch Subject: [lng-odp] [PATCH 02/10] linux-generic: odp_crypto: 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.54 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_crypto.c | 13 +++++++++++++ platform/linux-generic/odp_init.c | 5 +++++ 3 files changed, 19 insertions(+) diff --git a/platform/linux-generic/include/odp_internal.h b/platform/linux-generic/include/odp_internal.h index 2bd4b83..56dc377 100644 --- a/platform/linux-generic/include/odp_internal.h +++ b/platform/linux-generic/include/odp_internal.h @@ -44,6 +44,7 @@ int odp_classification_term_global(void); int odp_queue_init_global(void); int odp_crypto_init_global(void); +int odp_crypto_term_global(void); int odp_schedule_init_global(void); int odp_schedule_init_local(void); diff --git a/platform/linux-generic/odp_crypto.c b/platform/linux-generic/odp_crypto.c index 483925b..66cb49b 100644 --- a/platform/linux-generic/odp_crypto.c +++ b/platform/linux-generic/odp_crypto.c @@ -428,6 +428,19 @@ odp_crypto_init_global(void) return 0; } +int odp_crypto_term_global(void) +{ + odp_shm_t shm; + int ret = 0; + + shm = odp_shm_lookup("crypto_pool"); + if (shm == ODP_SHM_INVALID) + return -1; + ret = odp_shm_free(shm); + + return ret; +} + int odp_hw_random_get(uint8_t *buf, size_t *len, bool use_entropy ODP_UNUSED) { diff --git a/platform/linux-generic/odp_init.c b/platform/linux-generic/odp_init.c index 88a2578..d4a475f 100644 --- a/platform/linux-generic/odp_init.c +++ b/platform/linux-generic/odp_init.c @@ -77,6 +77,11 @@ int odp_term_global(void) return -1; } + if (odp_crypto_term_global()) { + ODP_ERR("ODP crypto term failed.\n"); + return -1; + } + return 0; }