From patchwork Mon Feb 16 19:55:12 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Holmes X-Patchwork-Id: 44727 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f200.google.com (mail-wi0-f200.google.com [209.85.212.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id EBBCA21544 for ; Mon, 16 Feb 2015 19:56:16 +0000 (UTC) Received: by mail-wi0-f200.google.com with SMTP id r20sf17061060wiv.3 for ; Mon, 16 Feb 2015 11:56:16 -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=rho16rGy49HTlrIRVNZmj7B0MlYbKUF0MRtkSZ9qy4Y=; b=lfBLtgKfYewPpxiNAPIW8H08orCOmcex6duzAeaxi3epFZ/ntjcRRQ92f9xv68K0NR WaateQjQleEv+YgBMQeScUK3X1oeYIRTSw0o8b5P80WmVaUOeKoOa/BlFwwG5bcz7ZV+ rmIKCrkaeXzgYgd1JxgS+0EXPWVx+yVjnlite+LSnemjO2sCU3OcXxQzEBbWrKYBLh6c uOJMTFsrDbayBiLDKh5AvPzu5INT3WH2WPkSm/kw4K60PdyeEDjPqq2Hr7CO2vwT+4H0 jJErCVAwEn+pmzTUFp7W5GRr/T8W5A8QitpdgWQevFFJuwdOyULMzN+VVHUdAmcz9Vxb rmHw== X-Gm-Message-State: ALoCoQnyDs21BoqzJQf6kCsjQYws6TFcusZAuXh8CudO2HvhSiebSKhN7g3QZAvdFF0jgIVm+gjo X-Received: by 10.194.161.194 with SMTP id xu2mr3157517wjb.1.1424116576051; Mon, 16 Feb 2015 11:56:16 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.153.7.75 with SMTP id da11ls549420lad.95.gmail; Mon, 16 Feb 2015 11:56:15 -0800 (PST) X-Received: by 10.152.116.43 with SMTP id jt11mr24690053lab.30.1424116575885; Mon, 16 Feb 2015 11:56:15 -0800 (PST) Received: from mail-la0-f42.google.com (mail-la0-f42.google.com. [209.85.215.42]) by mx.google.com with ESMTPS id pj4si7984915lbb.118.2015.02.16.11.56.15 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 16 Feb 2015 11:56:15 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.42 as permitted sender) client-ip=209.85.215.42; Received: by labgf13 with SMTP id gf13so31808111lab.9 for ; Mon, 16 Feb 2015 11:56:15 -0800 (PST) X-Received: by 10.152.5.167 with SMTP id t7mr25898533lat.32.1424116575684; Mon, 16 Feb 2015 11:56:15 -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 h5csp1787898lbj; Mon, 16 Feb 2015 11:56:14 -0800 (PST) X-Received: by 10.140.232.5 with SMTP id d5mr1163539qhc.78.1424116574133; Mon, 16 Feb 2015 11:56:14 -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 i204si7027570qhc.40.2015.02.16.11.56.11 (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 16 Feb 2015 11:56:14 -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 1YNRm5-0007Uz-56; Mon, 16 Feb 2015 19:56:09 +0000 Received: from mail-qg0-f47.google.com ([209.85.192.47]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YNRlq-0007R8-RN for lng-odp@lists.linaro.org; Mon, 16 Feb 2015 19:55:54 +0000 Received: by mail-qg0-f47.google.com with SMTP id q107so24885732qgd.6 for ; Mon, 16 Feb 2015 11:55:49 -0800 (PST) X-Received: by 10.140.236.211 with SMTP id h202mr805230qhc.88.1424116549713; Mon, 16 Feb 2015 11:55:49 -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.49 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 16 Feb 2015 11:55:49 -0800 (PST) From: Mike Holmes To: lng-odp@lists.linaro.org Date: Mon, 16 Feb 2015 14:55:12 -0500 Message-Id: <1424116520-20381-3-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: crypto patch Subject: [lng-odp] [PATCH v2 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.42 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 40c040f..430d2fb 100644 --- a/platform/linux-generic/include/odp_internal.h +++ b/platform/linux-generic/include/odp_internal.h @@ -49,6 +49,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 bc0f961..3572678 100644 --- a/platform/linux-generic/odp_crypto.c +++ b/platform/linux-generic/odp_crypto.c @@ -447,6 +447,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; +} + ssize_t odp_random_data(uint8_t *buf, ssize_t len, odp_bool_t use_entropy ODP_UNUSED) { diff --git a/platform/linux-generic/odp_init.c b/platform/linux-generic/odp_init.c index 91f4ee7..9c2f9e7 100644 --- a/platform/linux-generic/odp_init.c +++ b/platform/linux-generic/odp_init.c @@ -81,6 +81,11 @@ int odp_term_global(void) return -1; } + if (odp_crypto_term_global()) { + ODP_ERR("ODP crypto term failed.\n"); + return -1; + } + return 0; }