From patchwork Mon Feb 23 17:15:39 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Holmes X-Patchwork-Id: 44902 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f199.google.com (mail-lb0-f199.google.com [209.85.217.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id A48B621562 for ; Mon, 23 Feb 2015 17:16:07 +0000 (UTC) Received: by lbiz11 with SMTP id z11sf13312796lbi.2 for ; Mon, 23 Feb 2015 09:16:06 -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: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=eNumVHfzoDrTWLhbLAzIGOwDYGjaCiN8koH6ZQi08ZE=; b=YaWp2W7fm42BLKSJ+MTRzdKPvEo0UuFIEx6zi2DX0XFRgfhsF+2oBulH6CRTaAmYdb 3x9a3g4PGjPDwjb+niTkzuKZCBd9i+V2Qw+7Q46UcyxkNr47dBWoAEytKJFKwfBX2Lm8 WBvNapJvb61E1cZ9yaYbVmH24XkWavUwcdD9t9M/QzVLMurBXy5hMiNTfQKsCxTeLxvY w/JFaAniFbTzldhKd/yljvbcdbFg4V6FDz0skeqm3Dgrck8/17v/YOdhnBSZVOdXq9da nEt5c4oKGbiXnFDyeYJizZpEG0GtIDO0+LqqntcQY723Zfd/KpCCQfeKq4DUq7bsgO3G sqFA== X-Gm-Message-State: ALoCoQmjtUZ8C2WYIeInTQxaaQUt8C5N0BLun0g/YjikVMGnYvbGMCgWGndaRkdbjOsMuIqGtyYZ X-Received: by 10.180.83.168 with SMTP id r8mr995759wiy.6.1424711766549; Mon, 23 Feb 2015 09:16:06 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.2.136 with SMTP id 8ls583187lau.1.gmail; Mon, 23 Feb 2015 09:16:06 -0800 (PST) X-Received: by 10.112.126.98 with SMTP id mx2mr10608006lbb.52.1424711766373; Mon, 23 Feb 2015 09:16:06 -0800 (PST) Received: from mail-la0-f48.google.com (mail-la0-f48.google.com. [209.85.215.48]) by mx.google.com with ESMTPS id a4si26456903lbg.132.2015.02.23.09.16.06 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 23 Feb 2015 09:16:06 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.48 as permitted sender) client-ip=209.85.215.48; Received: by labpn19 with SMTP id pn19so19896180lab.4 for ; Mon, 23 Feb 2015 09:16:06 -0800 (PST) X-Received: by 10.112.204.197 with SMTP id la5mr4895897lbc.29.1424711766222; Mon, 23 Feb 2015 09:16:06 -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 h5csp1397683lbj; Mon, 23 Feb 2015 09:16:05 -0800 (PST) X-Received: by 10.140.32.166 with SMTP id h35mr25868147qgh.31.1424711764883; Mon, 23 Feb 2015 09:16:04 -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 p32si36566999qgd.45.2015.02.23.09.16.03 (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 23 Feb 2015 09:16:04 -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 1YPwbv-0006GL-Vc; Mon, 23 Feb 2015 17:16:00 +0000 Received: from mail-qg0-f50.google.com ([209.85.192.50]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YPwbq-0006G6-LT for lng-odp@lists.linaro.org; Mon, 23 Feb 2015 17:15:54 +0000 Received: by mail-qg0-f50.google.com with SMTP id e89so25385735qgf.9 for ; Mon, 23 Feb 2015 09:15:49 -0800 (PST) X-Received: by 10.140.216.201 with SMTP id m192mr121908qhb.90.1424711749400; Mon, 23 Feb 2015 09:15: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 191sm17794401qht.13.2015.02.23.09.15.48 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 23 Feb 2015 09:15:48 -0800 (PST) From: Mike Holmes To: lng-odp@lists.linaro.org Date: Mon, 23 Feb 2015 12:15:39 -0500 Message-Id: <1424711740-21699-1-git-send-email-mike.holmes@linaro.org> X-Mailer: git-send-email 2.1.0 X-Topics: patch Subject: [lng-odp] [PATCH 1/2] api: errno: add api to public api 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.48 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 The errno API was not exposed in the public interface. Make errno API visible as part of the ODP API. Signed-off-by: Mike Holmes --- include/odp.h | 1 + include/odp/api/errno.h | 68 ++++++++++++++++++++++++++++++ platform/linux-generic/Makefile.am | 1 + platform/linux-generic/include/odp/errno.h | 41 ++---------------- 4 files changed, 73 insertions(+), 38 deletions(-) create mode 100644 include/odp/api/errno.h diff --git a/include/odp.h b/include/odp.h index 777b327..2bac510 100644 --- a/include/odp.h +++ b/include/odp.h @@ -52,6 +52,7 @@ extern "C" { #include #include #include +#include #ifdef __cplusplus } diff --git a/include/odp/api/errno.h b/include/odp/api/errno.h new file mode 100644 index 0000000..527214e --- /dev/null +++ b/include/odp/api/errno.h @@ -0,0 +1,68 @@ +/* Copyright (c) 2015, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +/** + * @file + * + * ODP errno API + */ + +#ifndef ODP_ERRNO_H_ +#define ODP_ERRNO_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +/** @addtogroup odp_ver_abt_log_dbg + * @{ + */ + +/** +* Return latest ODP errno +* +* @return ODP errno +* @retval 0 No error +*/ +int odp_errno(void); + +/** +* Set ODP errno to zero +*/ +void odp_errno_zero(void); + +/** +* Print ODP errno +* +* Interprets the value of ODP errno as an error message, and prints it, +* optionally preceding it with the custom message specified in str. +* +* @param str NULL, or pointer to the string to be appended +*/ +void odp_errno_print(const char *str); + +/** +* Error message string +* +* Interprets the value of ODP errno, generating a string with a +* message that describes the error. +* It uses the system definition of errno. +* +* @param errnum Error code +* +* @retval Pointer to the string +*/ +const char *odp_errno_str(int errnum); + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/platform/linux-generic/Makefile.am b/platform/linux-generic/Makefile.am index eac8fec..9aed113 100644 --- a/platform/linux-generic/Makefile.am +++ b/platform/linux-generic/Makefile.am @@ -78,6 +78,7 @@ odpapiinclude_HEADERS = \ $(top_srcdir)/include/odp/api/cpumask.h \ $(top_srcdir)/include/odp/api/crypto.h \ $(top_srcdir)/include/odp/api/debug.h \ + $(top_srcdir)/include/odp/api/errno.h \ $(top_srcdir)/include/odp/api/event.h \ $(top_srcdir)/include/odp/api/hints.h \ $(top_srcdir)/include/odp/api/init.h \ diff --git a/platform/linux-generic/include/odp/errno.h b/platform/linux-generic/include/odp/errno.h index 527214e..3e9e1fa 100644 --- a/platform/linux-generic/include/odp/errno.h +++ b/platform/linux-generic/include/odp/errno.h @@ -10,8 +10,8 @@ * ODP errno API */ -#ifndef ODP_ERRNO_H_ -#define ODP_ERRNO_H_ +#ifndef ODP_PLAT_ERRNO_H_ +#define ODP_PLAT_ERRNO_H_ #ifdef __cplusplus extern "C" { @@ -22,44 +22,9 @@ extern "C" { */ /** -* Return latest ODP errno -* -* @return ODP errno -* @retval 0 No error -*/ -int odp_errno(void); - -/** -* Set ODP errno to zero -*/ -void odp_errno_zero(void); - -/** -* Print ODP errno -* -* Interprets the value of ODP errno as an error message, and prints it, -* optionally preceding it with the custom message specified in str. -* -* @param str NULL, or pointer to the string to be appended -*/ -void odp_errno_print(const char *str); - -/** -* Error message string -* -* Interprets the value of ODP errno, generating a string with a -* message that describes the error. -* It uses the system definition of errno. -* -* @param errnum Error code -* -* @retval Pointer to the string -*/ -const char *odp_errno_str(int errnum); - -/** * @} */ +#include #ifdef __cplusplus }