From patchwork Thu Jan 19 16:54:18 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Milard X-Patchwork-Id: 91964 Delivered-To: patch@linaro.org Received: by 10.182.3.34 with SMTP id 2csp332060obz; Thu, 19 Jan 2017 07:56:57 -0800 (PST) X-Received: by 10.36.159.3 with SMTP id c3mr30757673ite.50.1484841417780; Thu, 19 Jan 2017 07:56:57 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id i85si4660665ioo.159.2017.01.19.07.56.57; Thu, 19 Jan 2017 07:56:57 -0800 (PST) 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 sp=NONE dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 50E0A6064F; Thu, 19 Jan 2017 15:56:57 +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, URIBL_BLOCKED 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 EE9B962B88; Thu, 19 Jan 2017 15:55:15 +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 A36C46064D; Thu, 19 Jan 2017 15:55:04 +0000 (UTC) Received: from mail-lf0-f50.google.com (mail-lf0-f50.google.com [209.85.215.50]) by lists.linaro.org (Postfix) with ESMTPS id 5988E60649 for ; Thu, 19 Jan 2017 15:55:02 +0000 (UTC) Received: by mail-lf0-f50.google.com with SMTP id k86so39654252lfi.0 for ; Thu, 19 Jan 2017 07:55:02 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=p/ZdD2eu+Hn3CQhWBdf2YaYrnkYcx+fbqG77h7JpEcY=; b=EUvi2sLNwmga2/AbHqC76W9e8MuSEQ5yp6aF1Q8guevu8bfzgLQ+HmmpJHMQQ3I33h MAwGvlFrJRwQGGp63p2bTPLttbaXkWqCWIA0XpITJ0VfwPec8qVPEPlnwGRjSkOJIJgv ZIdzol/beMfvyunq2I+vM0vhkBjgyzjjQXgioh9fjXTvuyL2o+bEhF8KUW6VB1Jdv9np hC9XJt1UJWnJE1aWH4pMqKHn/fUf5zORPCgg01YrHNklFIfqlbA33VrRS1ktwDU3kFA6 DrB3ktea27rvDeCyBHTXXKuRvMMm9SkSeWfzW6gDysx5/cp0Y2jhWsQFSMWPuBe+863U JoHw== X-Gm-Message-State: AIkVDXKydUcwgPT9QDY05TeHX96lB7JT/R8TGTxQCMl6smM0gdPkMuSjaCLOk6VWKounizuXgQU= X-Received: by 10.25.20.152 with SMTP id 24mr2860810lfu.152.1484841301064; Thu, 19 Jan 2017 07:55:01 -0800 (PST) Received: from erachmi-ericsson.ki.sw.ericsson.se (c-83-233-76-66.cust.bredband2.com. [83.233.76.66]) by smtp.gmail.com with ESMTPSA id b7sm927770lfe.33.2017.01.19.07.54.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 19 Jan 2017 07:55:00 -0800 (PST) From: Christophe Milard To: mike.holmes@linaro.org, bill.fischofer@linaro.org, yi.he@linaro.org, forrest.shi@linaro.org, maxim.uvarov@linaro.com, lng-odp@lists.linaro.org Date: Thu, 19 Jan 2017 17:54:18 +0100 Message-Id: <1484844861-1302-3-git-send-email-christophe.milard@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1484844861-1302-1-git-send-email-christophe.milard@linaro.org> References: <1484844861-1302-1-git-send-email-christophe.milard@linaro.org> Subject: [lng-odp] [API-NEXT PATCHv10 2/5] linux-gen: adding enum, devio and driver registration interface (stub) 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" The linux implementation for the enumerator class registration function, enumerator instance registration function, devio and driver registration functions (stub) Signed-off-by: Christophe Milard --- include/odp_drv.h | 1 + platform/linux-generic/Makefile.am | 2 + platform/linux-generic/drv_driver.c | 64 ++++++++++++++++++++++ platform/linux-generic/include/odp/drv/driver.h | 37 +++++++++++++ .../include/odp/drv/plat/driver_types.h | 52 ++++++++++++++++++ 5 files changed, 156 insertions(+) create mode 100644 platform/linux-generic/drv_driver.c create mode 100644 platform/linux-generic/include/odp/drv/driver.h create mode 100644 platform/linux-generic/include/odp/drv/plat/driver_types.h -- 2.7.4 diff --git a/include/odp_drv.h b/include/odp_drv.h index 0959879..96d81ba 100644 --- a/include/odp_drv.h +++ b/include/odp_drv.h @@ -23,6 +23,7 @@ extern C { #include #include #include +#include #include #include #include diff --git a/platform/linux-generic/Makefile.am b/platform/linux-generic/Makefile.am index 74e606d..c752645 100644 --- a/platform/linux-generic/Makefile.am +++ b/platform/linux-generic/Makefile.am @@ -109,6 +109,7 @@ odpdrvinclude_HEADERS = \ $(srcdir)/include/odp/drv/barrier.h \ $(srcdir)/include/odp/drv/byteorder.h \ $(srcdir)/include/odp/drv/compiler.h \ + $(srcdir)/include/odp/drv/driver.h \ $(srcdir)/include/odp/drv/shm.h \ $(srcdir)/include/odp/drv/spinlock.h \ $(srcdir)/include/odp/drv/std_types.h \ @@ -233,6 +234,7 @@ __LIB__libodp_linux_la_SOURCES = \ odp_weak.c \ drv_atomic.c \ drv_barrier.c \ + drv_driver.c \ drv_shm.c \ drv_spinlock.c \ arch/@ARCH_DIR@/odp_cpu_arch.c \ diff --git a/platform/linux-generic/drv_driver.c b/platform/linux-generic/drv_driver.c new file mode 100644 index 0000000..529da48 --- /dev/null +++ b/platform/linux-generic/drv_driver.c @@ -0,0 +1,64 @@ +/* Copyright (c) 2017, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +#include + +#include +#include +#include +#include + +odpdrv_enumr_class_t odpdrv_enumr_class_register(odpdrv_enumr_class_param_t + *param) +{ + ODP_ERR("NOT Supported yet! Enumerator Class %s Registration!\n.", + param->name); + + return ODPDRV_ENUMR_CLASS_INVALID; +} + +odpdrv_enumr_t odpdrv_enumr_register(odpdrv_enumr_param_t *param) +{ + ODP_ERR("NOT Supported yet! Enumerator API %s Registration!\n.", + param->api_name); + + return ODPDRV_ENUMR_INVALID; +} + +odpdrv_device_t odpdrv_device_create(odpdrv_device_param_t *param) +{ + ODP_ERR("odpdrv_device_create not Supported yet! devaddress: %s\n.", + param->address); + return ODPDRV_DEVICE_INVALID; +} + +void odpdrv_device_destroy(odpdrv_device_t dev) +{ + if (dev == ODPDRV_DEVICE_INVALID) + ODP_ERR("Invalid device\n"); +} + +odpdrv_devio_t odpdrv_devio_register(odpdrv_devio_param_t *param) +{ + ODP_ERR("NOT Supported yet! Driver %s Registration!\n.", + param->api_name); + + return ODPDRV_DEVIO_INVALID; +} + +odpdrv_driver_t odpdrv_driver_register(odpdrv_driver_param_t *param) +{ + ODP_ERR("NOT Supported yet! Driver %s Registration!\n.", + param->name); + + return ODPDRV_DRIVER_INVALID; +} + +int odpdrv_print_all(void) +{ + ODP_ERR("odpdrv_print_all not Supported yet!\n."); + return 0; +} diff --git a/platform/linux-generic/include/odp/drv/driver.h b/platform/linux-generic/include/odp/drv/driver.h new file mode 100644 index 0000000..b12c83d --- /dev/null +++ b/platform/linux-generic/include/odp/drv/driver.h @@ -0,0 +1,37 @@ +/* Copyright (c) 2017, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +/** + * @file + * + * ODPDRV drivers + */ + +#ifndef ODPDRV_PLAT_DRIVER_H_ +#define ODPDRV_PLAT_DRIVER_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +/** @ingroup odpdrv_driver + * @{ + */ + +/** + * @} + */ + +#include +#include + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/platform/linux-generic/include/odp/drv/plat/driver_types.h b/platform/linux-generic/include/odp/drv/plat/driver_types.h new file mode 100644 index 0000000..6c611bd --- /dev/null +++ b/platform/linux-generic/include/odp/drv/plat/driver_types.h @@ -0,0 +1,52 @@ +/* Copyright (c) 2017, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +/** + * @file + * + * ODP shared memory + */ + +#ifndef ODPDRV_DRIVER_TYPES_H_ +#define ODPDRV_DRIVER_TYPES_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include + +/** @addtogroup odpdrv_driver ODPDRV DRIVER + * Operations on driver related items (enumerator class, enumerators, + * devios and drivers). + * @{ + */ + +typedef ODPDRV_HANDLE_T(odpdrv_enumr_class_t); +#define ODPDRV_ENUMR_CLASS_INVALID _odpdrv_cast_scalar(odpdrv_enumr_class_t, 0) + +typedef ODPDRV_HANDLE_T(odpdrv_enumr_t); +#define ODPDRV_ENUMR_INVALID _odpdrv_cast_scalar(odpdrv_enumr_t, 0) + +typedef ODPDRV_HANDLE_T(odpdrv_device_t); +#define ODPDRV_DEVICE_INVALID _odpdrv_cast_scalar(odpdrv_device_t, 0) + +typedef ODPDRV_HANDLE_T(odpdrv_devio_t); +#define ODPDRV_DEVIO_INVALID _odpdrv_cast_scalar(odpdrv_devio_t, 0) + +typedef ODPDRV_HANDLE_T(odpdrv_driver_t); +#define ODPDRV_DRIVER_INVALID _odpdrv_cast_scalar(odpdrv_driver_t, 0) + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif