similarity index 100%
rename from include/odp/drv/spec/README
rename to frameworks/driver/README
similarity index 99%
rename from platform/linux-generic/drv_driver.c
rename to frameworks/driver/driver.c
@@ -7,18 +7,17 @@
#include <config.h>
#include <string.h>
+#include <inttypes.h>
#include <odp_config_internal.h>
#include <_ishmpool_internal.h>
+#include <driver.h>
#include <odp/api/std_types.h>
#include <odp/api/debug.h>
#include <odp/api/rwlock_recursive.h>
#include <odp/api/ticketlock.h>
-#include <odp/drv/driver.h>
-#include <odp/drv/spec/driver.h>
#include <odp_debug_internal.h>
-#include <drv_driver_internal.h>
static enum {UNDONE, IN_PROGRESS, DONE} init_global_status;
similarity index 99%
rename from include/odp/drv/spec/driver.h
rename to frameworks/driver/include/driver.h
@@ -14,6 +14,9 @@
#define ODPDRV_DRIVER_H_
#include <odp/visibility_begin.h>
+#include "driver_types.h"
+#include "driver_internal.h"
+
#ifdef __cplusplus
extern "C" {
#endif
similarity index 100%
rename from platform/linux-generic/include/drv_driver_internal.h
rename to frameworks/driver/include/driver_internal.h
new file mode 100644
@@ -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 <odp/api/std_types.h>
+#include <odp/api/plat/strong_types.h>
+
+/** @addtogroup odpdrv_driver ODPDRV DRIVER
+ * Operations on driver related items (enumerator class, enumerators,
+ * devios and drivers).
+ * @{
+ */
+
+typedef ODP_HANDLE_T(odpdrv_enumr_class_t);
+#define ODPDRV_ENUMR_CLASS_INVALID _odp_cast_scalar(odpdrv_enumr_class_t, 0)
+
+typedef ODP_HANDLE_T(odpdrv_enumr_t);
+#define ODPDRV_ENUMR_INVALID _odp_cast_scalar(odpdrv_enumr_t, 0)
+
+typedef ODP_HANDLE_T(odpdrv_device_t);
+#define ODPDRV_DEVICE_INVALID _odp_cast_scalar(odpdrv_device_t, 0)
+
+typedef ODP_HANDLE_T(odpdrv_devio_t);
+#define ODPDRV_DEVIO_INVALID _odp_cast_scalar(odpdrv_devio_t, 0)
+
+typedef ODP_HANDLE_T(odpdrv_driver_t);
+#define ODPDRV_DRIVER_INVALID _odp_cast_scalar(odpdrv_driver_t, 0)
+
+/**
+ * @}
+ */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
similarity index 99%
rename from platform/linux-generic/include/drv_pci_internal.h
rename to frameworks/driver/include/pci_internal.h
@@ -7,6 +7,8 @@
#ifndef DRV_PCI_INTERNAL_H_
#define DRV_PCI_INTERNAL_H_
+#include <inttypes.h>
+
#ifdef __cplusplus
extern "C" {
#endif
similarity index 99%
rename from platform/linux-generic/drv_pci.c
rename to frameworks/driver/pci.c
@@ -44,7 +44,7 @@
#include <odp_debug_internal.h>
#include <odp_align_internal.h>
-#include <drv_pci_internal.h>
+#include <pci_internal.h>
#define MAX_PCI_DEVICES 16
similarity index 99%
rename from platform/linux-generic/drv_pci_uio.c
rename to frameworks/driver/pci_uio.c
@@ -47,10 +47,9 @@
#include <odp_posix_extensions.h>
#include <odp_config_internal.h>
#include <odp_internal.h>
-#include <odp/drv/shm.h>
#include <odp_debug_internal.h>
-#include <drv_pci_internal.h>
+#include <pci_internal.h>
typedef struct user_access_context_t {
int uio_num; /**< device number assigned by UIO: /dev/uioX */
@@ -1,7 +1,6 @@
include_HEADERS = \
odp.h \
- odp_api.h \
- odp_drv.h
+ odp_api.h
odpapispecincludedir= $(includedir)/odp/api/spec
odpapispecinclude_HEADERS = \
@@ -54,20 +53,6 @@ nodist_odpapispecinclude_HEADERS = \
odp/api/spec/deprecated.h \
odp/api/spec/version.h
-odpdrvspecincludedir= $(includedir)/odp/drv/spec
-odpdrvspecinclude_HEADERS = \
- odp/drv/spec/align.h \
- odp/drv/spec/atomic.h \
- odp/drv/spec/barrier.h \
- odp/drv/spec/byteorder.h \
- odp/drv/spec/compiler.h \
- odp/drv/spec/driver.h \
- odp/drv/spec/hints.h \
- odp/drv/spec/shm.h \
- odp/drv/spec/spinlock.h \
- odp/drv/spec/std_types.h \
- odp/drv/spec/sync.h
-
odpapiabidefaultincludedir= $(includedir)/odp/arch/default/api/abi
odpapiabidefaultinclude_HEADERS = \
odp/arch/default/api/abi/buffer.h \
deleted file mode 100644
@@ -1,78 +0,0 @@
-/* Copyright (c) 2016, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-/**
- * @file
- *
- * ODPDRV alignments
- */
-
-#ifndef ODPDRV_API_ALIGN_H_
-#define ODPDRV_API_ALIGN_H_
-#include <odp/visibility_begin.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/** @addtogroup odpdrv_compiler_optim
- * Macros that allow cache line size configuration, check that
- * alignment is a power of two etc.
- * @{
- */
-
-/* Checkpatch complains, but cannot use __aligned(size) for this purpose. */
-
-/**
- * @def ODPDRV_ALIGNED
- * Defines type/struct/variable alignment in bytes
- */
-
-/**
- * @def ODPDRV_PACKED
- * Defines type/struct to be packed
- */
-
-/**
- * @def ODPDRV_OFFSETOF
- * Returns offset of member in type
- */
-
-/**
- * @def ODPDRV_FIELD_SIZEOF
- * Returns sizeof member
- */
-
-/**
- * @def ODPDRV_CACHE_LINE_SIZE
- * Cache line size
- */
-
-/**
- * @def ODPDRV_PAGE_SIZE
- * Page size
- */
-
-/**
- * @def ODPDRV_ALIGNED_CACHE
- * Defines type/struct/variable to be cache line size aligned
- */
-
-/**
- * @def ODPDRV_ALIGNED_PAGE
- * Defines type/struct/variable to be page size aligned
- */
-
-/**
- * @}
- */
-
-#ifdef __cplusplus
-}
-#endif
-
-#include <odp/visibility_end.h>
-#endif
deleted file mode 100644
@@ -1,634 +0,0 @@
-/* Copyright (c) 2016, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-/**
- * @file
- *
- * ODPDRV atomic operations
- */
-
-#ifndef ODPDRV_API_ATOMIC_H_
-#define ODPDRV_API_ATOMIC_H_
-#include <odp/visibility_begin.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * @defgroup odpdrv_atomic ODPDRV ATOMIC
- * @details
- * <b> Atomic integers using relaxed memory ordering </b>
- *
- * Atomic integer types (odpdrv_atomic_u32_t and odpdrv_atomic_u64_t) can be
- * used to implement e.g. shared counters. If not otherwise documented,
- * operations in this API are implemented using <b> RELAXED memory ordering </b>
- * (see memory order descriptions in the C11 specification). Relaxed operations
- * do not provide synchronization or ordering for other memory accesses
- * (initiated before or after the operation), only atomicity of the operation
- * itself is guaranteed.
- *
- * <b> Operations with non-relaxed memory ordering </b>
- *
- * <b> An operation with RELEASE </b> memory ordering
- * (odpdrv_atomic_xxx_rel_xxx()) ensures that other threads loading the same
- * atomic variable with ACQUIRE memory ordering see all stores (from the
- * calling thread) that happened before this releasing store.
- *
- * <b> An operation with ACQUIRE </b> memory ordering
- * (odpdrv_atomic_xxx_acq_xxx()) ensures that the calling thread sees all stores
- * (done by the releasing thread) that happened before a RELEASE memory ordered
- * store to the same atomic variable.
- *
- * <b> An operation with ACQUIRE-and-RELEASE </b> memory ordering
- * (odpdrv_atomic_xxx_acq_rel_xxx()) combines the effects of ACQUIRE and RELEASE
- * memory orders. A single operation acts as both an acquiring load and
- * a releasing store.
- *
- * @{
- */
-
-/**
- * @typedef odpdrv_atomic_u64_t
- * Atomic 64-bit unsigned integer
- *
- * @typedef odpdrv_atomic_u32_t
- * Atomic 32-bit unsigned integer
- */
-
-/*
- * 32-bit operations in RELAXED memory ordering
- * --------------------------------------------
- */
-
-/**
- * Initialize atomic uint32 variable
- *
- * Initializes the atomic variable with 'val'. This operation is not atomic.
- * Drivers must ensure that there's no race condition while initializing
- * the variable.
- *
- * @param atom Pointer to atomic variable
- * @param val Value to initialize the variable with
- */
-void odpdrv_atomic_init_u32(odpdrv_atomic_u32_t *atom, uint32_t val);
-
-/**
- * Load value of atomic uint32 variable
- *
- * @param atom Pointer to atomic variable
- *
- * @return Value of the variable
- */
-uint32_t odpdrv_atomic_load_u32(odpdrv_atomic_u32_t *atom);
-
-/**
- * Store value to atomic uint32 variable
- *
- * @param atom Pointer to atomic variable
- * @param val Value to store in the variable
- */
-void odpdrv_atomic_store_u32(odpdrv_atomic_u32_t *atom, uint32_t val);
-
-/**
- * Fetch and add to atomic uint32 variable
- *
- * @param atom Pointer to atomic variable
- * @param val Value to be added to the variable
- *
- * @return Value of the variable before the addition
- */
-uint32_t odpdrv_atomic_fetch_add_u32(odpdrv_atomic_u32_t *atom, uint32_t val);
-
-/**
- * Add to atomic uint32 variable
- *
- * @param atom Pointer to atomic variable
- * @param val Value to be added to the variable
- */
-void odpdrv_atomic_add_u32(odpdrv_atomic_u32_t *atom, uint32_t val);
-
-/**
- * Fetch and subtract from atomic uint32 variable
- *
- * @param atom Pointer to atomic variable
- * @param val Value to be subracted from the variable
- *
- * @return Value of the variable before the subtraction
- */
-uint32_t odpdrv_atomic_fetch_sub_u32(odpdrv_atomic_u32_t *atom, uint32_t val);
-
-/**
- * Subtract from atomic uint32 variable
- *
- * @param atom Pointer to atomic variable
- * @param val Value to be subtracted from the variable
- */
-void odpdrv_atomic_sub_u32(odpdrv_atomic_u32_t *atom, uint32_t val);
-
-/**
- * Fetch and increment atomic uint32 variable
- *
- * @param atom Pointer to atomic variable
- *
- * @return Value of the variable before the increment
- */
-uint32_t odpdrv_atomic_fetch_inc_u32(odpdrv_atomic_u32_t *atom);
-
-/**
- * Increment atomic uint32 variable
- *
- * @param atom Pointer to atomic variable
- */
-void odpdrv_atomic_inc_u32(odpdrv_atomic_u32_t *atom);
-
-/**
- * Fetch and decrement atomic uint32 variable
- *
- * @param atom Pointer to atomic variable
- *
- * @return Value of the variable before the subtraction
- */
-uint32_t odpdrv_atomic_fetch_dec_u32(odpdrv_atomic_u32_t *atom);
-
-/**
- * Decrement atomic uint32 variable
- *
- * @param atom Pointer to atomic variable
- */
-void odpdrv_atomic_dec_u32(odpdrv_atomic_u32_t *atom);
-
-/**
- * Update maximum value of atomic uint32 variable
- *
- * Compares value of atomic variable to the new maximum value. If the new value
- * is greater than the current value, writes the new value into the variable.
- *
- * @param atom Pointer to atomic variable
- * @param new_max New maximum value to be written into the atomic variable
- */
-void odpdrv_atomic_max_u32(odpdrv_atomic_u32_t *atom, uint32_t new_max);
-
-/**
- * Update minimum value of atomic uint32 variable
- *
- * Compares value of atomic variable to the new minimum value. If the new value
- * is less than the current value, writes the new value into the variable.
- *
- * @param atom Pointer to atomic variable
- * @param new_min New minimum value to be written into the atomic variable
- */
-void odpdrv_atomic_min_u32(odpdrv_atomic_u32_t *atom, uint32_t new_min);
-
-/**
- * Compare and swap atomic uint32 variable
- *
- * Compares value of atomic variable to the value pointed by 'old_val'.
- * If values are equal, the operation writes 'new_val' into the atomic variable
- * and returns success. If they are not equal, the operation writes current
- * value of atomic variable into 'old_val' and returns failure.
- *
- * @param atom Pointer to atomic variable
- * @param[in,out] old_val Pointer to the old value of the atomic variable.
- * Operation updates this value on failure.
- * @param new_val New value to be written into the atomic variable
- *
- * @return 0 on failure, !0 on success
- *
- */
-int odpdrv_atomic_cas_u32(odpdrv_atomic_u32_t *atom, uint32_t *old_val,
- uint32_t new_val);
-
-/**
- * Exchange value of atomic uint32 variable
- *
- * Atomically replaces the value of atomic variable with the new value. Returns
- * the old value.
- *
- * @param atom Pointer to atomic variable
- * @param new_val New value of the atomic variable
- *
- * @return Value of the variable before the operation
- */
-uint32_t odpdrv_atomic_xchg_u32(odpdrv_atomic_u32_t *atom, uint32_t new_val);
-
-/*
- * 64-bit operations in RELAXED memory ordering
- * --------------------------------------------
- */
-
-/**
- * Initialize atomic uint64 variable
- *
- * Initializes the atomic variable with 'val'. This operation is not atomic.
- * Drivers must ensure that there's no race condition while initializing
- * the variable.
- *
- * @param atom Pointer to atomic variable
- * @param val Value to initialize the variable with
- */
-void odpdrv_atomic_init_u64(odpdrv_atomic_u64_t *atom, uint64_t val);
-
-/**
- * Load value of atomic uint64 variable
- *
- * @param atom Pointer to atomic variable
- *
- * @return Value of the variable
- */
-uint64_t odpdrv_atomic_load_u64(odpdrv_atomic_u64_t *atom);
-
-/**
- * Store value to atomic uint64 variable
- *
- * @param atom Pointer to atomic variable
- * @param val Value to store in the variable
- */
-void odpdrv_atomic_store_u64(odpdrv_atomic_u64_t *atom, uint64_t val);
-
-/**
- * Fetch and add to atomic uint64 variable
- *
- * @param atom Pointer to atomic variable
- * @param val Value to be added to the variable
- *
- * @return Value of the variable before the addition
- */
-uint64_t odpdrv_atomic_fetch_add_u64(odpdrv_atomic_u64_t *atom, uint64_t val);
-
-/**
- * Add to atomic uint64 variable
- *
- * @param atom Pointer to atomic variable
- * @param val Value to be added to the variable
- */
-void odpdrv_atomic_add_u64(odpdrv_atomic_u64_t *atom, uint64_t val);
-
-/**
- * Fetch and subtract from atomic uint64 variable
- *
- * @param atom Pointer to atomic variable
- * @param val Value to be subtracted from the variable
- *
- * @return Value of the variable before the subtraction
- */
-uint64_t odpdrv_atomic_fetch_sub_u64(odpdrv_atomic_u64_t *atom, uint64_t val);
-
-/**
- * Subtract from atomic uint64 variable
- *
- * @param atom Pointer to atomic variable
- * @param val Value to be subtracted from the variable
- */
-void odpdrv_atomic_sub_u64(odpdrv_atomic_u64_t *atom, uint64_t val);
-
-/**
- * Fetch and increment atomic uint64 variable
- *
- * @param atom Pointer to atomic variable
- *
- * @return Value of the variable before the increment
- */
-uint64_t odpdrv_atomic_fetch_inc_u64(odpdrv_atomic_u64_t *atom);
-
-/**
- * Increment atomic uint64 variable
- *
- * @param atom Pointer to atomic variable
- */
-void odpdrv_atomic_inc_u64(odpdrv_atomic_u64_t *atom);
-
-/**
- * Fetch and decrement atomic uint64 variable
- *
- * @param atom Pointer to atomic variable
- *
- * @return Value of the variable before the decrement
- */
-uint64_t odpdrv_atomic_fetch_dec_u64(odpdrv_atomic_u64_t *atom);
-
-/**
- * Decrement atomic uint64 variable
- *
- * @param atom Pointer to atomic variable
- */
-void odpdrv_atomic_dec_u64(odpdrv_atomic_u64_t *atom);
-
-/**
- * Update maximum value of atomic uint64 variable
- *
- * Compares value of atomic variable to the new maximum value. If the new value
- * is greater than the current value, writes the new value into the variable.
- *
- * @param atom Pointer to atomic variable
- * @param new_max New maximum value to be written into the atomic variable
- */
-void odpdrv_atomic_max_u64(odpdrv_atomic_u64_t *atom, uint64_t new_max);
-
-/**
- * Update minimum value of atomic uint64 variable
- *
- * Compares value of atomic variable to the new minimum value. If the new value
- * is less than the current value, writes the new value into the variable.
- *
- * @param atom Pointer to atomic variable
- * @param new_min New minimum value to be written into the atomic variable
- */
-void odpdrv_atomic_min_u64(odpdrv_atomic_u64_t *atom, uint64_t new_min);
-
-/**
- * Compare and swap atomic uint64 variable
- *
- * Compares value of atomic variable to the value pointed by 'old_val'.
- * If values are equal, the operation writes 'new_val' into the atomic variable
- * and returns success. If they are not equal, the operation writes current
- * value of atomic variable into 'old_val' and returns failure.
- *
- * @param atom Pointer to atomic variable
- * @param[in,out] old_val Pointer to the old value of the atomic variable.
- * Operation updates this value on failure.
- * @param new_val New value to be written into the atomic variable
- *
- * @return 0 on failure, !0 on success
- */
-int odpdrv_atomic_cas_u64(odpdrv_atomic_u64_t *atom, uint64_t *old_val,
- uint64_t new_val);
-
-/**
- * Exchange value of atomic uint64 variable
- *
- * Atomically replaces the value of atomic variable with the new value. Returns
- * the old value.
- *
- * @param atom Pointer to atomic variable
- * @param new_val New value of the atomic variable
- *
- * @return Value of the variable before the operation
- */
-uint64_t odpdrv_atomic_xchg_u64(odpdrv_atomic_u64_t *atom, uint64_t new_val);
-
-/*
- * 32-bit operations in non-RELAXED memory ordering
- * ------------------------------------------------
- */
-
-/**
- * Load value of atomic uint32 variable using ACQUIRE memory ordering
- *
- * Otherwise identical to odpdrv_atomic_load_u32() but ensures ACQUIRE memory
- * ordering.
- *
- * @param atom Pointer to atomic variable
- *
- * @return Value of the variable
- */
-uint32_t odpdrv_atomic_load_acq_u32(odpdrv_atomic_u32_t *atom);
-
-/**
- * Store value to atomic uint32 variable using RELEASE memory ordering
- *
- * Otherwise identical to odpdrv_atomic_store_u32() but ensures RELEASE memory
- * ordering.
- *
- * @param atom Pointer to atomic variable
- * @param val Value to store in the variable
- */
-void odpdrv_atomic_store_rel_u32(odpdrv_atomic_u32_t *atom, uint32_t val);
-
-/**
- * Add to atomic uint32 variable using RELEASE memory ordering
- *
- * Otherwise identical to odpdrv_atomic_add_u32() but ensures RELEASE memory
- * ordering.
- *
- * @param atom Pointer to atomic variable
- * @param val Value to be added to the variable
- */
-void odpdrv_atomic_add_rel_u32(odpdrv_atomic_u32_t *atom, uint32_t val);
-
-/**
- * Subtract from atomic uint32 variable using RELEASE memory ordering
- *
- * Otherwise identical to odpdrv_atomic_sub_u32() but ensures RELEASE memory
- * ordering.
- *
- * @param atom Pointer to atomic variable
- * @param val Value to be subtracted from the variable
- */
-void odpdrv_atomic_sub_rel_u32(odpdrv_atomic_u32_t *atom, uint32_t val);
-
-/**
- * Compare and swap atomic uint32 variable using ACQUIRE memory ordering
- *
- * Otherwise identical to odpdrv_atomic_cas_u32() but ensures ACQUIRE memory
- * ordering on success. Memory ordering is RELAXED on failure.
- *
- * @param atom Pointer to atomic variable
- * @param[in,out] old_val Pointer to the old value of the atomic variable.
- * Operation updates this value on failure.
- * @param new_val New value to be written into the atomic variable
- *
- * @return 0 on failure, !0 on success
- */
-int odpdrv_atomic_cas_acq_u32(odpdrv_atomic_u32_t *atom, uint32_t *old_val,
- uint32_t new_val);
-
-/**
- * Compare and swap atomic uint32 variable using RELEASE memory ordering
- *
- * Otherwise identical to odpdrv_atomic_cas_u32() but ensures RELEASE memory
- * ordering on success. Memory ordering is RELAXED on failure.
- *
- * @param atom Pointer to atomic variable
- * @param[in,out] old_val Pointer to the old value of the atomic variable.
- * Operation updates this value on failure.
- * @param new_val New value to be written into the atomic variable
- *
- * @return 0 on failure, !0 on success
- */
-int odpdrv_atomic_cas_rel_u32(odpdrv_atomic_u32_t *atom, uint32_t *old_val,
- uint32_t new_val);
-
-/**
- * Compare and swap atomic uint32 variable using ACQUIRE-and-RELEASE memory
- * ordering
- *
- * Otherwise identical to odpdrv_atomic_cas_u32() but ensures
- * ACQUIRE-and-RELEASE memory ordering on success.
- * Memory ordering is RELAXED on failure.
- *
- * @param atom Pointer to atomic variable
- * @param[in,out] old_val Pointer to the old value of the atomic variable.
- * Operation updates this value on failure.
- * @param new_val New value to be written into the atomic variable
- *
- * @return 0 on failure, !0 on success
- */
-int odpdrv_atomic_cas_acq_rel_u32(odpdrv_atomic_u32_t *atom, uint32_t *old_val,
- uint32_t new_val);
-
-/*
- * 64-bit operations in non-RELAXED memory ordering
- * ------------------------------------------------
- */
-
-/**
- * Load value of atomic uint64 variable using ACQUIRE memory ordering
- *
- * Otherwise identical to odpdrv_atomic_load_u64() but ensures ACQUIRE memory
- * ordering.
- *
- * @param atom Pointer to atomic variable
- *
- * @return Value of the variable
- */
-uint64_t odpdrv_atomic_load_acq_u64(odpdrv_atomic_u64_t *atom);
-
-/**
- * Store value to atomic uint64 variable using RELEASE memory ordering
- *
- * Otherwise identical to odpdrv_atomic_store_u64() but ensures RELEASE memory
- * ordering.
- *
- * @param atom Pointer to atomic variable
- * @param val Value to store in the variable
- */
-void odpdrv_atomic_store_rel_u64(odpdrv_atomic_u64_t *atom, uint64_t val);
-
-/**
- * Add to atomic uint64 variable using RELEASE memory ordering
- *
- * Otherwise identical to odpdrv_atomic_add_u64() but ensures RELEASE memory
- * ordering.
- *
- * @param atom Pointer to atomic variable
- * @param val Value to be added to the variable
- */
-void odpdrv_atomic_add_rel_u64(odpdrv_atomic_u64_t *atom, uint64_t val);
-
-/**
- * Subtract from atomic uint64 variable using RELEASE memory ordering
- *
- * Otherwise identical to odpdrv_atomic_sub_u64() but ensures RELEASE memory
- * ordering.
- *
- * @param atom Pointer to atomic variable
- * @param val Value to be subtracted from the variable
- */
-void odpdrv_atomic_sub_rel_u64(odpdrv_atomic_u64_t *atom, uint64_t val);
-
-/**
- * Compare and swap atomic uint64 variable using ACQUIRE memory ordering
- *
- * Otherwise identical to odpdrv_atomic_cas_u64() but ensures ACQUIRE memory
- * ordering on success. Memory ordering is RELAXED on failure.
- *
- * @param atom Pointer to atomic variable
- * @param[in,out] old_val Pointer to the old value of the atomic variable.
- * Operation updates this value on failure.
- * @param new_val New value to be written into the atomic variable
- *
- * @return 0 on failure, !0 on success
- */
-int odpdrv_atomic_cas_acq_u64(odpdrv_atomic_u64_t *atom, uint64_t *old_val,
- uint64_t new_val);
-
-/**
- * Compare and swap atomic uint64 variable using RELEASE memory ordering
- *
- * Otherwise identical to odpdrv_atomic_cas_u64() but ensures RELEASE memory
- * ordering on success. Memory ordering is RELAXED on failure.
- *
- * @param atom Pointer to atomic variable
- * @param[in,out] old_val Pointer to the old value of the atomic variable.
- * Operation updates this value on failure.
- * @param new_val New value to be written into the atomic variable
- *
- * @return 0 on failure, !0 on success
- */
-int odpdrv_atomic_cas_rel_u64(odpdrv_atomic_u64_t *atom, uint64_t *old_val,
- uint64_t new_val);
-
-/**
- * Compare and swap atomic uint64 variable using ACQUIRE-and-RELEASE memory
- * ordering
- *
- * Otherwise identical to odpdrv_atomic_cas_u64() but ensures
- * ACQUIRE-and-RELEASE memory ordering on success. Memory ordering is RELAXED
- * on failure.
- *
- * @param atom Pointer to atomic variable
- * @param[in,out] old_val Pointer to the old value of the atomic variable.
- * Operation updates this value on failure.
- * @param new_val New value to be written into the atomic variable
- *
- * @return 0 on failure, !0 on success
- */
-int odpdrv_atomic_cas_acq_rel_u64(odpdrv_atomic_u64_t *atom, uint64_t *old_val,
- uint64_t new_val);
-
-/**
- * Atomic operations
- *
- * Atomic operations listed in a bit field structure.
- */
-typedef union odpdrv_atomic_op_t {
- /** Operation flags */
- struct {
- uint32_t init : 1; /**< Init atomic variable */
- uint32_t load : 1; /**< Atomic load */
- uint32_t store : 1; /**< Atomic store */
- uint32_t fetch_add : 1; /**< Atomic fetch and add */
- uint32_t add : 1; /**< Atomic add */
- uint32_t fetch_sub : 1; /**< Atomic fetch and subtract */
- uint32_t sub : 1; /**< Atomic subtract */
- uint32_t fetch_inc : 1; /**< Atomic fetch and increment */
- uint32_t inc : 1; /**< Atomic increment */
- uint32_t fetch_dec : 1; /**< Atomic fetch and decrement */
- uint32_t dec : 1; /**< Atomic decrement */
- uint32_t min : 1; /**< Atomic minimum */
- uint32_t max : 1; /**< Atomic maximum */
- uint32_t cas : 1; /**< Atomic compare and swap */
- uint32_t xchg : 1; /**< Atomic exchange */
- } op;
-
- /** All bits of the bit field structure.
- * Operation flag mapping is architecture specific. This field can be
- * used to set/clear all flags, or bitwise operations over the entire
- * structure. */
- uint32_t all_bits;
-} odpdrv_atomic_op_t;
-
-/**
- * Query which atomic uint64 operations are lock-free
- *
- * Lock-free implementations have higher performance and scale better than
- * implementations using locks. User can decide to use e.g. uint32 atomic
- * variables instead of uint64 to optimize performance on platforms that
- * implement a performance critical operation using locks.
- *
- * Init operations (e.g. odpdrv_atomic_init_64()) are not atomic. This function
- * clears the op.init bit but will never set it to one.
- *
- * @param atomic_op Pointer to atomic operation structure for storing
- * operation flags. All bits are initialized to zero during
- * the operation. The parameter is ignored when NULL.
- * @retval 0 None of the operations are lock-free
- * @retval 1 Some of the operations are lock-free
- * @retval 2 All operations are lock-free
- */
-int odpdrv_atomic_lock_free_u64(odpdrv_atomic_op_t *atomic_op);
-
-/**
- * @}
- */
-
-#ifdef __cplusplus
-}
-#endif
-
-#include <odp/visibility_end.h>
-#endif
deleted file mode 100644
@@ -1,66 +0,0 @@
-/* Copyright (c) 2016, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-/**
- * @file
- *
- * ODPDRV execution barriers
- */
-
-#ifndef ODPDRV_API_BARRIER_H_
-#define ODPDRV_API_BARRIER_H_
-#include <odp/visibility_begin.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * @defgroup odpdrv_barrier ODPDRV BARRIER
- * Thread execution and memory ordering barriers.
- *
- * @details
- * <b> Thread execution barrier (odpdrv_barrier_t) </b>
- *
- * Thread execution barrier synchronizes a group of threads to wait on the
- * barrier until the entire group has reached the barrier.
- * @{
- */
-
-/**
- * @typedef odpdrv_barrier_t
- * ODPDRV thread synchronization barrier
- */
-
-/**
- * Initialize barrier with thread count.
- *
- * @param barr Pointer to a barrier variable
- * @param count Thread count
- */
-void odpdrv_barrier_init(odpdrv_barrier_t *barr, int count);
-
-/**
- * Synchronize thread execution on barrier.
- * Wait for all threads to arrive at the barrier until they are let loose again.
- * Threads will block (spin) until the last thread has arrived at the barrier.
- * All memory operations before the odpdrv_barrier_wait() call will be visible
- * to all threads when they leave the barrier.
- *
- * @param barr Pointer to a barrier variable
- */
-void odpdrv_barrier_wait(odpdrv_barrier_t *barr);
-
-/**
- * @}
- */
-
-#ifdef __cplusplus
-}
-#endif
-
-#include <odp/visibility_end.h>
-#endif
deleted file mode 100644
@@ -1,181 +0,0 @@
-/* Copyright (c) 2016, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-/**
- * @file
- *
- * ODPDRV byteorder
- */
-
-#ifndef ODPDRV_BYTEORDER_H_
-#define ODPDRV_BYTEORDER_H_
-#include <odp/visibility_begin.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/** @addtogroup odpdrv_compiler_optim ODPDRV COMPILER / OPTIMIZATION
- * Macros that check byte order and operations for byte order conversion.
- * @{
- */
-
-/**
- * @def ODPDRV_BIG_ENDIAN
- * Big endian byte order
- *
- * @def ODPDRV_LITTLE_ENDIAN
- * Little endian byte order
- *
- * @def ODPDRV_BIG_ENDIAN_BITFIELD
- * Big endian bit field
- *
- * @def ODPDRV_LITTLE_ENDIAN_BITFIELD
- * Little endian bit field
- *
- * @def ODPDRV_BYTE_ORDER
- * Selected byte order
- *
- * @def ODPDRV_BITFIELD_ORDER
- * Selected bitfield order
- */
-
-/**
- * @typedef odpdrv_u16le_t
- * unsigned 16bit little endian
- *
- * @typedef odpdrv_u16be_t
- * unsigned 16bit big endian
- *
- * @typedef odpdrv_u32le_t
- * unsigned 32bit little endian
- *
- * @typedef odpdrv_u32be_t
- * unsigned 32bit big endian
- *
- * @typedef odpdrv_u64le_t
- * unsigned 64bit little endian
- *
- * @typedef odpdrv_u64be_t
- * unsigned 64bit big endian
- *
- * @typedef odpdrv_u16sum_t
- * unsigned 16bit bitwise
- *
- * @typedef odpdrv_u32sum_t
- * unsigned 32bit bitwise
- */
-
-/*
- * Big Endian -> CPU byte order:
- */
-
-/**
- * Convert 16bit big endian to cpu native uint16_t
- * @param be16 big endian 16bit
- * @return cpu native uint16_t
- */
-uint16_t odpdrv_be_to_cpu_16(odpdrv_u16be_t be16);
-
-/**
- * Convert 32bit big endian to cpu native uint32_t
- * @param be32 big endian 32bit
- * @return cpu native uint32_t
- */
-uint32_t odpdrv_be_to_cpu_32(odpdrv_u32be_t be32);
-
-/**
- * Convert 64bit big endian to cpu native uint64_t
- * @param be64 big endian 64bit
- * @return cpu native uint64_t
- */
-uint64_t odpdrv_be_to_cpu_64(odpdrv_u64be_t be64);
-
-/*
- * CPU byte order -> Big Endian:
- */
-
-/**
- * Convert cpu native uint16_t to 16bit big endian
- * @param cpu16 uint16_t in cpu native format
- * @return big endian 16bit
- */
-odpdrv_u16be_t odpdrv_cpu_to_be_16(uint16_t cpu16);
-
-/**
- * Convert cpu native uint32_t to 32bit big endian
- * @param cpu32 uint32_t in cpu native format
- * @return big endian 32bit
- */
-odpdrv_u32be_t odpdrv_cpu_to_be_32(uint32_t cpu32);
-
-/**
- * Convert cpu native uint64_t to 64bit big endian
- * @param cpu64 uint64_t in cpu native format
- * @return big endian 64bit
- */
-odpdrv_u64be_t odpdrv_cpu_to_be_64(uint64_t cpu64);
-
-/*
- * Little Endian -> CPU byte order:
- */
-
-/**
- * Convert 16bit little endian to cpu native uint16_t
- * @param le16 little endian 16bit
- * @return cpu native uint16_t
- */
-uint16_t odpdrv_le_to_cpu_16(odpdrv_u16le_t le16);
-
-/**
- * Convert 32bit little endian to cpu native uint32_t
- * @param le32 little endian 32bit
- * @return cpu native uint32_t
- */
-uint32_t odpdrv_le_to_cpu_32(odpdrv_u32le_t le32);
-
-/**
- * Convert 64bit little endian to cpu native uint64_t
- * @param le64 little endian 64bit
- * @return cpu native uint64_t
- */
-uint64_t odpdrv_le_to_cpu_64(odpdrv_u64le_t le64);
-
-/*
- * CPU byte order -> Little Endian:
- */
-
-/**
- * Convert cpu native uint16_t to 16bit little endian
- * @param cpu16 uint16_t in cpu native format
- * @return little endian 16bit
- */
-odpdrv_u16le_t odpdrv_cpu_to_le_16(uint16_t cpu16);
-
-/**
- * Convert cpu native uint32_t to 32bit little endian
- * @param cpu32 uint32_t in cpu native format
- * @return little endian 32bit
- */
-odpdrv_u32le_t odpdrv_cpu_to_le_32(uint32_t cpu32);
-
-/**
- * Convert cpu native uint64_t to 64bit little endian
- * @param cpu64 uint64_t in cpu native format
- * @return little endian 64bit
- */
-odpdrv_u64le_t odpdrv_cpu_to_le_64(uint64_t cpu64);
-
-/**
- * @}
- */
-
-#ifdef __cplusplus
-}
-#endif
-
-#include <odp/visibility_end.h>
-#endif
deleted file mode 100644
@@ -1,51 +0,0 @@
-/* Copyright (c) 2016, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-/**
- * @file
- *
- * Compiler related for ODP driver interface
- */
-
-#ifndef ODPDRV_COMPILER_H_
-#define ODPDRV_COMPILER_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/** @addtogroup odpdrv_compiler_optim ODPDRV COMPILER / OPTIMIZATION
- * Macro for old compilers
- * @{
- */
-
-/** @internal GNU compiler version */
-#define GCC_VERSION (__GNUC__ * 10000 \
- + __GNUC_MINOR__ * 100 \
- + __GNUC_PATCHLEVEL__)
-
-/**
- * @internal
- * Compiler __builtin_bswap16() is not available on all platforms
- * until GCC 4.8.0 - work around this by offering __odpdrv_builtin_bswap16()
- * Don't use this function directly, instead see odpdrv byteorder.h
- */
-#if GCC_VERSION < 40800
-#define __odpdrv_builtin_bswap16(u16) \
- ((((u16)&0x00ff) << 8) | (((u16)&0xff00) >> 8))
-#else
-#define __odpdrv_builtin_bswap16(u16) __builtin_bswap16(u16)
-#endif
-
-/**
- * @}
- */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
deleted file mode 100644
@@ -1,119 +0,0 @@
-/* Copyright (c) 2017, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-/**
- * @file
- *
- * ODPDRV compiler hints
- */
-
-#ifndef ODPDRV_API_HINTS_H_
-#define ODPDRV_API_HINTS_H_
-#include <odp/visibility_begin.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/** @addtogroup odpdrv_compiler_optim
- * Macros that will give hints to the compiler.
- * @{
- */
-
-#ifdef __GNUC__
-
-/** Define a function that should be run at early init (constructor)
- */
-#define ODPDRV_CONSTRUCTOR __attribute__((__constructor__))
-
-/** Define a function that does not return
- */
-#define ODPDRV_NORETURN __attribute__((__noreturn__))
-
-/** Define a weak symbol
- * This is primarily useful in defining library functions that can be
- * overridden in user code.
- */
-#define ODPDRV_WEAK_SYMBOL __attribute__((__weak__))
-
-/**
- * Hot code section
- */
-#define ODPDRV_HOT_CODE __attribute__((__hot__))
-
-/**
- * Cold code section
- */
-#define ODPDRV_COLD_CODE __attribute__((__cold__))
-
-/**
- * Printf format attribute
- */
-#define ODPDRV_PRINTF_FORMAT(x, y) __attribute__((format(printf, (x), (y))))
-
-/**
- * Indicate deprecated variables, functions or types
- */
-#define ODPDRV_DEPRECATED __attribute__((__deprecated__))
-
-/**
- * Intentionally unused variables of functions
- */
-#define ODPDRV_UNUSED __attribute__((__unused__))
-
-/**
- * Branch likely taken
- */
-#define odpdrv_likely(x) __builtin_expect((x), 1)
-
-/**
- * Branch unlikely taken
- */
-#define odpdrv_unlikely(x) __builtin_expect((x), 0)
-
-/*
- * __builtin_prefetch (const void *addr, rw, locality)
- *
- * rw 0..1 (0: read, 1: write)
- * locality 0..3 (0: don't leave to cache, 3: leave on all cache levels)
- */
-
-/**
- * Cache prefetch address
- */
-#define odpdrv_prefetch(x) __builtin_prefetch((x), 0, 3)
-
-/**
- * Cache prefetch address for storing
- */
-#define odpdrv_prefetch_store(x) __builtin_prefetch((x), 1, 3)
-
-#else
-
-#define ODPDRV_CONSTRUCTOR
-#define ODPDRV_NORETURN
-#define ODPDRV_WEAK_SYMBOL
-#define ODPDRV_HOT_CODE
-#define ODPDRV_COLD_CODE
-#define ODPDRV_DEPRECATED
-#define ODPDRV_UNUSED
-#define odpdrv_likely(x) (x)
-#define odpdrv_unlikely(x) (x)
-#define odpdrv_prefetch(x)
-#define odpdrv_prefetch_store(x)
-
-#endif
-
-/**
- * @}
- */
-
-#ifdef __cplusplus
-}
-#endif
-
-#include <odp/visibility_end.h>
-#endif
deleted file mode 100644
@@ -1,330 +0,0 @@
-/* Copyright (c) 2016, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-/**
- * @file
- *
- * ODPRDV shared memory (shm)
- */
-
-#ifndef ODPDRV_SHM_H_
-#define ODPDRV_SHM_H_
-#include <odp/visibility_begin.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/** @addtogroup odpdrv_shm ODPDRV SHARED MEMORY
- * Operations on driver shared memory.
- * @{
- */
-
-/**
- * @typedef odpdrv_shm_t
- * odpdrv shared memory block
- */
-
-/**
- * @def ODPDRV_SHM_INVALID
- * Invalid odpdrv shared memory block
- */
-
-/** Maximum shared memory block name length in chars */
-#define ODPDRV_SHM_NAME_LEN 32
-
-/*
- * Shared memory flags
- */
-#define ODPDRV_SHM_SINGLE_VA 0x01 /**< Memory shall be mapped at same VA */
-#define ODPDRV_SHM_LOCK 0x02 /**< Memory shall be locked (no swap) */
-
-/**
- * Shared memory block info
- */
-typedef struct odpdrv_shm_info_t {
- const char *name; /**< Block name */
- void *addr; /**< Block address */
- uint64_t size; /**< Block size in bytes */
- uint64_t page_size; /**< Memory page size */
- uint32_t flags; /**< ODPDRV_SHM_* flags */
-} odpdrv_shm_info_t;
-
-/**
- * Shared memory capabilities
- */
-typedef struct odpdrv_shm_capability_t {
- /** Maximum number of shared memory blocks
- *
- * This number of separate shared memory blocks can be
- * reserved concurrently. */
- unsigned max_blocks;
-
- /** Maximum memory block size in bytes
- *
- * The value of zero means that size is limited only by the available
- * memory size. */
- uint64_t max_size;
-
- /** Maximum memory block alignment in bytes
- *
- * The value of zero means that alignment is limited only by the
- * available memory size. */
- uint64_t max_align;
-
-} odpdrv_shm_capability_t;
-
-/**
- * Query shared memory capabilities
- *
- * Outputs shared memory capabilities on success.
- *
- * @param[out] capa Pointer to capability structure for output
- *
- * @retval 0 on success
- * @retval <0 on failure
- */
-int odpdrv_shm_capability(odpdrv_shm_capability_t *capa);
-
-/**
- * Reserve a contiguous block of shared memory
- *
- * @param[in] name Name of the block (maximum ODPDRV_SHM_NAME_LEN - 1 chars)
- * @param[in] size Block size in bytes
- * @param[in] align Block alignment in bytes
- * @param[in] flags Shared memory parameter flags (ODPDRV_SHM_*).
- * Default value is 0.
- *
- * @return Handle of the reserved block
- * @retval ODPDRV_SHM_INVALID on failure
- */
-odpdrv_shm_t odpdrv_shm_reserve(const char *name, uint64_t size, uint64_t align,
- uint32_t flags);
-
-/**
- * Free a contiguous block of shared memory
- *
- * Frees a previously reserved block of shared memory (found by its handle).
- * @note Freeing memory that is in use will result in UNDEFINED behavior
- *
- * @param[in] shm odpdrv_shm Block handle
- *
- * @retval 0 on success
- * @retval <0 on failure
- */
-int odpdrv_shm_free_by_handle(odpdrv_shm_t shm);
-
-/**
- * Free a contiguous block of shared memory (found from its name)
- *
- * Frees a previously reserved block of shared memory.
- * @note Freeing memory that is in use will result in UNDEFINED behavior
- *
- * @param[in] name odpdrv_shm Block name
- *
- * @retval 0 on success
- * @retval <0 on failure
- */
-int odpdrv_shm_free_by_name(const char *name);
-
-/**
- * Free a contiguous block of shared memory (found from its address)
- *
- * Frees a previously reserved block of shared memory.
- * @note Freeing memory that is in use will result in UNDEFINED behavior
- *
- * @param[in] address odpdrv_shm Block address
- *
- * @retval 0 on success
- * @retval <0 on failure
- */
-int odpdrv_shm_free_by_address(void *address);
-
-/**
- * Lookup and map a block of shared memory (identified by its handle)
- *
- * @param[in] shm odpdrv_shm Block handle
- *
- * @return The address of the newly mapped block.
- * @retval NULL on failure
- */
-void *odpdrv_shm_lookup_by_handle(odpdrv_shm_t shm);
-
-/**
- * Lookup and map a block of shared memory (identified by its name)
- *
- * @param[in] name odpdrv_shm Block name
- *
- * @return The handle of the newly mapped block.
- * @retval ODPDRV_SHM_INVALID on failure
- */
-odpdrv_shm_t odpdrv_shm_lookup_by_name(const char *name);
-
-/**
- * Lookup and map a block of shared memory (identified by its address)
- *
- * @note This only works when the flag ODPDRV_SHM_SINGLE_VA was set,
- * as otherwise addresses are odp-thread local and hence meaningless to
- * identify the block between odp-threads.
- *
- * @param[in] address odpdrv_shm Block address
- *
- * @return The handle of the newly mapped block.
- * @retval ODPDRV_SHM_INVALID on failure
- */
-odpdrv_shm_t odpdrv_shm_lookup_by_address(void *address);
-
-/**
- * Get a Shared memory block address
- *
- * @param[in] shm odpdrv_shm Block handle
- *
- * @return Memory block address
- * @retval NULL on failure
- */
-void *odpdrv_shm_addr(odpdrv_shm_t shm);
-
-/**
- * Shared memory block info
- *
- * @param[in] shm Odpdrv_shm block handle
- * @param[out] info Block info pointer for output
- *
- * @retval 0 on success
- * @retval <0 on failure
- */
-int odpdrv_shm_info(odpdrv_shm_t shm, odpdrv_shm_info_t *info);
-
-/**
- * Print all shared memory blocks and returns the number of allocated blocks.
- * This function is meant for debug.
- * @param title A string to be printed before the shared memory status
- * @return The total number of allocated blocks
- */
-int odpdrv_shm_print_all(const char *title);
-
-/**
- * Get printable value for an odpdrv_shm_t
- *
- * @param hdl odpdrv_shm_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 odpdrv_shm_t handle.
- */
-uint64_t odpdrv_shm_to_u64(odpdrv_shm_t hdl);
-
-/**
- * drv shm pool parameters
- * Used to communicate pool creation options.
- */
-typedef struct {
- /** Sum of all (simultaneous) allocs (bytes)*/
- uint64_t pool_size;
-
- /** Minimum alloc size user will request from pool (bytes)*/
- uint64_t min_alloc;
-
- /** Maximum alloc size user will request from pool (bytes)*/
- uint64_t max_alloc;
-} odpdrv_shm_pool_param_t;
-
-/**
- * @typedef odpdrv_shm_pool_t
- * odpdrv shared memory pool
- */
-
-/**
- * @def ODPDRV_SHM_POOL_INVALID
- * Invalid odpdrv shared memory pool
- */
-
-/**
- * Create a memory pool
- *
- * This routine is used to create a memory pool. The use of pool name is
- * optional.
- * Unique names are not required. However, odpdrv_shm_pool_lookup()
- * returns only a single matching pool.
- *
- * @param pool_name Name of the pool or NULL.
- * @param param Pool parameters.
- *
- * @return Handle of the created drv shm memory pool
- * @retval ODPDRV_SHM_POOL_INVALID Pool could not be created
- */
-odpdrv_shm_pool_t odpdrv_shm_pool_create(const char *pool_name,
- odpdrv_shm_pool_param_t *param);
-
-/**
- * Destroy a pool previously created by odpdrv_shm_pool_create()
- *
- * @param pool Handle of the pool to be destroyed
- *
- * @retval 0 Success
- * @retval <0 Failure
- *
- * @note This routine destroys a previously created pool, and will destroy any
- * internal shared memory objects associated with the pool. Results are
- * undefined if an attempt is made to destroy a pool that contains allocated
- * or otherwise active allocations.
- */
-int odpdrv_shm_pool_destroy(odpdrv_shm_pool_t pool);
-
-/**
- * Find a memory pool by name
- *
- * @param name Name of the pool
- *
- * @return Handle of the first matching pool
- * @retval ODPDRV_SHM_POOL_INVALID Pool could not be found
- */
-odpdrv_shm_pool_t odpdrv_shm_pool_lookup(const char *name);
-
-/**
- * Allocate memory from a memory pool
- *
- * @param pool Memory pool handle
- * @param size Number of bytes to allocate (bytes)
- *
- * @return A pointer to the allocated memory
- * @retval NULL on error.
- */
-void *odpdrv_shm_pool_alloc(odpdrv_shm_pool_t pool, uint64_t size);
-
-/**
- * Free memory back to a memory pool
- *
- * @param pool Memory pool handle
- * @param addr pointer to a previously allocated memory
- * (as returned by a previous call to odpdrv_shm_pool_alloc)
- */
-void odpdrv_shm_pool_free(odpdrv_shm_pool_t pool, void *addr);
-
-/**
- * Print memory pool info
- *
- * @param title A string to be printed as a title (e.g. location)
- * @param pool Memory pool handle
- *
- * @return 0 on success, negative value if pool inconsistency is detected.
- *
- * @note This routine writes implementation-defined information about the
- * specified pool to the ODP log. The intended use is for debugging.
- */
-int odpdrv_shm_pool_print(const char *title, odpdrv_shm_pool_t pool);
-/**
- * @}
- */
-
-#ifdef __cplusplus
-}
-#endif
-
-#include <odp/visibility_end.h>
-#endif
deleted file mode 100644
@@ -1,86 +0,0 @@
-/* Copyright (c) 2016, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-/**
- * @file
- *
- * ODPDRV spinlock
- */
-
-#ifndef ODPDRV_API_SPINLOCK_H_
-#define ODPDRV_API_SPINLOCK_H_
-#include <odp/visibility_begin.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * @addtogroup odpdrv_locks
- * @details
- * <b> Spin lock (odpdrv_spinlock_t) </b>
- *
- * Spinlock simply re-tries to acquire the lock as long as takes to succeed.
- * Spinlock is not fair since some threads may succeed more often than others.
- * @{
- */
-
-/**
- * @typedef odpdrv_spinlock_t
- * ODPDRV spinlock
- */
-
-/**
- * Initialize spin lock.
- *
- * @param splock Pointer to a spin lock
- */
-void odpdrv_spinlock_init(odpdrv_spinlock_t *splock);
-
-/**
- * Acquire spin lock.
- *
- * @param splock Pointer to a spin lock
- */
-void odpdrv_spinlock_lock(odpdrv_spinlock_t *splock);
-
-/**
- * Try to acquire spin lock.
- *
- * @param splock Pointer to a spin lock
- *
- * @retval 0 lock not acquired
- * @retval !0 lock acquired
- */
-int odpdrv_spinlock_trylock(odpdrv_spinlock_t *splock);
-
-/**
- * Release spin lock.
- *
- * @param splock Pointer to a spin lock
- */
-void odpdrv_spinlock_unlock(odpdrv_spinlock_t *splock);
-
-/**
- * Check if spin lock is busy (locked).
- *
- * @param splock Pointer to a spin lock
- *
- * @retval 1 lock busy (locked)
- * @retval 0 lock not busy.
- */
-int odpdrv_spinlock_is_locked(odpdrv_spinlock_t *splock);
-
-/**
- * @}
- */
-
-#ifdef __cplusplus
-}
-#endif
-
-#include <odp/visibility_end.h>
-#endif
deleted file mode 100644
@@ -1,40 +0,0 @@
-/* Copyright (c) 2016, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-/**
- * @file
- *
- * Standard C language types and definitions for ODP driver interface.
- *
- */
-
-#ifndef ODPDRV_STD_TYPES_H_
-#define ODPDRV_STD_TYPES_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/** @addtogroup odpdrv_system ODPDRV SYSTEM
- * @{
- */
-
-/**
- * @typedef odpdrv_bool_t
- * Use odpdrv boolean type to have it well-defined and known size,
- * regardless which compiler is used as this facilities interoperability
- * between e.g. different compilers.
- */
-
-/**
- * @}
- */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
deleted file mode 100644
@@ -1,91 +0,0 @@
-/* Copyright (c) 2016, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-/**
- * @file
- *
- * ODPDRV memory barriers
- */
-
-#ifndef ODPDRV_API_SYNC_H_
-#define ODPDRV_API_SYNC_H_
-#include <odp/visibility_begin.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * @addtogroup odpdrv_barrier
- * @details
- * <b> Memory barriers </b>
- *
- * Memory barriers enforce ordering of memory load and store operations
- * specified before and after the barrier. These barriers may affect both
- * compiler optimizations and CPU out-of-order execution. All ODPDRV
- * synchronization mechanisms (e.g. execution barriers, locks, queues, etc )
- * include all necessary memory barriers, so these calls are not needed when
- * using those. Also ODPDRV atomic operations have memory ordered versions.
- * These explicit barriers may be needed when thread synchronization is based on
- * a non-ODPDRV defined mechanism. Depending on the HW platform, heavy usage of
- * memory barriers may cause significant performance degradation.
- *
- * @{
- */
-
-/**
- * Memory barrier for release operations
- *
- * This memory barrier has release semantics. It synchronizes with a pairing
- * barrier for acquire operations. The releasing and acquiring threads
- * synchronize through shared memory. The releasing thread must call this
- * barrier before signaling the acquiring thread. After the acquiring thread
- * receives the signal, it must call odpdrv_mb_acquire() before it reads the
- * memory written by the releasing thread.
- *
- * This call is not needed when using ODPDRV defined synchronization mechanisms.
- *
- * @see odpdrv_mb_acquire()
- */
-void odpdrv_mb_release(void);
-
-/**
- * Memory barrier for acquire operations
- *
- * This memory barrier has acquire semantics. It synchronizes with a pairing
- * barrier for release operations. The releasing and acquiring threads
- * synchronize through shared memory. The releasing thread must call
- * odpdrv_mb_release() before signaling the acquiring thread. After the
- * acquiring thread receives the signal, it must call this barrier before it
- * read the memory written by the releasing thread.
- *
- * This call is not needed when using ODPDRV defined synchronization mechanisms.
- *
- * @see odpdrv_mb_release()
- */
-void odpdrv_mb_acquire(void);
-
-/**
- * Full memory barrier
- *
- * This is a full memory barrier. It guarantees that all load and store
- * operations specified before it are visible to other threads before
- * all load and store operations specified after it.
- *
- * This call is not needed when using ODPDRV defined synchronization mechanisms.
- */
-void odpdrv_mb_full(void);
-
-/**
- * @}
- */
-
-#ifdef __cplusplus
-}
-#endif
-
-#include <odp/visibility_end.h>
-#endif
deleted file mode 100644
@@ -1,36 +0,0 @@
-/* Copyright (c) 2016, Linaro Limited
- * All rights reserved
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-/**
- * @file
- *
- * The OpenDataPlane nic driver programming interface
- *
- */
-
-#ifndef ODP_DRV_H_
-#define ODP_DRV_H_
-
-#ifdef __cplusplus
-extern C {
-#endif
-
-#include <odp/drv/align.h>
-#include <odp/drv/atomic.h>
-#include <odp/drv/barrier.h>
-#include <odp/drv/byteorder.h>
-#include <odp/drv/compiler.h>
-#include <odp/drv/driver.h>
-#include <odp/drv/hints.h>
-#include <odp/drv/shm.h>
-#include <odp/drv/spinlock.h>
-#include <odp/drv/std_types.h>
-#include <odp/drv/sync.h>
-
-#ifdef __cplusplus
-}
-#endif
-#endif
@@ -23,6 +23,7 @@ AM_CPPFLAGS += -I$(top_srcdir)/platform/linux-generic/include
AM_CPPFLAGS += -I$(srcdir)/include
AM_CPPFLAGS += -I$(top_srcdir)/include
AM_CPPFLAGS += -I$(top_srcdir)/frameworks/modular
+AM_CPPFLAGS += -I$(top_srcdir)/frameworks/driver/include
AM_CPPFLAGS += -I$(top_srcdir)/include/odp/arch/@ARCH_ABI@
AM_CPPFLAGS += -I$(top_builddir)/include
AM_CPPFLAGS += -Iinclude
@@ -37,8 +38,7 @@ AM_CPPFLAGS += $(LIBCONFIG_CFLAGS)
include_HEADERS = \
$(top_srcdir)/include/odp.h \
- $(top_srcdir)/include/odp_api.h \
- $(top_srcdir)/include/odp_drv.h
+ $(top_srcdir)/include/odp_api.h
odpincludedir= $(includedir)/odp
odpinclude_HEADERS = \
@@ -148,39 +148,12 @@ odpapiplatinclude_HEADERS = \
$(srcdir)/include/odp/api/plat/traffic_mngr_types.h \
$(srcdir)/include/odp/api/plat/version_types.h
-odpdrvincludedir = $(includedir)/odp/drv
-odpdrvinclude_HEADERS = \
- $(srcdir)/include/odp/drv/align.h \
- $(srcdir)/include/odp/drv/atomic.h \
- $(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/hints.h \
- $(srcdir)/include/odp/drv/shm.h \
- $(srcdir)/include/odp/drv/spinlock.h \
- $(srcdir)/include/odp/drv/std_types.h \
- $(srcdir)/include/odp/drv/sync.h
-
-odpdrvplatincludedir = $(includedir)/odp/drv/plat
-odpdrvplatinclude_HEADERS = \
- $(srcdir)/include/odp/drv/plat/atomic_types.h \
- $(srcdir)/include/odp/drv/plat/barrier_types.h \
- $(srcdir)/include/odp/drv/plat/byteorder_types.h \
- $(srcdir)/include/odp/drv/compiler.h \
- $(srcdir)/include/odp/drv/plat/driver_types.h \
- $(srcdir)/include/odp/drv/plat/shm_types.h \
- $(srcdir)/include/odp/drv/plat/spinlock_types.h \
- $(srcdir)/include/odp/drv/plat/strong_types.h
-
-
noinst_HEADERS = \
${top_srcdir}/platform/linux-generic/include/odp_buffer_subsystem.h \
${top_srcdir}/platform/linux-generic/include/_fdserver_internal.h \
${top_srcdir}/platform/linux-generic/include/_ishm_internal.h \
${top_srcdir}/platform/linux-generic/include/_ishmphy_internal.h \
${top_srcdir}/platform/linux-generic/include/_ishmpool_internal.h \
- ${top_srcdir}/platform/linux-generic/include/drv_driver_internal.h\
${top_srcdir}/platform/linux-generic/include/odp_align_internal.h \
${top_srcdir}/platform/linux-generic/include/odp_atomic_internal.h \
${srcdir}/include/odp_buffer_inlines.h \
@@ -293,12 +266,7 @@ __LIB__libodp_dpdk_la_SOURCES = \
../linux-generic/odp_timer_wheel.c \
../linux-generic/odp_traffic_mngr.c \
../linux-generic/odp_version.c \
- ../linux-generic/odp_weak.c \
- ../linux-generic/drv_atomic.c \
- ../linux-generic/drv_barrier.c \
- ../linux-generic/drv_driver.c \
- ../linux-generic/drv_shm.c \
- ../linux-generic/drv_spinlock.c
+ ../linux-generic/odp_weak.c
if ARCH_IS_ARM
__LIB__libodp_dpdk_la_SOURCES += arch/arm/odp_cpu_arch.c \
@@ -360,6 +328,14 @@ noinst_HEADERS += $(modularframeworkdir)/list.h \
__LIB__libodp_dpdk_la_SOURCES += ../../frameworks/modular/odp_module.c
+# Build driver framework into odp-linux library
+driverframeworkdir = $(top_srcdir)/frameworks/driver
+noinst_HEADERS += $(driverframeworkdir)/include/driver.h \
+ $(driverframeworkdir)/include/driver_types.h \
+ $(driverframeworkdir)/include/driver_internal.h
+
+__LIB__libodp_dpdk_la_SOURCES += ../../frameworks/driver/driver.c
+
__LIB__libodp_dpdk_la_LIBADD = $(ATOMIC_LIBS)
__LIB__libodp_dpdk_la_LIBADD += $(DPDK_LIBS)
__LIB__libodp_dpdk_la_LIBADD += $(OPENSSL_LIBS)
@@ -11,6 +11,7 @@ lib_LTLIBRARIES = $(LIB)/libodp-linux.la
AM_CPPFLAGS = -I$(srcdir)/include
AM_CPPFLAGS += -I$(top_srcdir)/include
AM_CPPFLAGS += -I$(top_srcdir)/frameworks/modular
+AM_CPPFLAGS += -I$(top_srcdir)/frameworks/driver/include
AM_CPPFLAGS += -I$(top_srcdir)/include/odp/arch/@ARCH_ABI@
AM_CPPFLAGS += -I$(top_builddir)/include
AM_CPPFLAGS += -Iinclude
@@ -123,39 +124,12 @@ odpapiplatinclude_HEADERS = \
nodist_odpapiplatinclude_HEADERS = \
include/odp/api/plat/static_inline.h
-odpdrvincludedir = $(includedir)/odp/drv
-odpdrvinclude_HEADERS = \
- include/odp/drv/align.h \
- include/odp/drv/atomic.h \
- include/odp/drv/barrier.h \
- include/odp/drv/byteorder.h \
- include/odp/drv/compiler.h \
- include/odp/drv/driver.h \
- include/odp/drv/hints.h \
- include/odp/drv/shm.h \
- include/odp/drv/spinlock.h \
- include/odp/drv/std_types.h \
- include/odp/drv/sync.h
-
-odpdrvplatincludedir = $(includedir)/odp/drv/plat
-odpdrvplatinclude_HEADERS = \
- include/odp/drv/plat/atomic_types.h \
- include/odp/drv/plat/barrier_types.h \
- include/odp/drv/plat/byteorder_types.h \
- include/odp/drv/compiler.h \
- include/odp/drv/plat/driver_types.h \
- include/odp/drv/plat/shm_types.h \
- include/odp/drv/plat/spinlock_types.h \
- include/odp/drv/plat/strong_types.h
-
noinst_HEADERS = \
include/_fdserver_internal.h \
include/_ishm_internal.h \
include/_ishmphy_internal.h \
include/_ishmpool_internal.h \
include/_str_functions_internal.h \
- include/drv_driver_internal.h \
- include/drv_pci_internal.h \
include/odp_align_internal.h \
include/odp_atomic_internal.h \
include/odp_buffer_inlines.h \
@@ -259,8 +233,8 @@ __LIB__libodp_linux_la_SOURCES = \
pktio/socket_mmap.c \
pktio/sysfs.c \
pktio/tap.c \
- pktio/virtio.c \
- pktio/virtio_pci.c \
+ pktio/virtio/virtio.c \
+ pktio/virtio/virtio_pci.c \
pktio/ring.c \
pool/generic.c \
pool/subsystem.c \
@@ -286,14 +260,7 @@ __LIB__libodp_linux_la_SOURCES = \
odp_timer_wheel.c \
odp_traffic_mngr.c \
odp_version.c \
- odp_weak.c \
- drv_atomic.c \
- drv_barrier.c \
- drv_driver.c \
- drv_pci.c \
- drv_pci_uio.c \
- drv_shm.c \
- drv_spinlock.c
+ odp_weak.c
if ARCH_IS_ARM
__LIB__libodp_linux_la_SOURCES += arch/default/odp_cpu_arch.c \
@@ -393,6 +360,17 @@ noinst_HEADERS += $(modularframeworkdir)/list.h \
__LIB__libodp_linux_la_SOURCES += ../../frameworks/modular/odp_module.c
+# Build driver framework into odp-linux library
+driverframeworkdir = $(top_srcdir)/frameworks/driver
+noinst_HEADERS += $(driverframeworkdir)/include/driver.h \
+ $(driverframeworkdir)/include/driver_types.h \
+ $(driverframeworkdir)/include/driver_internal.h \
+ $(driverframeworkdir)/include/pci_internal.h
+
+__LIB__libodp_linux_la_SOURCES += ../../frameworks/driver/driver.c \
+ ../../frameworks/driver/pci.c \
+ ../../frameworks/driver/pci_uio.c
+
__LIB__libodp_linux_la_LIBADD = $(ATOMIC_LIBS)
__LIB__libodp_linux_la_LIBADD += $(OPENSSL_LIBS)
__LIB__libodp_linux_la_LIBADD += $(DPDK_LIBS) $(DPDK_PMDS)
@@ -54,7 +54,6 @@
#include <odp/api/align.h>
#include <odp/api/system_info.h>
#include <odp/api/debug.h>
-#include <odp/drv/shm.h>
#include <odp_shm_internal.h>
#include <odp_debug_internal.h>
#include <odp_align_internal.h>
@@ -48,7 +48,6 @@
#include <odp/api/spinlock.h>
#include <odp/api/align.h>
#include <odp/api/debug.h>
-#include <odp/drv/shm.h>
#include <odp_shm_internal.h>
#include <odp_debug_internal.h>
#include <odp_align_internal.h>
@@ -10,7 +10,7 @@
#include <odp/api/std_types.h>
#include <odp/api/debug.h>
#include <odp_debug_internal.h>
-#include <drv_driver_internal.h>
+#include <driver_internal.h>
#include <libconfig.h>
#include <dlfcn.h>
deleted file mode 100644
@@ -1,26 +0,0 @@
-/* Copyright (c) 2016, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-#include <odp/drv/atomic.h>
-
-int odpdrv_atomic_lock_free_u64(odpdrv_atomic_op_t *atomic_op)
-{
-#if __GCC_ATOMIC_LLONG_LOCK_FREE < 2
- /* All operations have locks */
- if (atomic_op)
- atomic_op->all_bits = 0;
-
- return 0;
-#else
- /* All operations are lock-free */
- if (atomic_op) {
- atomic_op->all_bits = ~((uint32_t)0);
- atomic_op->op.init = 0;
- }
-
- return 2;
-#endif
-}
deleted file mode 100644
@@ -1,50 +0,0 @@
-/* Copyright (c) 2016, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-#include <odp/drv/barrier.h>
-#include <odp/drv/sync.h>
-#include <odp/api/cpu.h>
-#include <odp/drv/atomic.h>
-
-void odpdrv_barrier_init(odpdrv_barrier_t *barrier, int count)
-{
- barrier->count = (uint32_t)count;
- odpdrv_atomic_init_u32(&barrier->bar, 0);
-}
-
-/*
- * Efficient barrier_sync -
- *
- * Barriers are initialized with a count of the number of callers
- * that must sync on the barrier before any may proceed.
- *
- * To avoid race conditions and to permit the barrier to be fully
- * reusable, the barrier value cycles between 0..2*count-1. When
- * synchronizing the wasless variable simply tracks which half of
- * the cycle the barrier was in upon entry. Exit is when the
- * barrier crosses to the other half of the cycle.
- */
-void odpdrv_barrier_wait(odpdrv_barrier_t *barrier)
-{
- uint32_t count;
- int wasless;
-
- odpdrv_mb_full();
-
- count = odpdrv_atomic_fetch_inc_u32(&barrier->bar);
- wasless = count < barrier->count;
-
- if (count == 2 * barrier->count - 1) {
- /* Wrap around *atomically* */
- odpdrv_atomic_sub_u32(&barrier->bar, 2 * barrier->count);
- } else {
- while ((odpdrv_atomic_load_u32(&barrier->bar) < barrier->count)
- == wasless)
- odp_cpu_pause();
- }
-
- odpdrv_mb_full();
-}
deleted file mode 100644
@@ -1,146 +0,0 @@
-/* Copyright (c) 2016, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-#include <odp_config_internal.h>
-#include <odp/api/std_types.h>
-#include <odp/drv/shm.h>
-#include <_ishm_internal.h>
-#include <_ishmpool_internal.h>
-
-static inline uint32_t from_handle(odpdrv_shm_t shm)
-{
- return _odpdrv_typeval(shm) - 1;
-}
-
-static inline odpdrv_shm_t to_handle(uint32_t index)
-{
- return _odpdrv_cast_scalar(odpdrv_shm_t, index + 1);
-}
-
-int odpdrv_shm_capability(odpdrv_shm_capability_t *capa)
-{
- capa->max_blocks = ODPDRV_CONFIG_SHM_BLOCKS;
- capa->max_size = 0;
- capa->max_align = 0;
-
- return 0;
-}
-
-odpdrv_shm_t odpdrv_shm_reserve(const char *name, uint64_t size, uint64_t align,
- uint32_t flags)
-{
- int block_index;
- int flgs = 0; /* internal ishm flags */
-
- /* set internal ishm flags according to API flags: */
- flgs |= (flags & ODPDRV_SHM_SINGLE_VA) ? _ODP_ISHM_SINGLE_VA : 0;
- flgs |= (flags & ODPDRV_SHM_LOCK) ? _ODP_ISHM_LOCK : 0;
-
- block_index = _odp_ishm_reserve(name, size, -1, align, flgs, flags);
- if (block_index >= 0)
- return to_handle(block_index);
- else
- return ODPDRV_SHM_INVALID;
-}
-
-int odpdrv_shm_free_by_handle(odpdrv_shm_t shm)
-{
- return _odp_ishm_free_by_index(from_handle(shm));
-}
-
-int odpdrv_shm_free_by_name(const char *name)
-{
- return _odp_ishm_free_by_name(name);
-}
-
-int odpdrv_shm_free_by_address(void *address)
-{
- return _odp_ishm_free_by_address(address);
-}
-
-void *odpdrv_shm_lookup_by_handle(odpdrv_shm_t shm)
-{
- return _odp_ishm_lookup_by_index(from_handle(shm));
-}
-
-odpdrv_shm_t odpdrv_shm_lookup_by_name(const char *name)
-{
- return to_handle(_odp_ishm_lookup_by_name(name));
-}
-
-odpdrv_shm_t odpdrv_shm_lookup_by_address(void *address)
-{
- return to_handle(_odp_ishm_lookup_by_address(address));
-}
-
-void *odpdrv_shm_addr(odpdrv_shm_t shm)
-{
- return _odp_ishm_address(from_handle(shm));
-}
-
-int odpdrv_shm_info(odpdrv_shm_t shm, odpdrv_shm_info_t *info)
-{
- _odp_ishm_info_t ishm_info;
-
- if (_odp_ishm_info(from_handle(shm), &ishm_info))
- return -1;
-
- info->name = ishm_info.name;
- info->addr = ishm_info.addr;
- info->size = ishm_info.size;
- info->page_size = ishm_info.page_size;
- info->flags = ishm_info.user_flags;
-
- return 0;
-}
-
-int odpdrv_shm_print_all(const char *title)
-{
- return _odp_ishm_status(title);
-}
-
-odpdrv_shm_pool_t odpdrv_shm_pool_create(const char *pool_name,
- odpdrv_shm_pool_param_t *param)
-{
- int flags;
-
- /* force unique address for all ODP threads */
- flags = _ODP_ISHM_SINGLE_VA;
- return (odpdrv_shm_pool_t)_odp_ishm_pool_create(pool_name,
- param->pool_size,
- param->min_alloc,
- param->max_alloc,
- flags);
-}
-
-int odpdrv_shm_pool_destroy(odpdrv_shm_pool_t pool)
-{
- return _odp_ishm_pool_destroy((_odp_ishm_pool_t *)(void*)pool);
-}
-
-odpdrv_shm_pool_t odpdrv_shm_pool_lookup(const char *name)
-{
- return (odpdrv_shm_pool_t)_odp_ishm_pool_lookup(name);
-}
-
-void *odpdrv_shm_pool_alloc(odpdrv_shm_pool_t pool, uint64_t size)
-{
- return _odp_ishm_pool_alloc((_odp_ishm_pool_t *)(void*)pool, size);
-}
-
-void odpdrv_shm_pool_free(odpdrv_shm_pool_t pool, void *addr)
-{
- (void)_odp_ishm_pool_free((_odp_ishm_pool_t *)(void*)pool, addr);
-}
-
-int odpdrv_shm_pool_print(const char *title, odpdrv_shm_pool_t pool)
-{
- return _odp_ishm_pool_status(title, (_odp_ishm_pool_t *)(void*)pool);
-}
-
-/**
- * @}
- */
deleted file mode 100644
@@ -1,39 +0,0 @@
-/* Copyright (c) 2016, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-#include <odp/drv/spinlock.h>
-#include <odp_atomic_internal.h>
-
-void odpdrv_spinlock_init(odpdrv_spinlock_t *spinlock)
-{
- _odp_atomic_flag_init(&spinlock->lock, 0);
-}
-
-void odpdrv_spinlock_lock(odpdrv_spinlock_t *spinlock)
-{
- /* While the lock is already taken... */
- while (_odp_atomic_flag_tas(&spinlock->lock))
- /* ...spin reading the flag (relaxed MM),
- * the loop will exit when the lock becomes available
- * and we will retry the TAS operation above */
- while (_odp_atomic_flag_load(&spinlock->lock))
- odp_cpu_pause();
-}
-
-int odpdrv_spinlock_trylock(odpdrv_spinlock_t *spinlock)
-{
- return (_odp_atomic_flag_tas(&spinlock->lock) == 0);
-}
-
-void odpdrv_spinlock_unlock(odpdrv_spinlock_t *spinlock)
-{
- _odp_atomic_flag_clear(&spinlock->lock);
-}
-
-int odpdrv_spinlock_is_locked(odpdrv_spinlock_t *spinlock)
-{
- return _odp_atomic_flag_load(&spinlock->lock) != 0;
-}
deleted file mode 100644
@@ -1,2 +0,0 @@
-This directory contains the files defining the ODP driver interface,
-for linux-generic.
deleted file mode 100644
@@ -1,58 +0,0 @@
-/* Copyright (c) 2016, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-/**
- * @file
- *
- * ODPDRV alignments
- */
-
-#ifndef ODPDRV_PLAT_ALIGN_H_
-#define ODPDRV_PLAT_ALIGN_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <odp/api/cpu_arch.h>
-
-/** @ingroup odpdrv_compiler_optim
- * @{
- */
-
-#ifdef __GNUC__
-
-#define ODPDRV_ALIGNED(x) __attribute__((__aligned__(x)))
-
-#define ODPDRV_PACKED __attribute__((__packed__))
-
-#define ODPDRV_OFFSETOF(type, member) __builtin_offsetof(type, member)
-
-#define ODPDRV_FIELD_SIZEOF(type, member) sizeof(((type *)0)->member)
-
-#else
-#error Non-gcc compatible compiler
-#endif
-
-#define ODPDRV_CACHE_LINE_SIZE _ODP_CACHE_LINE_SIZE
-
-#define ODPDRV_PAGE_SIZE 4096
-
-#define ODPDRV_ALIGNED_CACHE ODPDRV_ALIGNED(ODPDRV_CACHE_LINE_SIZE)
-
-#define ODPDRV_ALIGNED_PAGE ODPDRV_ALIGNED(ODPDRV_PAGE_SIZE)
-
-/**
- * @}
- */
-
-#include <odp/drv/spec/align.h>
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
deleted file mode 100644
@@ -1,430 +0,0 @@
-/* Copyright (c) 2016, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-/**
- * @file
- *
- * ODPDRV atomic operations
- */
-
-#ifndef ODPDRV_PLAT_ATOMIC_H_
-#define ODPDRV_PLAT_ATOMIC_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <odp/drv/align.h>
-#include <odp/drv/plat/atomic_types.h>
-
-/** @ingroup odpdrv_atomic
- * @{
- */
-
-static inline void odpdrv_atomic_init_u32(odpdrv_atomic_u32_t *atom,
- uint32_t val)
-{
- __atomic_store_n(&atom->v, val, __ATOMIC_RELAXED);
-}
-
-static inline uint32_t odpdrv_atomic_load_u32(odpdrv_atomic_u32_t *atom)
-{
- return __atomic_load_n(&atom->v, __ATOMIC_RELAXED);
-}
-
-static inline void odpdrv_atomic_store_u32(odpdrv_atomic_u32_t *atom,
- uint32_t val)
-{
- __atomic_store_n(&atom->v, val, __ATOMIC_RELAXED);
-}
-
-static inline uint32_t odpdrv_atomic_fetch_add_u32(odpdrv_atomic_u32_t *atom,
- uint32_t val)
-{
- return __atomic_fetch_add(&atom->v, val, __ATOMIC_RELAXED);
-}
-
-static inline void odpdrv_atomic_add_u32(odpdrv_atomic_u32_t *atom,
- uint32_t val)
-{
- (void)__atomic_fetch_add(&atom->v, val, __ATOMIC_RELAXED);
-}
-
-static inline uint32_t odpdrv_atomic_fetch_sub_u32(odpdrv_atomic_u32_t *atom,
- uint32_t val)
-{
- return __atomic_fetch_sub(&atom->v, val, __ATOMIC_RELAXED);
-}
-
-static inline void odpdrv_atomic_sub_u32(odpdrv_atomic_u32_t *atom,
- uint32_t val)
-{
- (void)__atomic_fetch_sub(&atom->v, val, __ATOMIC_RELAXED);
-}
-
-static inline uint32_t odpdrv_atomic_fetch_inc_u32(odpdrv_atomic_u32_t *atom)
-{
- return __atomic_fetch_add(&atom->v, 1, __ATOMIC_RELAXED);
-}
-
-static inline void odpdrv_atomic_inc_u32(odpdrv_atomic_u32_t *atom)
-{
- (void)__atomic_fetch_add(&atom->v, 1, __ATOMIC_RELAXED);
-}
-
-static inline uint32_t odpdrv_atomic_fetch_dec_u32(odpdrv_atomic_u32_t *atom)
-{
- return __atomic_fetch_sub(&atom->v, 1, __ATOMIC_RELAXED);
-}
-
-static inline void odpdrv_atomic_dec_u32(odpdrv_atomic_u32_t *atom)
-{
- (void)__atomic_fetch_sub(&atom->v, 1, __ATOMIC_RELAXED);
-}
-
-static inline int odpdrv_atomic_cas_u32(odpdrv_atomic_u32_t *atom,
- uint32_t *old_val, uint32_t new_val)
-{
- return __atomic_compare_exchange_n(&atom->v, old_val, new_val,
- 0 /* strong */,
- __ATOMIC_RELAXED,
- __ATOMIC_RELAXED);
-}
-
-static inline uint32_t odpdrv_atomic_xchg_u32(odpdrv_atomic_u32_t *atom,
- uint32_t new_val)
-{
- return __atomic_exchange_n(&atom->v, new_val, __ATOMIC_RELAXED);
-}
-
-static inline void odpdrv_atomic_max_u32(odpdrv_atomic_u32_t *atom,
- uint32_t new_max)
-{
- uint32_t old_val;
-
- old_val = odpdrv_atomic_load_u32(atom);
-
- while (new_max > old_val) {
- if (odpdrv_atomic_cas_u32(atom, &old_val, new_max))
- break;
- }
-}
-
-static inline void odpdrv_atomic_min_u32(odpdrv_atomic_u32_t *atom,
- uint32_t new_min)
-{
- uint32_t old_val;
-
- old_val = odpdrv_atomic_load_u32(atom);
-
- while (new_min < old_val) {
- if (odpdrv_atomic_cas_u32(atom, &old_val, new_min))
- break;
- }
-}
-
-static inline void odpdrv_atomic_init_u64(odpdrv_atomic_u64_t *atom,
- uint64_t val)
-{
- atom->v = val;
-#if __GCC_ATOMIC_LLONG_LOCK_FREE < 2
- __atomic_clear(&atom->lock, __ATOMIC_RELAXED);
-#endif
-}
-
-static inline uint64_t odpdrv_atomic_load_u64(odpdrv_atomic_u64_t *atom)
-{
-#if __GCC_ATOMIC_LLONG_LOCK_FREE < 2
- return ATOMIC_OP(atom, (void)0);
-#else
- return __atomic_load_n(&atom->v, __ATOMIC_RELAXED);
-#endif
-}
-
-static inline void odpdrv_atomic_store_u64(odpdrv_atomic_u64_t *atom,
- uint64_t val)
-{
-#if __GCC_ATOMIC_LLONG_LOCK_FREE < 2
- (void)ATOMIC_OP(atom, atom->v = val);
-#else
- __atomic_store_n(&atom->v, val, __ATOMIC_RELAXED);
-#endif
-}
-
-static inline uint64_t odpdrv_atomic_fetch_add_u64(odpdrv_atomic_u64_t *atom,
- uint64_t val)
-{
-#if __GCC_ATOMIC_LLONG_LOCK_FREE < 2
- return ATOMIC_OP(atom, atom->v += val);
-#else
- return __atomic_fetch_add(&atom->v, val, __ATOMIC_RELAXED);
-#endif
-}
-
-static inline void odpdrv_atomic_add_u64(odpdrv_atomic_u64_t *atom,
- uint64_t val)
-{
-#if __GCC_ATOMIC_LLONG_LOCK_FREE < 2
- (void)ATOMIC_OP(atom, atom->v += val);
-#else
- (void)__atomic_fetch_add(&atom->v, val, __ATOMIC_RELAXED);
-#endif
-}
-
-static inline uint64_t odpdrv_atomic_fetch_sub_u64(odpdrv_atomic_u64_t *atom,
- uint64_t val)
-{
-#if __GCC_ATOMIC_LLONG_LOCK_FREE < 2
- return ATOMIC_OP(atom, atom->v -= val);
-#else
- return __atomic_fetch_sub(&atom->v, val, __ATOMIC_RELAXED);
-#endif
-}
-
-static inline void odpdrv_atomic_sub_u64(odpdrv_atomic_u64_t *atom,
- uint64_t val)
-{
-#if __GCC_ATOMIC_LLONG_LOCK_FREE < 2
- (void)ATOMIC_OP(atom, atom->v -= val);
-#else
- (void)__atomic_fetch_sub(&atom->v, val, __ATOMIC_RELAXED);
-#endif
-}
-
-static inline uint64_t odpdrv_atomic_fetch_inc_u64(odpdrv_atomic_u64_t *atom)
-{
-#if __GCC_ATOMIC_LLONG_LOCK_FREE < 2
- return ATOMIC_OP(atom, atom->v++);
-#else
- return __atomic_fetch_add(&atom->v, 1, __ATOMIC_RELAXED);
-#endif
-}
-
-static inline void odpdrv_atomic_inc_u64(odpdrv_atomic_u64_t *atom)
-{
-#if __GCC_ATOMIC_LLONG_LOCK_FREE < 2
- (void)ATOMIC_OP(atom, atom->v++);
-#else
- (void)__atomic_fetch_add(&atom->v, 1, __ATOMIC_RELAXED);
-#endif
-}
-
-static inline uint64_t odpdrv_atomic_fetch_dec_u64(odpdrv_atomic_u64_t *atom)
-{
-#if __GCC_ATOMIC_LLONG_LOCK_FREE < 2
- return ATOMIC_OP(atom, atom->v--);
-#else
- return __atomic_fetch_sub(&atom->v, 1, __ATOMIC_RELAXED);
-#endif
-}
-
-static inline void odpdrv_atomic_dec_u64(odpdrv_atomic_u64_t *atom)
-{
-#if __GCC_ATOMIC_LLONG_LOCK_FREE < 2
- (void)ATOMIC_OP(atom, atom->v--);
-#else
- (void)__atomic_fetch_sub(&atom->v, 1, __ATOMIC_RELAXED);
-#endif
-}
-
-static inline int odpdrv_atomic_cas_u64(odpdrv_atomic_u64_t *atom,
- uint64_t *old_val, uint64_t new_val)
-{
-#if __GCC_ATOMIC_LLONG_LOCK_FREE < 2
- int ret;
- *old_val = ATOMIC_OP(atom, ATOMIC_CAS_OP(&ret, *old_val, new_val));
- return ret;
-#else
- return __atomic_compare_exchange_n(&atom->v, old_val, new_val,
- 0 /* strong */,
- __ATOMIC_RELAXED,
- __ATOMIC_RELAXED);
-#endif
-}
-
-static inline uint64_t odpdrv_atomic_xchg_u64(odpdrv_atomic_u64_t *atom,
- uint64_t new_val)
-{
-#if __GCC_ATOMIC_LLONG_LOCK_FREE < 2
- return ATOMIC_OP(atom, atom->v = new_val);
-#else
- return __atomic_exchange_n(&atom->v, new_val, __ATOMIC_RELAXED);
-#endif
-}
-
-static inline void odpdrv_atomic_max_u64(odpdrv_atomic_u64_t *atom,
- uint64_t new_max)
-{
- uint64_t old_val;
-
- old_val = odpdrv_atomic_load_u64(atom);
-
- while (new_max > old_val) {
- if (odpdrv_atomic_cas_u64(atom, &old_val, new_max))
- break;
- }
-}
-
-static inline void odpdrv_atomic_min_u64(odpdrv_atomic_u64_t *atom,
- uint64_t new_min)
-{
- uint64_t old_val;
-
- old_val = odpdrv_atomic_load_u64(atom);
-
- while (new_min < old_val) {
- if (odpdrv_atomic_cas_u64(atom, &old_val, new_min))
- break;
- }
-}
-
-static inline uint32_t odpdrv_atomic_load_acq_u32(odpdrv_atomic_u32_t *atom)
-{
- return __atomic_load_n(&atom->v, __ATOMIC_ACQUIRE);
-}
-
-static inline void odpdrv_atomic_store_rel_u32(odpdrv_atomic_u32_t *atom,
- uint32_t val)
-{
- __atomic_store_n(&atom->v, val, __ATOMIC_RELEASE);
-}
-
-static inline void odpdrv_atomic_add_rel_u32(odpdrv_atomic_u32_t *atom,
- uint32_t val)
-{
- (void)__atomic_fetch_add(&atom->v, val, __ATOMIC_RELEASE);
-}
-
-static inline void odpdrv_atomic_sub_rel_u32(odpdrv_atomic_u32_t *atom,
- uint32_t val)
-{
- (void)__atomic_fetch_sub(&atom->v, val, __ATOMIC_RELEASE);
-}
-
-static inline int odpdrv_atomic_cas_acq_u32(odpdrv_atomic_u32_t *atom,
- uint32_t *old_val, uint32_t new_val)
-{
- return __atomic_compare_exchange_n(&atom->v, old_val, new_val,
- 0 /* strong */,
- __ATOMIC_ACQUIRE,
- __ATOMIC_RELAXED);
-}
-
-static inline int odpdrv_atomic_cas_rel_u32(odpdrv_atomic_u32_t *atom,
- uint32_t *old_val, uint32_t new_val)
-{
- return __atomic_compare_exchange_n(&atom->v, old_val, new_val,
- 0 /* strong */,
- __ATOMIC_RELEASE,
- __ATOMIC_RELAXED);
-}
-
-static inline int odpdrv_atomic_cas_acq_rel_u32(odpdrv_atomic_u32_t *atom,
- uint32_t *old_val,
- uint32_t new_val)
-{
- return __atomic_compare_exchange_n(&atom->v, old_val, new_val,
- 0 /* strong */,
- __ATOMIC_ACQ_REL,
- __ATOMIC_RELAXED);
-}
-
-static inline uint64_t odpdrv_atomic_load_acq_u64(odpdrv_atomic_u64_t *atom)
-{
-#if __GCC_ATOMIC_LLONG_LOCK_FREE < 2
- return ATOMIC_OP(atom, (void)0);
-#else
- return __atomic_load_n(&atom->v, __ATOMIC_ACQUIRE);
-#endif
-}
-
-static inline void odpdrv_atomic_store_rel_u64(odpdrv_atomic_u64_t *atom,
- uint64_t val)
-{
-#if __GCC_ATOMIC_LLONG_LOCK_FREE < 2
- (void)ATOMIC_OP(atom, atom->v = val);
-#else
- __atomic_store_n(&atom->v, val, __ATOMIC_RELEASE);
-#endif
-}
-
-static inline void odpdrv_atomic_add_rel_u64(odpdrv_atomic_u64_t *atom,
- uint64_t val)
-{
-#if __GCC_ATOMIC_LLONG_LOCK_FREE < 2
- (void)ATOMIC_OP(atom, atom->v += val);
-#else
- (void)__atomic_fetch_add(&atom->v, val, __ATOMIC_RELEASE);
-#endif
-}
-
-static inline void odpdrv_atomic_sub_rel_u64(odpdrv_atomic_u64_t *atom,
- uint64_t val)
-{
-#if __GCC_ATOMIC_LLONG_LOCK_FREE < 2
- (void)ATOMIC_OP(atom, atom->v -= val);
-#else
- (void)__atomic_fetch_sub(&atom->v, val, __ATOMIC_RELEASE);
-#endif
-}
-
-static inline int odpdrv_atomic_cas_acq_u64(odpdrv_atomic_u64_t *atom,
- uint64_t *old_val, uint64_t new_val)
-{
-#if __GCC_ATOMIC_LLONG_LOCK_FREE < 2
- int ret;
- *old_val = ATOMIC_OP(atom, ATOMIC_CAS_OP(&ret, *old_val, new_val));
- return ret;
-#else
- return __atomic_compare_exchange_n(&atom->v, old_val, new_val,
- 0 /* strong */,
- __ATOMIC_ACQUIRE,
- __ATOMIC_RELAXED);
-#endif
-}
-
-static inline int odpdrv_atomic_cas_rel_u64(odpdrv_atomic_u64_t *atom,
- uint64_t *old_val, uint64_t new_val)
-{
-#if __GCC_ATOMIC_LLONG_LOCK_FREE < 2
- int ret;
- *old_val = ATOMIC_OP(atom, ATOMIC_CAS_OP(&ret, *old_val, new_val));
- return ret;
-#else
- return __atomic_compare_exchange_n(&atom->v, old_val, new_val,
- 0 /* strong */,
- __ATOMIC_RELEASE,
- __ATOMIC_RELAXED);
-#endif
-}
-
-static inline int odpdrv_atomic_cas_acq_rel_u64(odpdrv_atomic_u64_t *atom,
- uint64_t *old_val,
- uint64_t new_val)
-{
-#if __GCC_ATOMIC_LLONG_LOCK_FREE < 2
- int ret;
- *old_val = ATOMIC_OP(atom, ATOMIC_CAS_OP(&ret, *old_val, new_val));
- return ret;
-#else
- return __atomic_compare_exchange_n(&atom->v, old_val, new_val,
- 0 /* strong */,
- __ATOMIC_ACQ_REL,
- __ATOMIC_RELAXED);
-#endif
-}
-
-/**
- * @}
- */
-
-#include <odp/drv/spec/atomic.h>
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
deleted file mode 100644
@@ -1,30 +0,0 @@
-/* Copyright (c) 2016, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-/**
- * @file
- *
- * ODPDRV execution barriers
- */
-
-#ifndef ODPDRV_PLAT_BARRIER_H_
-#define ODPDRV_PLAT_BARRIER_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <odp/drv/std_types.h>
-#include <odp/drv/atomic.h>
-#include <odp/drv/plat/barrier_types.h>
-
-#include <odp/drv/spec/barrier.h>
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
deleted file mode 100644
@@ -1,146 +0,0 @@
-/* Copyright (c) 2016, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-/**
- * @file
- *
- * ODPDRV byteorder
- */
-
-#ifndef ODPDRV_PLAT_BYTEORDER_H_
-#define ODPDRV_PLAT_BYTEORDER_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <odp/drv/plat/byteorder_types.h>
-#include <odp/drv/std_types.h>
-#include <odp/drv/compiler.h>
-
-/** @ingroup odpdrv_compiler_optim
- * @{
- */
-
-static inline uint16_t odpdrv_be_to_cpu_16(odpdrv_u16be_t be16)
-{
-#if ODPDRV_BYTE_ORDER == ODPDRV_LITTLE_ENDIAN
- return __odpdrv_builtin_bswap16((__odpdrv_force uint16_t)be16);
-#else
- return (__odpdrv_force uint16_t)be16;
-#endif
-}
-
-static inline uint32_t odpdrv_be_to_cpu_32(odpdrv_u32be_t be32)
-{
-#if ODPDRV_BYTE_ORDER == ODPDRV_LITTLE_ENDIAN
- return __builtin_bswap32((__odpdrv_force uint32_t)be32);
-#else
- return (__odpdrv_force uint32_t)be32;
-#endif
-}
-
-static inline uint64_t odpdrv_be_to_cpu_64(odpdrv_u64be_t be64)
-{
-#if ODPDRV_BYTE_ORDER == ODPDRV_LITTLE_ENDIAN
- return __builtin_bswap64((__odpdrv_force uint64_t)be64);
-#else
- return (__odpdrv_force uint64_t)be64;
-#endif
-}
-
-static inline odpdrv_u16be_t odpdrv_cpu_to_be_16(uint16_t cpu16)
-{
-#if ODPDRV_BYTE_ORDER == ODPDRV_LITTLE_ENDIAN
- return (__odpdrv_force odpdrv_u16be_t)__odpdrv_builtin_bswap16(cpu16);
-#else
- return (__odpdrv_force odpdrv_u16be_t)cpu16;
-#endif
-}
-
-static inline odpdrv_u32be_t odpdrv_cpu_to_be_32(uint32_t cpu32)
-{
-#if ODPDRV_BYTE_ORDER == ODPDRV_LITTLE_ENDIAN
- return (__odpdrv_force odpdrv_u32be_t)__builtin_bswap32(cpu32);
-#else
- return (__odpdrv_force odpdrv_u32be_t)cpu32;
-#endif
-}
-
-static inline odpdrv_u64be_t odpdrv_cpu_to_be_64(uint64_t cpu64)
-{
-#if ODPDRV_BYTE_ORDER == ODPDRV_LITTLE_ENDIAN
- return (__odpdrv_force odpdrv_u64be_t)__builtin_bswap64(cpu64);
-#else
- return (__odpdrv_force odpdrv_u64be_t)cpu64;
-#endif
-}
-
-static inline uint16_t odpdrv_le_to_cpu_16(odpdrv_u16le_t le16)
-{
-#if ODPDRV_BYTE_ORDER == ODPDRV_LITTLE_ENDIAN
- return (__odpdrv_force uint16_t)le16;
-#else
- return __odpdrv_builtin_bswap16((__odpdrv_force uint16_t)le16);
-#endif
-}
-
-static inline uint32_t odpdrv_le_to_cpu_32(odpdrv_u32le_t le32)
-{
-#if ODPDRV_BYTE_ORDER == ODPDRV_LITTLE_ENDIAN
- return (__odpdrv_force uint32_t)le32;
-#else
- return __builtin_bswap32((__odpdrv_force uint32_t)le32);
-#endif
-}
-
-static inline uint64_t odpdrv_le_to_cpu_64(odpdrv_u64le_t le64)
-{
-#if ODPDRV_BYTE_ORDER == ODPDRV_LITTLE_ENDIAN
- return (__odpdrv_force uint64_t)le64;
-#else
- return __builtin_bswap64((__odpdrv_force uint64_t)le64);
-#endif
-}
-
-static inline odpdrv_u16le_t odpdrv_cpu_to_le_16(uint16_t cpu16)
-{
-#if ODPDRV_BYTE_ORDER == ODPDRV_LITTLE_ENDIAN
- return (__odpdrv_force odpdrv_u16le_t)cpu16;
-#else
- return (__odpdrv_force odpdrv_u16le_t)__odpdrv_builtin_bswap16(cpu16);
-#endif
-}
-
-static inline odpdrv_u32le_t odpdrv_cpu_to_le_32(uint32_t cpu32)
-{
-#if ODPDRV_BYTE_ORDER == ODPDRV_LITTLE_ENDIAN
- return (__odpdrv_force odpdrv_u32le_t)cpu32;
-#else
- return (__odpdrv_force odpdrv_u32le_t)__builtin_bswap32(cpu32);
-#endif
-}
-
-static inline odpdrv_u64le_t odpdrv_cpu_to_le_64(uint64_t cpu64)
-{
-#if ODPDRV_BYTE_ORDER == ODPDRV_LITTLE_ENDIAN
- return (__odpdrv_force odpdrv_u64le_t)cpu64;
-#else
- return (__odpdrv_force odpdrv_u64le_t)__builtin_bswap64(cpu64);
-#endif
-}
-
-/**
- * @}
- */
-
-#include <odp/drv/spec/byteorder.h>
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
deleted file mode 100644
@@ -1,34 +0,0 @@
-/* Copyright (c) 2016, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-/**
- * @file
- *
- * Compiler related
- */
-
-#ifndef ODPDRV_PLAT_COMPILER_H_
-#define ODPDRV_PLAT_COMPILER_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/** @addtogroup odpdrv_compiler_optim ODPDRV COMPILER / OPTIMIZATION
- * @{
- */
-
-/**
- * @}
- */
-
-#include <odp/drv/spec/compiler.h>
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
deleted file mode 100644
@@ -1,37 +0,0 @@
-/* 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 <odp/drv/plat/driver_types.h>
-
-/** @ingroup odpdrv_driver
- * @{
- */
-
-/**
- * @}
- */
-
-#include <odp/drv/std_types.h>
-#include <odp/drv/spec/driver.h>
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
deleted file mode 100644
@@ -1,34 +0,0 @@
-/* Copyright (c) 2017, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-/**
- * @file
- *
- * ODPDRV compiler hints
- */
-
-#ifndef ODPDRV_PLAT_HINTS_H_
-#define ODPDRV_PLAT_HINTS_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/** @ingroup odpdrv_compiler_optim
- * @{
- */
-
-/**
- * @}
- */
-
-#include <odp/drv/spec/hints.h>
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
deleted file mode 100644
@@ -1,88 +0,0 @@
-/* Copyright (c) 2016, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-/**
- * @file
- *
- * ODPDRV atomic operations
- */
-
-#ifndef ODPDRV_ATOMIC_TYPES_H_
-#define ODPDRV_ATOMIC_TYPES_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <odp/drv/std_types.h>
-#include <odp/drv/align.h>
-
-/**
- * @internal
- * Atomic 64-bit unsigned integer
- */
-struct odpdrv_atomic_u64_s {
- uint64_t v; /**< Actual storage for the atomic variable */
-#if __GCC_ATOMIC_LLONG_LOCK_FREE < 2
- /* Some architectures do not support lock-free operations on 64-bit
- * data types. We use a spin lock to ensure atomicity. */
- char lock; /**< Spin lock (if needed) used to ensure atomic access */
-#endif
-} ODPDRV_ALIGNED(sizeof(uint64_t)); /* Enforce alignement! */;
-
-/**
- * @internal
- * Atomic 32-bit unsigned integer
- */
-struct odpdrv_atomic_u32_s {
- uint32_t v; /**< Actual storage for the atomic variable */
-} ODPDRV_ALIGNED(sizeof(uint32_t)); /* Enforce alignement! */;
-
-#if __GCC_ATOMIC_LLONG_LOCK_FREE < 2
-
-/**
- * @internal
- * CAS operation expression for the ATOMIC_OP macro
- */
-#define ATOMIC_CAS_OP(ret_ptr, old_val, new_val) \
-({ \
- if (atom->v == (old_val)) { \
- atom->v = (new_val); \
- *(ret_ptr) = 1; \
- } else { \
- *(ret_ptr) = 0; \
- } \
-})
-
-/**
- * @internal
- * Helper macro for lock-based atomic operations on 64-bit integers
- * @param[in,out] atom Pointer to the 64-bit atomic variable
- * @param expr Expression used update the variable.
- * @return The old value of the variable.
- */
-#define ATOMIC_OP(atom, expr) \
-({ \
- uint64_t _old_val; \
- /* Loop while lock is already taken, stop when lock becomes clear */ \
- while (__atomic_test_and_set(&(atom)->lock, __ATOMIC_ACQUIRE)) \
- (void)0; \
- _old_val = (atom)->v; \
- (expr); /* Perform whatever update is desired */ \
- __atomic_clear(&(atom)->lock, __ATOMIC_RELEASE); \
- _old_val; /* Return old value */ \
-})
-#endif
-
-typedef struct odpdrv_atomic_u64_s odpdrv_atomic_u64_t;
-
-typedef struct odpdrv_atomic_u32_s odpdrv_atomic_u32_t;
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
deleted file mode 100644
@@ -1,38 +0,0 @@
-/* Copyright (c) 2016, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-/**
- * @file
- *
- * ODPDRV barrier
- */
-
-#ifndef ODPDRV_BARRIER_TYPES_H_
-#define ODPDRV_BARRIER_TYPES_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <odp/drv/std_types.h>
-#include <odp/drv/atomic.h>
-
-/**
- * @internal
- * ODPDRV thread synchronization barrier
- */
-struct odpdrv_barrier_s {
- uint32_t count; /**< Thread count */
- odpdrv_atomic_u32_t bar; /**< Barrier counter */
-};
-
-typedef struct odpdrv_barrier_s odpdrv_barrier_t;
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
deleted file mode 100644
@@ -1,84 +0,0 @@
-/* Copyright (c) 2016, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-/**
- * @file
- *
- * ODPDRV byteorder
- */
-
-#ifndef ODPDRV_BYTEORDER_TYPES_H_
-#define ODPDRV_BYTEORDER_TYPES_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifndef __BYTE_ORDER__
-#error __BYTE_ORDER not defined!
-#endif
-
-#ifndef __ORDER_BIG_ENDIAN__
-#error __BIG_ENDIAN not defined!
-#endif
-
-#ifndef __ORDER_LITTLE_ENDIAN__
-#error __LITTLE_ENDIAN not defined!
-#endif
-
-/* for use with type checkers such as sparse */
-#ifdef __CHECKER__
-/** @internal bitwise attribute */
-#define __odpdrv_bitwise __attribute__((bitwise))
-/** @internal force attribute */
-#define __odpdrv_force __attribute__((force))
-#else
-/** @internal bitwise attribute */
-#define __odpdrv_bitwise
-/** @internal force attribute */
-#define __odpdrv_force
-#endif
-
-/** @addtogroup odpdrv_compiler_optim
- * @{
- */
-#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
- #define ODPDRV_LITTLE_ENDIAN 1
- #define ODPDRV_BIG_ENDIAN 0
- #define ODPDRV_BYTE_ORDER ODPDRV_LITTLE_ENDIAN
- #define ODPDRV_LITTLE_ENDIAN_BITFIELD 1
- #define ODPDRV_BIG_ENDIAN_BITFIELD 0
- #define ODPDRV_BITFIELD_ORDER ODPDRV_LITTLE_ENDIAN_BITFIELD
-#else
- #define ODPDRV_LITTLE_ENDIAN 0
- #define ODPDRV_BIG_ENDIAN 1
- #define ODPDRV_BYTE_ORDER ODPDRV_BIG_ENDIAN
- #define ODPDRV_LITTLE_ENDIAN_BITFIELD 0
- #define ODPDRV_BIG_ENDIAN_BITFIELD 1
- #define ODPDRV_BITFIELD_ORDER ODPDRV_BIG_ENDIAN_BITFIELD
-#endif
-
-typedef uint16_t __odpdrv_bitwise odpdrv_u16le_t;
-typedef uint16_t __odpdrv_bitwise odpdrv_u16be_t;
-
-typedef uint32_t __odpdrv_bitwise odpdrv_u32le_t;
-typedef uint32_t __odpdrv_bitwise odpdrv_u32be_t;
-
-typedef uint64_t __odpdrv_bitwise odpdrv_u64le_t;
-typedef uint64_t __odpdrv_bitwise odpdrv_u64be_t;
-
-typedef uint16_t __odpdrv_bitwise odpdrv_u16sum_t;
-typedef uint32_t __odpdrv_bitwise odpdrv_u32sum_t;
-
-/**
- * @}
- */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
deleted file mode 100644
@@ -1,52 +0,0 @@
-/* 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 <odp/drv/std_types.h>
-#include <odp/drv/plat/strong_types.h>
-
-/** @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
deleted file mode 100644
@@ -1,49 +0,0 @@
-/* Copyright (c) 2016, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-/**
- * @file
- *
- * ODP shared memory
- */
-
-#ifndef ODPDRV_SHM_TYPES_H_
-#define ODPDRV_SHM_TYPES_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <odp/drv/std_types.h>
-#include <odp/drv/plat/strong_types.h>
-
-/** @addtogroup odpdrv_shm ODPDRV SHARED MEMORY
- * Operations on driver shared memory.
- * @{
- */
-
-typedef ODPDRV_HANDLE_T(odpdrv_shm_t);
-
-#define ODPDRV_SHM_INVALID _odpdrv_cast_scalar(odpdrv_shm_t, 0)
-
-/** Get printable format of odpdrv_shm_t */
-static inline uint64_t odpdrv_shm_to_u64(odpdrv_shm_t hdl)
-{
- return _odpdrv_pri(hdl);
-}
-
-typedef ODPDRV_HANDLE_T(odpdrv_shm_pool_t);
-
-#define ODPDRV_SHM_POOL_INVALID _odpdrv_cast_scalar(odpdrv_shm_pool_t, NULL)
-/**
- * @}
- */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
deleted file mode 100644
@@ -1,33 +0,0 @@
-/* Copyright (c) 2016, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-/**
- * @file
- *
- * ODPDRV spinlock
- */
-
-#ifndef ODPDRV_SPINLOCK_TYPES_H_
-#define ODPDRV_SPINLOCK_TYPES_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <odp/drv/std_types.h>
-
-/** @internal */
-struct odpdrv_spinlock_s {
- char lock; /**< lock flag, should match odpdrv_atomic_flag_t */
-};
-
-typedef struct odpdrv_spinlock_s odpdrv_spinlock_t;
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
deleted file mode 100644
@@ -1,35 +0,0 @@
-/* Copyright (c) 2016, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-/**
- * @file
- *
- * ODPDRV Strong Types. Common macros for implementing strong typing
- * for ODPDRV abstract data types
- */
-
-#ifndef ODPDRV_STRONG_TYPES_H_
-#define ODPDRV_STRONG_TYPES_H_
-
-/** Use strong typing for ODPDRV types */
-#ifdef __cplusplus
-#define ODPDRV_HANDLE_T(type) struct _##type { uint8_t unused_dummy_var; } *type
-#else
-#define odpdrv_handle_t struct { uint8_t unused_dummy_var; } *
-/** C/C++ helper macro for strong typing */
-#define ODPDRV_HANDLE_T(type) odpdrv_handle_t type
-#endif
-
-/** Internal macro to get value of an ODPDRV handle */
-#define _odpdrv_typeval(handle) ((uint32_t)(uintptr_t)(handle))
-
-/** Internal macro to get printable value of an ODPDRV handle */
-#define _odpdrv_pri(handle) ((uint64_t)_odpdrv_typeval(handle))
-
-/** Internal macro to convert a scalar to a typed handle */
-#define _odpdrv_cast_scalar(type, val) ((type)(uintptr_t)(val))
-
-#endif
deleted file mode 100644
@@ -1,36 +0,0 @@
-/* Copyright (c) 2016, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-/**
- * @file
- *
- * ODPDRV shared memory
- */
-
-#ifndef ODPDRV_PLAT_SHM_H_
-#define ODPDRV_PLAT_SHM_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <odp/drv/plat/shm_types.h>
-
-/** @ingroup odpdrv_shm
- * @{
- */
-
-/**
- * @}
- */
-
-#include <odp/drv/spec/shm.h>
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
deleted file mode 100644
@@ -1,28 +0,0 @@
-/* Copyright (c) 2016, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-/**
- * @file
- *
- * ODPDRV spinlock
- */
-
-#ifndef ODPDRV_PLAT_SPINLOCK_H_
-#define ODPDRV_PLAT_SPINLOCK_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <odp/drv/plat/spinlock_types.h>
-
-#include <odp/drv/spec/spinlock.h>
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
deleted file mode 100644
@@ -1,42 +0,0 @@
-/* Copyright (c) 2016, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-/**
- * @file
- *
- * Standard C language types and definitions for ODP driver interface.
- */
-
-#ifndef ODPDRV_PLAT_STD_TYPES_H_
-#define ODPDRV_PLAT_STD_TYPES_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <stddef.h>
-#include <stdbool.h>
-#include <stdint.h>
-#include <inttypes.h>
-#include <limits.h>
-
-/** @addtogroup odpdrv_system ODPDRV SYSTEM
- * @{
- */
-
-typedef int odpdrv_bool_t;
-
-/**
- * @}
- */
-
-#include <odp/drv/spec/std_types.h>
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
deleted file mode 100644
@@ -1,49 +0,0 @@
-/* Copyright (c) 2016, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-/**
- * @file
- *
- * ODPDRV synchronisation
- */
-
-#ifndef ODPDRV_PLAT_SYNC_H_
-#define ODPDRV_PLAT_SYNC_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/** @ingroup odpdrv_barrier
- * @{
- */
-
-static inline void odpdrv_mb_release(void)
-{
- __atomic_thread_fence(__ATOMIC_RELEASE);
-}
-
-static inline void odpdrv_mb_acquire(void)
-{
- __atomic_thread_fence(__ATOMIC_ACQUIRE);
-}
-
-static inline void odpdrv_mb_full(void)
-{
- __atomic_thread_fence(__ATOMIC_SEQ_CST);
-}
-
-/**
- * @}
- */
-
-#include <odp/drv/spec/sync.h>
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
@@ -7,7 +7,7 @@
#ifndef ODP_PACKET_VIRTIO_H
#define ODP_PACKET_VIRTIO_H
-#include <drv_pci_internal.h>
+#include <pci_internal.h>
typedef struct {
struct pci_dev_t *pci_dev;
similarity index 99%
rename from platform/linux-generic/pktio/virtio.c
rename to platform/linux-generic/pktio/virtio/virtio.c
@@ -22,7 +22,7 @@
#include <odp_debug_internal.h>
#include <odp/api/hints.h>
-#include <drv_pci_internal.h>
+#include <pci_internal.h>
#include <odp_pktio_ops_virtio.h>
#include "virtio_pci.h"
similarity index 98%
rename from platform/linux-generic/pktio/virtio_pci.c
rename to platform/linux-generic/pktio/virtio/virtio_pci.c
@@ -45,9 +45,9 @@
#include <inttypes.h>
#include <config.h>
-#include <odp_drv.h>
+#include <driver.h>
#include <odp_debug_internal.h>
-#include <drv_pci_internal.h>
+#include <pci_internal.h>
#include "virtio_pci.h"
@@ -435,8 +435,8 @@ static void virtio_get_hwaddr(struct virtio_hw *hw)
{
if (vtpci_with_feature(hw, VIRTIO_NET_F_MAC)) {
vtpci_read_dev_config(hw,
- ODPDRV_OFFSETOF(struct virtio_net_config,
- mac),
+ ODP_OFFSETOF(struct virtio_net_config,
+ mac),
&hw->mac_addr,
6);
ODP_PRINT("MAC: %02x:%02x:%02x:%02x:%02x:%02x\n",
@@ -461,8 +461,8 @@ static void virtio_get_status(struct virtio_hw *hw)
}
vtpci_read_dev_config(hw,
- ODPDRV_OFFSETOF(struct virtio_net_config,
- status),
+ ODP_OFFSETOF(struct virtio_net_config,
+ status),
&config.status, sizeof(config.status));
ODP_PRINT("Status is %u\n", config.status);
@@ -478,8 +478,8 @@ static uint16_t virtio_get_num_queues(struct virtio_hw *hw)
}
vtpci_read_dev_config(hw,
- ODPDRV_OFFSETOF(struct virtio_net_config,
- max_virtqueue_pairs),
+ ODP_OFFSETOF(struct virtio_net_config,
+ max_virtqueue_pairs),
&max_pairs, sizeof(max_pairs));
ODP_PRINT("Device supports maximum of %u virtqueue pairs\n", max_pairs);
similarity index 99%
rename from platform/linux-generic/pktio/virtio_pci.h
rename to platform/linux-generic/pktio/virtio/virtio_pci.h
@@ -36,7 +36,7 @@
#include <stdint.h>
-#include <drv_pci_internal.h>
+#include <pci_internal.h>
struct virtqueue;
struct virtnet_ctl;