Imported Upstream version 17.05
[deb_dpdk.git] / drivers / event / skeleton / skeleton_eventdev.h
@@ -1,7 +1,7 @@
 /*
  *   BSD LICENSE
  *
- *   Copyright (C) EZchip Semiconductor Ltd. 2015.
+ *   Copyright (C) Cavium networks Ltd. 2016.
  *
  *   Redistribution and use in source and binary forms, with or without
  *   modification, are permitted provided that the following conditions
@@ -13,7 +13,7 @@
  *       notice, this list of conditions and the following disclaimer in
  *       the documentation and/or other materials provided with the
  *       distribution.
- *     * Neither the name of EZchip Semiconductor nor the names of its
+ *     * Neither the name of Cavium networks nor the names of its
  *       contributors may be used to endorse or promote products derived
  *       from this software without specific prior written permission.
  *
  *   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  *   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
+ */
+
+#ifndef __SKELETON_EVENTDEV_H__
+#define __SKELETON_EVENTDEV_H__
 
-#ifndef _RTE_CYCLES_TILE_H_
-#define _RTE_CYCLES_TILE_H_
+#include <rte_eventdev_pmd.h>
 
-#ifdef __cplusplus
-extern "C" {
+#ifdef RTE_LIBRTE_PMD_SKELETON_EVENTDEV_DEBUG
+#define PMD_DRV_LOG(level, fmt, args...) \
+       RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args)
+#define PMD_DRV_FUNC_TRACE() PMD_DRV_LOG(DEBUG, ">>")
+#else
+#define PMD_DRV_LOG(level, fmt, args...) do { } while (0)
+#define PMD_DRV_FUNC_TRACE() do { } while (0)
 #endif
 
-#include <arch/cycle.h>
+#define PMD_DRV_ERR(fmt, args...) \
+       RTE_LOG(ERR, PMD, "%s(): " fmt "\n", __func__, ## args)
 
-#include "generic/rte_cycles.h"
+struct skeleton_eventdev {
+       uintptr_t reg_base;
+       uint16_t device_id;
+       uint16_t vendor_id;
+       uint16_t subsystem_device_id;
+       uint16_t subsystem_vendor_id;
+} __rte_cache_aligned;
 
-/**
- * Read the time base register.
- *
- * @return
- *   The time base for this lcore.
- */
-static inline uint64_t
-rte_rdtsc(void)
-{
-       return get_cycle_count();
-}
+struct skeleton_port {
+       uint8_t port_id;
+} __rte_cache_aligned;
 
-static inline uint64_t
-rte_rdtsc_precise(void)
+static inline struct skeleton_eventdev *
+skeleton_pmd_priv(const struct rte_eventdev *eventdev)
 {
-       rte_mb();
-       return rte_rdtsc();
+       return eventdev->data->dev_private;
 }
 
-static inline uint64_t
-rte_get_tsc_cycles(void) { return rte_rdtsc(); }
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _RTE_CYCLES_TILE_H_ */
+#endif /* __SKELETON_EVENTDEV_H__ */