From patchwork Thu Oct 13 00:44:35 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Fischofer X-Patchwork-Id: 77594 Delivered-To: patch@linaro.org Received: by 10.140.97.247 with SMTP id m110csp681884qge; Wed, 12 Oct 2016 17:45:00 -0700 (PDT) X-Received: by 10.55.27.32 with SMTP id b32mr3738912qkb.211.1476319500732; Wed, 12 Oct 2016 17:45:00 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id c23si5119315qkj.139.2016.10.12.17.44.46; Wed, 12 Oct 2016 17:45:00 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=pass (p=NONE dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 7F9ED61735; Thu, 13 Oct 2016 00:44:46 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 881B760D8A; Thu, 13 Oct 2016 00:44:42 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id A095D60D8A; Thu, 13 Oct 2016 00:44:40 +0000 (UTC) Received: from mail-oi0-f41.google.com (mail-oi0-f41.google.com [209.85.218.41]) by lists.linaro.org (Postfix) with ESMTPS id 663F260D8A for ; Thu, 13 Oct 2016 00:44:39 +0000 (UTC) Received: by mail-oi0-f41.google.com with SMTP id d132so80567164oib.2 for ; Wed, 12 Oct 2016 17:44:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=B4NjwcMCTSfsW0S6tt1i7g4Pq8YFcE/VTppFVyJ447s=; b=YqnC238fw7Y3xzfWmAMwQ8ZmEdcsJjiQwDVFRY/vIFabEzbpsCHzN8CFwcIvqfwKmm qh+5zvayi5woMNwYpESPpA9Ow3kki/QwBbTooaTaTMlz9QGWBvrb17jAMqDd7fJWRtT5 SqjltvJDFa2ic8QzLHMojZG+d4qKMN7V7tpXky63xOxIkgbXVpObmVs4joP6m47ty29s J3+Z3THevxUoUYPNLDAIF1TWpgcYAWE3fqO+1sF8RWscwTPwLi5/jULq+YcAwBfmr2jf Kr277uPaDWELcbWCPGtA5/JlYkw0LVPLLUhGygfTcX0tQHpXLpUDICulDp8AnqnGNYKE Dktg== X-Gm-Message-State: AA6/9RnvjwE61Sl9TKOXqJ+p8a9of0pMBll9TBpBwuatOjE6hicC7z5g3hcXOnC0+t9YQe3p+zE= X-Received: by 10.202.182.9 with SMTP id g9mr2479956oif.27.1476319478810; Wed, 12 Oct 2016 17:44:38 -0700 (PDT) Received: from localhost.localdomain (cpe-70-121-83-241.austin.res.rr.com. [70.121.83.241]) by smtp.gmail.com with ESMTPSA id i18sm3742525oib.12.2016.10.12.17.44.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 12 Oct 2016 17:44:37 -0700 (PDT) From: Bill Fischofer To: lng-odp@lists.linaro.org Date: Wed, 12 Oct 2016 19:44:35 -0500 Message-Id: <1476319476-18500-1-git-send-email-bill.fischofer@linaro.org> X-Mailer: git-send-email 2.7.4 X-Topics: patch Subject: [lng-odp] [API-NEXT PATCHv2 1/2] api: dev: add device apis for numa support X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" Add the odp_dev_id() API used for NUMA support Signed-off-by: Bill Fischofer --- include/odp/api/spec/dev.h | 89 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 include/odp/api/spec/dev.h -- 2.7.4 diff --git a/include/odp/api/spec/dev.h b/include/odp/api/spec/dev.h new file mode 100644 index 0000000..1f7ed8b --- /dev/null +++ b/include/odp/api/spec/dev.h @@ -0,0 +1,89 @@ +/* Copyright (c) 2016, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +/** + * @file + * + * ODP device + */ + +#ifndef ODP_API_DEV_H_ +#define ODP_API_DEV_H_ +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +/** @defgroup odp_dev ODP DEVICE + * Operations on devices + * @{ + */ + +/** + * @typedef odp_dev_t + * ODP Device + */ + +/** + * @def ODP_DEV_NAME_LEN + * Maximum device name length in chars + */ + +/** + * @def ODP_DEV_ANY + * Any device + */ + +/** + * @def ODP_DEV_INVALID + * Invalid device + */ + +/** + * Get Device ID by Name + * + * Get an implementation-defined device identifier from a device name. Device + * names are supplied as parameter info (command line, file, etc.) to the + * application. This routine translates this symbolic name into an internal + * identifier that can be used to define a device connection hierarchy for + * NUMA or other purposes. + * + * The reserved id ODP_DEV_ANY may be used as a "don't care" placeholder + * wherever a device id is required. + * + * @param name Name of the device + * + * @return Device ID + * @retval ODP_DEV_INVALID Device is unknown + */ +odp_dev_t odp_dev_id(const char *name); + +/** + * Get printable value for an odp_dev_t + * + * @param hdl odp_dev_t handle to be printed + * @return uint64_t value that can be used to print/display this + * handle + * + * @note This routine is intended to be used for diagnostic purposes + * to enable applications to generate a printable value that represents + * an odp_dev_t handle. + */ +uint64_t odp_dev_to_u64(odp_dev_t hdl); + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#include +#endif