@@ -639,12 +639,6 @@ that an application that tries to pass a variable of type `odp_packet_t` to
an API that expects an argument of type `odp_queue_t`, for example, will result
in a compilation error rather than some difficult to debug runtime failure.
-The *odp-linux* reference implementation defines all ODP abstract types strongly
-using a set of utility macros contained in
-`platform/linux-generic/include/odp/api/plat/strong_types.h`. These macros
-can be used or modified as desired by other implementations to achieve strong
-typing of their typedefs.
-
=== Typedef approaches
ODP abstract types serve two distinct purposes that each implementation must
consider. First, they shield applications from implementation internals, thus
@@ -5,6 +5,7 @@
*/
#include <inttypes.h>
+#include <string.h>
#include <odp_api.h>
#include <example_debug.h>
@@ -10,6 +10,7 @@
#include <unistd.h>
#include <signal.h>
+#include <string.h>
#include <inttypes.h>
#include <sys/resource.h>
#include <execinfo.h>
@@ -12,6 +12,7 @@
#include <unistd.h>
#include <stdlib.h>
+#include <string.h>
#include <odph_debug.h>
#include <odp_api.h>
@@ -9,6 +9,8 @@
#include <../odph_lineartable.h>
#include <odp_api.h>
+#include <string.h>
+
/**
* Address Resolution Protocol (ARP)
* Description: Once a route has been identified for an IP packet (so the
@@ -9,6 +9,8 @@
#endif
#include <sched.h>
#include <unistd.h>
+#include <stdbool.h>
+#include <string.h>
#include <sys/wait.h>
#include <sys/prctl.h>
#include <sys/syscall.h>
@@ -74,7 +74,10 @@ extern "C" {
* @param atom Pointer to atomic variable
* @param val Value to initialize the variable with
*/
-void odp_atomic_init_u32(odp_atomic_u32_t *atom, uint32_t val);
+static inline void odp_atomic_init_u32(odp_atomic_u32_t *atom, uint32_t val)
+{
+ __atomic_store_n(&atom->v, val, __ATOMIC_RELAXED);
+}
/**
* Load value of atomic uint32 variable
@@ -83,7 +86,10 @@ void odp_atomic_init_u32(odp_atomic_u32_t *atom, uint32_t val);
*
* @return Value of the variable
*/
-uint32_t odp_atomic_load_u32(odp_atomic_u32_t *atom);
+static inline uint32_t odp_atomic_load_u32(odp_atomic_u32_t *atom)
+{
+ return __atomic_load_n(&atom->v, __ATOMIC_RELAXED);
+}
/**
* Store value to atomic uint32 variable
@@ -91,7 +97,10 @@ uint32_t odp_atomic_load_u32(odp_atomic_u32_t *atom);
* @param atom Pointer to atomic variable
* @param val Value to store in the variable
*/
-void odp_atomic_store_u32(odp_atomic_u32_t *atom, uint32_t val);
+static inline void odp_atomic_store_u32(odp_atomic_u32_t *atom, uint32_t val)
+{
+ __atomic_store_n(&atom->v, val, __ATOMIC_RELAXED);
+}
/**
* Fetch and add to atomic uint32 variable
@@ -101,7 +110,11 @@ void odp_atomic_store_u32(odp_atomic_u32_t *atom, uint32_t val);
*
* @return Value of the variable before the addition
*/
-uint32_t odp_atomic_fetch_add_u32(odp_atomic_u32_t *atom, uint32_t val);
+static inline uint32_t odp_atomic_fetch_add_u32(odp_atomic_u32_t *atom,
+ uint32_t val)
+{
+ return __atomic_fetch_add(&atom->v, val, __ATOMIC_RELAXED);
+}
/**
* Add to atomic uint32 variable
@@ -109,7 +122,10 @@ uint32_t odp_atomic_fetch_add_u32(odp_atomic_u32_t *atom, uint32_t val);
* @param atom Pointer to atomic variable
* @param val Value to be added to the variable
*/
-void odp_atomic_add_u32(odp_atomic_u32_t *atom, uint32_t val);
+static inline void odp_atomic_add_u32(odp_atomic_u32_t *atom, uint32_t val)
+{
+ (void)__atomic_fetch_add(&atom->v, val, __ATOMIC_RELAXED);
+}
/**
* Fetch and subtract from atomic uint32 variable
@@ -119,7 +135,11 @@ void odp_atomic_add_u32(odp_atomic_u32_t *atom, uint32_t val);
*
* @return Value of the variable before the subtraction
*/
-uint32_t odp_atomic_fetch_sub_u32(odp_atomic_u32_t *atom, uint32_t val);
+static inline uint32_t odp_atomic_fetch_sub_u32(odp_atomic_u32_t *atom,
+ uint32_t val)
+{
+ return __atomic_fetch_sub(&atom->v, val, __ATOMIC_RELAXED);
+}
/**
* Subtract from atomic uint32 variable
@@ -127,7 +147,10 @@ uint32_t odp_atomic_fetch_sub_u32(odp_atomic_u32_t *atom, uint32_t val);
* @param atom Pointer to atomic variable
* @param val Value to be subtracted from the variable
*/
-void odp_atomic_sub_u32(odp_atomic_u32_t *atom, uint32_t val);
+static inline void odp_atomic_sub_u32(odp_atomic_u32_t *atom, uint32_t val)
+{
+ (void)__atomic_fetch_sub(&atom->v, val, __ATOMIC_RELAXED);
+}
/**
* Fetch and increment atomic uint32 variable
@@ -136,14 +159,20 @@ void odp_atomic_sub_u32(odp_atomic_u32_t *atom, uint32_t val);
*
* @return Value of the variable before the increment
*/
-uint32_t odp_atomic_fetch_inc_u32(odp_atomic_u32_t *atom);
+static inline uint32_t odp_atomic_fetch_inc_u32(odp_atomic_u32_t *atom)
+{
+ return __atomic_fetch_add(&atom->v, 1, __ATOMIC_RELAXED);
+}
/**
* Increment atomic uint32 variable
*
* @param atom Pointer to atomic variable
*/
-void odp_atomic_inc_u32(odp_atomic_u32_t *atom);
+static inline void odp_atomic_inc_u32(odp_atomic_u32_t *atom)
+{
+ (void)__atomic_fetch_add(&atom->v, 1, __ATOMIC_RELAXED);
+}
/**
* Fetch and decrement atomic uint32 variable
@@ -152,36 +181,20 @@ void odp_atomic_inc_u32(odp_atomic_u32_t *atom);
*
* @return Value of the variable before the subtraction
*/
-uint32_t odp_atomic_fetch_dec_u32(odp_atomic_u32_t *atom);
+static inline uint32_t odp_atomic_fetch_dec_u32(odp_atomic_u32_t *atom)
+{
+ return __atomic_fetch_sub(&atom->v, 1, __ATOMIC_RELAXED);
+}
/**
* Decrement atomic uint32 variable
*
* @param atom Pointer to atomic variable
*/
-void odp_atomic_dec_u32(odp_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 odp_atomic_max_u32(odp_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 odp_atomic_min_u32(odp_atomic_u32_t *atom, uint32_t new_min);
+static inline void odp_atomic_dec_u32(odp_atomic_u32_t *atom)
+{
+ (void)__atomic_fetch_sub(&atom->v, 1, __ATOMIC_RELAXED);
+}
/**
* Compare and swap atomic uint32 variable
@@ -199,8 +212,14 @@ void odp_atomic_min_u32(odp_atomic_u32_t *atom, uint32_t new_min);
* @return 0 on failure, !0 on success
*
*/
-int odp_atomic_cas_u32(odp_atomic_u32_t *atom, uint32_t *old_val,
- uint32_t new_val);
+static inline int odp_atomic_cas_u32(odp_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);
+}
/**
* Exchange value of atomic uint32 variable
@@ -213,13 +232,95 @@ int odp_atomic_cas_u32(odp_atomic_u32_t *atom, uint32_t *old_val,
*
* @return Value of the variable before the operation
*/
-uint32_t odp_atomic_xchg_u32(odp_atomic_u32_t *atom, uint32_t new_val);
+static inline uint32_t odp_atomic_xchg_u32(odp_atomic_u32_t *atom,
+ uint32_t new_val)
+{
+ return __atomic_exchange_n(&atom->v, new_val, __ATOMIC_RELAXED);
+}
+
+/**
+ * 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
+ */
+static inline void odp_atomic_max_u32(odp_atomic_u32_t *atom, uint32_t new_max)
+{
+ uint32_t old_val;
+
+ old_val = odp_atomic_load_u32(atom);
+
+ while (new_max > old_val) {
+ if (odp_atomic_cas_u32(atom, &old_val, new_max))
+ break;
+ }
+}
+
+/**
+ * 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
+ */
+static inline void odp_atomic_min_u32(odp_atomic_u32_t *atom, uint32_t new_min)
+{
+ uint32_t old_val;
+
+ old_val = odp_atomic_load_u32(atom);
+
+ while (new_min < old_val) {
+ if (odp_atomic_cas_u32(atom, &old_val, new_min))
+ break;
+ }
+}
/*
* 64-bit operations in RELAXED memory ordering
* --------------------------------------------
*/
+#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
+
/**
* Initialize atomic uint64 variable
*
@@ -230,7 +331,13 @@ uint32_t odp_atomic_xchg_u32(odp_atomic_u32_t *atom, uint32_t new_val);
* @param atom Pointer to atomic variable
* @param val Value to initialize the variable with
*/
-void odp_atomic_init_u64(odp_atomic_u64_t *atom, uint64_t val);
+static inline void odp_atomic_init_u64(odp_atomic_u64_t *atom, uint64_t val)
+{
+ atom->v = val;
+#if __GCC_ATOMIC_LLONG_LOCK_FREE < 2
+ __atomic_clear(&atom->lock, __ATOMIC_RELAXED);
+#endif
+}
/**
* Load value of atomic uint64 variable
@@ -239,7 +346,14 @@ void odp_atomic_init_u64(odp_atomic_u64_t *atom, uint64_t val);
*
* @return Value of the variable
*/
-uint64_t odp_atomic_load_u64(odp_atomic_u64_t *atom);
+static inline uint64_t odp_atomic_load_u64(odp_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
+}
/**
* Store value to atomic uint64 variable
@@ -247,7 +361,14 @@ uint64_t odp_atomic_load_u64(odp_atomic_u64_t *atom);
* @param atom Pointer to atomic variable
* @param val Value to store in the variable
*/
-void odp_atomic_store_u64(odp_atomic_u64_t *atom, uint64_t val);
+static inline void odp_atomic_store_u64(odp_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
+}
/**
* Fetch and add to atomic uint64 variable
@@ -257,7 +378,15 @@ void odp_atomic_store_u64(odp_atomic_u64_t *atom, uint64_t val);
*
* @return Value of the variable before the addition
*/
-uint64_t odp_atomic_fetch_add_u64(odp_atomic_u64_t *atom, uint64_t val);
+static inline uint64_t odp_atomic_fetch_add_u64(odp_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
+}
/**
* Add to atomic uint64 variable
@@ -265,7 +394,14 @@ uint64_t odp_atomic_fetch_add_u64(odp_atomic_u64_t *atom, uint64_t val);
* @param atom Pointer to atomic variable
* @param val Value to be added to the variable
*/
-void odp_atomic_add_u64(odp_atomic_u64_t *atom, uint64_t val);
+static inline void odp_atomic_add_u64(odp_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
+}
/**
* Fetch and subtract from atomic uint64 variable
@@ -275,7 +411,15 @@ void odp_atomic_add_u64(odp_atomic_u64_t *atom, uint64_t val);
*
* @return Value of the variable before the subtraction
*/
-uint64_t odp_atomic_fetch_sub_u64(odp_atomic_u64_t *atom, uint64_t val);
+static inline uint64_t odp_atomic_fetch_sub_u64(odp_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
+}
/**
* Subtract from atomic uint64 variable
@@ -283,7 +427,14 @@ uint64_t odp_atomic_fetch_sub_u64(odp_atomic_u64_t *atom, uint64_t val);
* @param atom Pointer to atomic variable
* @param val Value to be subtracted from the variable
*/
-void odp_atomic_sub_u64(odp_atomic_u64_t *atom, uint64_t val);
+static inline void odp_atomic_sub_u64(odp_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
+}
/**
* Fetch and increment atomic uint64 variable
@@ -292,14 +443,28 @@ void odp_atomic_sub_u64(odp_atomic_u64_t *atom, uint64_t val);
*
* @return Value of the variable before the increment
*/
-uint64_t odp_atomic_fetch_inc_u64(odp_atomic_u64_t *atom);
+static inline uint64_t odp_atomic_fetch_inc_u64(odp_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
+}
/**
* Increment atomic uint64 variable
*
* @param atom Pointer to atomic variable
*/
-void odp_atomic_inc_u64(odp_atomic_u64_t *atom);
+static inline void odp_atomic_inc_u64(odp_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
+}
/**
* Fetch and decrement atomic uint64 variable
@@ -308,36 +473,28 @@ void odp_atomic_inc_u64(odp_atomic_u64_t *atom);
*
* @return Value of the variable before the decrement
*/
-uint64_t odp_atomic_fetch_dec_u64(odp_atomic_u64_t *atom);
+static inline uint64_t odp_atomic_fetch_dec_u64(odp_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
+}
/**
* Decrement atomic uint64 variable
*
* @param atom Pointer to atomic variable
*/
-void odp_atomic_dec_u64(odp_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 odp_atomic_max_u64(odp_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 odp_atomic_min_u64(odp_atomic_u64_t *atom, uint64_t new_min);
+static inline void odp_atomic_dec_u64(odp_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
+}
/**
* Compare and swap atomic uint64 variable
@@ -354,8 +511,20 @@ void odp_atomic_min_u64(odp_atomic_u64_t *atom, uint64_t new_min);
*
* @return 0 on failure, !0 on success
*/
-int odp_atomic_cas_u64(odp_atomic_u64_t *atom, uint64_t *old_val,
- uint64_t new_val);
+static inline int odp_atomic_cas_u64(odp_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
+}
/**
* Exchange value of atomic uint64 variable
@@ -368,7 +537,57 @@ int odp_atomic_cas_u64(odp_atomic_u64_t *atom, uint64_t *old_val,
*
* @return Value of the variable before the operation
*/
-uint64_t odp_atomic_xchg_u64(odp_atomic_u64_t *atom, uint64_t new_val);
+static inline uint64_t odp_atomic_xchg_u64(odp_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
+}
+
+/**
+ * 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
+ */
+static inline void odp_atomic_max_u64(odp_atomic_u64_t *atom, uint64_t new_max)
+{
+ uint64_t old_val;
+
+ old_val = odp_atomic_load_u64(atom);
+
+ while (new_max > old_val) {
+ if (odp_atomic_cas_u64(atom, &old_val, new_max))
+ break;
+ }
+}
+
+/**
+ * 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
+ */
+static inline void odp_atomic_min_u64(odp_atomic_u64_t *atom, uint64_t new_min)
+{
+ uint64_t old_val;
+
+ old_val = odp_atomic_load_u64(atom);
+
+ while (new_min < old_val) {
+ if (odp_atomic_cas_u64(atom, &old_val, new_min))
+ break;
+ }
+}
/*
* 32-bit operations in non-RELAXED memory ordering
@@ -385,7 +604,10 @@ uint64_t odp_atomic_xchg_u64(odp_atomic_u64_t *atom, uint64_t new_val);
*
* @return Value of the variable
*/
-uint32_t odp_atomic_load_acq_u32(odp_atomic_u32_t *atom);
+static inline uint32_t odp_atomic_load_acq_u32(odp_atomic_u32_t *atom)
+{
+ return __atomic_load_n(&atom->v, __ATOMIC_ACQUIRE);
+}
/**
* Store value to atomic uint32 variable using RELEASE memory ordering
@@ -396,7 +618,11 @@ uint32_t odp_atomic_load_acq_u32(odp_atomic_u32_t *atom);
* @param atom Pointer to atomic variable
* @param val Value to store in the variable
*/
-void odp_atomic_store_rel_u32(odp_atomic_u32_t *atom, uint32_t val);
+static inline void odp_atomic_store_rel_u32(odp_atomic_u32_t *atom,
+ uint32_t val)
+{
+ __atomic_store_n(&atom->v, val, __ATOMIC_RELEASE);
+}
/**
* Add to atomic uint32 variable using RELEASE memory ordering
@@ -407,7 +633,10 @@ void odp_atomic_store_rel_u32(odp_atomic_u32_t *atom, uint32_t val);
* @param atom Pointer to atomic variable
* @param val Value to be added to the variable
*/
-void odp_atomic_add_rel_u32(odp_atomic_u32_t *atom, uint32_t val);
+static inline void odp_atomic_add_rel_u32(odp_atomic_u32_t *atom, uint32_t val)
+{
+ (void)__atomic_fetch_add(&atom->v, val, __ATOMIC_RELEASE);
+}
/**
* Subtract from atomic uint32 variable using RELEASE memory ordering
@@ -418,7 +647,10 @@ void odp_atomic_add_rel_u32(odp_atomic_u32_t *atom, uint32_t val);
* @param atom Pointer to atomic variable
* @param val Value to be subtracted from the variable
*/
-void odp_atomic_sub_rel_u32(odp_atomic_u32_t *atom, uint32_t val);
+static inline void odp_atomic_sub_rel_u32(odp_atomic_u32_t *atom, uint32_t val)
+{
+ (void)__atomic_fetch_sub(&atom->v, val, __ATOMIC_RELEASE);
+}
/**
* Compare and swap atomic uint32 variable using ACQUIRE memory ordering
@@ -433,8 +665,14 @@ void odp_atomic_sub_rel_u32(odp_atomic_u32_t *atom, uint32_t val);
*
* @return 0 on failure, !0 on success
*/
-int odp_atomic_cas_acq_u32(odp_atomic_u32_t *atom, uint32_t *old_val,
- uint32_t new_val);
+static inline int odp_atomic_cas_acq_u32(odp_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);
+}
/**
* Compare and swap atomic uint32 variable using RELEASE memory ordering
@@ -449,8 +687,14 @@ int odp_atomic_cas_acq_u32(odp_atomic_u32_t *atom, uint32_t *old_val,
*
* @return 0 on failure, !0 on success
*/
-int odp_atomic_cas_rel_u32(odp_atomic_u32_t *atom, uint32_t *old_val,
- uint32_t new_val);
+static inline int odp_atomic_cas_rel_u32(odp_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);
+}
/**
* Compare and swap atomic uint32 variable using ACQUIRE-and-RELEASE memory
@@ -466,8 +710,15 @@ int odp_atomic_cas_rel_u32(odp_atomic_u32_t *atom, uint32_t *old_val,
*
* @return 0 on failure, !0 on success
*/
-int odp_atomic_cas_acq_rel_u32(odp_atomic_u32_t *atom, uint32_t *old_val,
- uint32_t new_val);
+static inline int odp_atomic_cas_acq_rel_u32(odp_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);
+}
/*
* 64-bit operations in non-RELAXED memory ordering
@@ -484,7 +735,14 @@ int odp_atomic_cas_acq_rel_u32(odp_atomic_u32_t *atom, uint32_t *old_val,
*
* @return Value of the variable
*/
-uint64_t odp_atomic_load_acq_u64(odp_atomic_u64_t *atom);
+static inline uint64_t odp_atomic_load_acq_u64(odp_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
+}
/**
* Store value to atomic uint64 variable using RELEASE memory ordering
@@ -495,7 +753,15 @@ uint64_t odp_atomic_load_acq_u64(odp_atomic_u64_t *atom);
* @param atom Pointer to atomic variable
* @param val Value to store in the variable
*/
-void odp_atomic_store_rel_u64(odp_atomic_u64_t *atom, uint64_t val);
+static inline void odp_atomic_store_rel_u64(odp_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
+}
/**
* Add to atomic uint64 variable using RELEASE memory ordering
@@ -506,7 +772,14 @@ void odp_atomic_store_rel_u64(odp_atomic_u64_t *atom, uint64_t val);
* @param atom Pointer to atomic variable
* @param val Value to be added to the variable
*/
-void odp_atomic_add_rel_u64(odp_atomic_u64_t *atom, uint64_t val);
+static inline void odp_atomic_add_rel_u64(odp_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
+}
/**
* Subtract from atomic uint64 variable using RELEASE memory ordering
@@ -517,7 +790,14 @@ void odp_atomic_add_rel_u64(odp_atomic_u64_t *atom, uint64_t val);
* @param atom Pointer to atomic variable
* @param val Value to be subtracted from the variable
*/
-void odp_atomic_sub_rel_u64(odp_atomic_u64_t *atom, uint64_t val);
+static inline void odp_atomic_sub_rel_u64(odp_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
+}
/**
* Compare and swap atomic uint64 variable using ACQUIRE memory ordering
@@ -532,8 +812,20 @@ void odp_atomic_sub_rel_u64(odp_atomic_u64_t *atom, uint64_t val);
*
* @return 0 on failure, !0 on success
*/
-int odp_atomic_cas_acq_u64(odp_atomic_u64_t *atom, uint64_t *old_val,
- uint64_t new_val);
+static inline int odp_atomic_cas_acq_u64(odp_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
+}
/**
* Compare and swap atomic uint64 variable using RELEASE memory ordering
@@ -548,8 +840,20 @@ int odp_atomic_cas_acq_u64(odp_atomic_u64_t *atom, uint64_t *old_val,
*
* @return 0 on failure, !0 on success
*/
-int odp_atomic_cas_rel_u64(odp_atomic_u64_t *atom, uint64_t *old_val,
- uint64_t new_val);
+static inline int odp_atomic_cas_rel_u64(odp_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
+}
/**
* Compare and swap atomic uint64 variable using ACQUIRE-and-RELEASE memory
@@ -565,8 +869,21 @@ int odp_atomic_cas_rel_u64(odp_atomic_u64_t *atom, uint64_t *old_val,
*
* @return 0 on failure, !0 on success
*/
-int odp_atomic_cas_acq_rel_u64(odp_atomic_u64_t *atom, uint64_t *old_val,
- uint64_t new_val);
+static inline int odp_atomic_cas_acq_rel_u64(odp_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
+}
/**
* Atomic operations
@@ -159,7 +159,10 @@ void odp_buffer_print(odp_buffer_t buf);
* to enable applications to generate a printable value that represents
* an odp_buffer_t handle.
*/
-uint64_t odp_buffer_to_u64(odp_buffer_t hdl);
+static inline uint64_t odp_buffer_to_u64(odp_buffer_t hdl)
+{
+ return _odp_pri(hdl);
+}
/**
* @}
@@ -24,6 +24,18 @@ extern "C" {
* @{
*/
+#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
+
/**
* @def ODP_BIG_ENDIAN
* Big endian byte order
@@ -44,6 +56,22 @@ extern "C" {
* Selected bitfield order
*/
+#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
+ #define ODP_LITTLE_ENDIAN 1
+ #define ODP_BIG_ENDIAN 0
+ #define ODP_BYTE_ORDER ODP_LITTLE_ENDIAN
+ #define ODP_LITTLE_ENDIAN_BITFIELD 1
+ #define ODP_BIG_ENDIAN_BITFIELD 0
+ #define ODP_BITFIELD_ORDER ODP_LITTLE_ENDIAN_BITFIELD
+#else
+ #define ODP_LITTLE_ENDIAN 0
+ #define ODP_BIG_ENDIAN 1
+ #define ODP_BYTE_ORDER ODP_BIG_ENDIAN
+ #define ODP_LITTLE_ENDIAN_BITFIELD 0
+ #define ODP_BIG_ENDIAN_BITFIELD 1
+ #define ODP_BITFIELD_ORDER ODP_BIG_ENDIAN_BITFIELD
+#endif
+
/**
* @typedef odp_u16le_t
* unsigned 16bit little endian
@@ -79,21 +107,42 @@ extern "C" {
* @param be16 big endian 16bit
* @return cpu native uint16_t
*/
-uint16_t odp_be_to_cpu_16(odp_u16be_t be16);
+static inline uint16_t odp_be_to_cpu_16(odp_u16be_t be16)
+{
+#if ODP_BYTE_ORDER == ODP_LITTLE_ENDIAN
+ return __odp_builtin_bswap16((__odp_force uint16_t)be16);
+#else
+ return (__odp_force uint16_t)be16;
+#endif
+}
/**
* Convert 32bit big endian to cpu native uint32_t
* @param be32 big endian 32bit
* @return cpu native uint32_t
*/
-uint32_t odp_be_to_cpu_32(odp_u32be_t be32);
+static inline uint32_t odp_be_to_cpu_32(odp_u32be_t be32)
+{
+#if ODP_BYTE_ORDER == ODP_LITTLE_ENDIAN
+ return __builtin_bswap32((__odp_force uint32_t)be32);
+#else
+ return (__odp_force uint32_t)be32;
+#endif
+}
/**
* Convert 64bit big endian to cpu native uint64_t
* @param be64 big endian 64bit
* @return cpu native uint64_t
*/
-uint64_t odp_be_to_cpu_64(odp_u64be_t be64);
+static inline uint64_t odp_be_to_cpu_64(odp_u64be_t be64)
+{
+#if ODP_BYTE_ORDER == ODP_LITTLE_ENDIAN
+ return __builtin_bswap64((__odp_force uint64_t)be64);
+#else
+ return (__odp_force uint64_t)be64;
+#endif
+}
/*
@@ -105,22 +154,42 @@ uint64_t odp_be_to_cpu_64(odp_u64be_t be64);
* @param cpu16 uint16_t in cpu native format
* @return big endian 16bit
*/
-odp_u16be_t odp_cpu_to_be_16(uint16_t cpu16);
+static inline odp_u16be_t odp_cpu_to_be_16(uint16_t cpu16)
+{
+#if ODP_BYTE_ORDER == ODP_LITTLE_ENDIAN
+ return (__odp_force odp_u16be_t)__odp_builtin_bswap16(cpu16);
+#else
+ return (__odp_force odp_u16be_t)cpu16;
+#endif
+}
/**
* Convert cpu native uint32_t to 32bit big endian
* @param cpu32 uint32_t in cpu native format
* @return big endian 32bit
*/
-odp_u32be_t odp_cpu_to_be_32(uint32_t cpu32);
+static inline odp_u32be_t odp_cpu_to_be_32(uint32_t cpu32)
+{
+#if ODP_BYTE_ORDER == ODP_LITTLE_ENDIAN
+ return (__odp_force odp_u32be_t)__builtin_bswap32(cpu32);
+#else
+ return (__odp_force odp_u32be_t)cpu32;
+#endif
+}
/**
* Convert cpu native uint64_t to 64bit big endian
* @param cpu64 uint64_t in cpu native format
* @return big endian 64bit
*/
-odp_u64be_t odp_cpu_to_be_64(uint64_t cpu64);
-
+static inline odp_u64be_t odp_cpu_to_be_64(uint64_t cpu64)
+{
+#if ODP_BYTE_ORDER == ODP_LITTLE_ENDIAN
+ return (__odp_force odp_u64be_t)__builtin_bswap64(cpu64);
+#else
+ return (__odp_force odp_u64be_t)cpu64;
+#endif
+}
/*
* Little Endian -> CPU byte order:
@@ -131,22 +200,42 @@ odp_u64be_t odp_cpu_to_be_64(uint64_t cpu64);
* @param le16 little endian 16bit
* @return cpu native uint16_t
*/
-uint16_t odp_le_to_cpu_16(odp_u16le_t le16);
+static inline uint16_t odp_le_to_cpu_16(odp_u16le_t le16)
+{
+#if ODP_BYTE_ORDER == ODP_LITTLE_ENDIAN
+ return (__odp_force uint16_t)le16;
+#else
+ return __odp_builtin_bswap16((__odp_force uint16_t)le16);
+#endif
+}
/**
* Convert 32bit little endian to cpu native uint32_t
* @param le32 little endian 32bit
* @return cpu native uint32_t
*/
-uint32_t odp_le_to_cpu_32(odp_u32le_t le32);
+static inline uint32_t odp_le_to_cpu_32(odp_u32le_t le32)
+{
+#if ODP_BYTE_ORDER == ODP_LITTLE_ENDIAN
+ return (__odp_force uint32_t)le32;
+#else
+ return __builtin_bswap32((__odp_force uint32_t)le32);
+#endif
+}
/**
* Convert 64bit little endian to cpu native uint64_t
* @param le64 little endian 64bit
* @return cpu native uint64_t
*/
-uint64_t odp_le_to_cpu_64(odp_u64le_t le64);
-
+static inline uint64_t odp_le_to_cpu_64(odp_u64le_t le64)
+{
+#if ODP_BYTE_ORDER == ODP_LITTLE_ENDIAN
+ return (__odp_force uint64_t)le64;
+#else
+ return __builtin_bswap64((__odp_force uint64_t)le64);
+#endif
+}
/*
* CPU byte order -> Little Endian:
@@ -157,21 +246,42 @@ uint64_t odp_le_to_cpu_64(odp_u64le_t le64);
* @param cpu16 uint16_t in cpu native format
* @return little endian 16bit
*/
-odp_u16le_t odp_cpu_to_le_16(uint16_t cpu16);
+static inline odp_u16le_t odp_cpu_to_le_16(uint16_t cpu16)
+{
+#if ODP_BYTE_ORDER == ODP_LITTLE_ENDIAN
+ return (__odp_force odp_u16le_t)cpu16;
+#else
+ return (__odp_force odp_u16le_t)__odp_builtin_bswap16(cpu16);
+#endif
+}
/**
* Convert cpu native uint32_t to 32bit little endian
* @param cpu32 uint32_t in cpu native format
* @return little endian 32bit
*/
-odp_u32le_t odp_cpu_to_le_32(uint32_t cpu32);
+static inline odp_u32le_t odp_cpu_to_le_32(uint32_t cpu32)
+{
+#if ODP_BYTE_ORDER == ODP_LITTLE_ENDIAN
+ return (__odp_force odp_u32le_t)cpu32;
+#else
+ return (__odp_force odp_u32le_t)__builtin_bswap32(cpu32);
+#endif
+}
/**
* Convert cpu native uint64_t to 64bit little endian
* @param cpu64 uint64_t in cpu native format
* @return little endian 64bit
*/
-odp_u64le_t odp_cpu_to_le_64(uint64_t cpu64);
+static inline odp_u64le_t odp_cpu_to_le_64(uint64_t cpu64)
+{
+#if ODP_BYTE_ORDER == ODP_LITTLE_ENDIAN
+ return (__odp_force odp_u64le_t)cpu64;
+#else
+ return (__odp_force odp_u64le_t)__builtin_bswap64(cpu64);
+#endif
+}
/**
* @}
@@ -478,7 +478,10 @@ odp_pool_t odp_cls_cos_pool(odp_cos_t cos_id);
* to enable applications to generate a printable value that represents
* an odp_cos_t handle.
*/
-uint64_t odp_cos_to_u64(odp_cos_t hdl);
+static inline uint64_t odp_cos_to_u64(odp_cos_t hdl)
+{
+ return _odp_pri(hdl);
+}
/**
* Get printable value for an odp_pmr_t
@@ -491,7 +494,10 @@ uint64_t odp_cos_to_u64(odp_cos_t hdl);
* to enable applications to generate a printable value that represents
* an odp_pmr_t handle.
*/
-uint64_t odp_pmr_to_u64(odp_pmr_t hdl);
+static inline uint64_t odp_pmr_to_u64(odp_pmr_t hdl)
+{
+ return _odp_pri(hdl);
+}
/**
* @}
@@ -19,8 +19,6 @@
extern "C" {
#endif
-#include <odp/api/std_types.h>
-
/** @defgroup odp_cpu ODP CPU
* @{
*/
@@ -167,7 +165,24 @@ uint64_t odp_cpu_cycles_resolution(void);
* pause within the loop may save energy and improve system performance as
* CPU polling frequency is reduced.
*/
-void odp_cpu_pause(void);
+static inline void odp_cpu_pause(void)
+{
+#if defined(__x86_64__)
+#ifdef __SSE2__
+ __asm volatile("pause");
+#else
+ __asm volatile("rep; nop");
+#endif
+#elif defined(__mips64__)
+ __asm volatile("nop");
+ __asm volatile("nop");
+ __asm volatile("nop");
+ __asm volatile("nop");
+ __asm volatile("nop");
+#else
+ /* .. */
+#endif
+}
/**
* @}
@@ -640,7 +640,10 @@ void odp_crypto_compl_result(odp_crypto_compl_t completion_event,
* to enable applications to generate a printable value that represents
* an odp_crypto_session_t handle.
*/
-uint64_t odp_crypto_session_to_u64(odp_crypto_session_t hdl);
+static inline uint64_t odp_crypto_session_to_u64(odp_crypto_session_t hdl)
+{
+ return (uint64_t)hdl;
+}
/**
* Get printable value for an odp_crypto_compl_t
@@ -653,7 +656,10 @@ uint64_t odp_crypto_session_to_u64(odp_crypto_session_t hdl);
* to enable applications to generate a printable value that represents
* an odp_crypto_compl_t handle.
*/
-uint64_t odp_crypto_compl_to_u64(odp_crypto_compl_t hdl);
+static inline uint64_t odp_crypto_compl_to_u64(odp_crypto_compl_t hdl)
+{
+ return _odp_pri(hdl);
+}
/**
* Initialize crypto session parameters
@@ -27,6 +27,27 @@ extern "C" {
*
* @param msg Compile time error message to be displayed if cond is false
*/
+#if defined(__GNUC__) && !defined(__clang__)
+
+#if __GNUC__ < 4 || (__GNUC__ == 4 && (__GNUC_MINOR__ < 6))
+
+/**
+ * @internal _Static_assert was only added in GCC 4.6. Provide a weak replacement
+ * for previous versions.
+ */
+#define _Static_assert(e, s) (extern int (*static_assert_checker(void)) \
+ [sizeof(struct { unsigned int error_if_negative:(e) ? 1 : -1; })])
+
+#endif
+
+#endif
+
+/**
+ * @internal Compile time assertion macro. Fails compilation and outputs 'msg'
+ * if condition 'cond' is false. Macro definition is empty when compiler is not
+ * supported or the compiler does not support static assertion.
+ */
+#define ODP_STATIC_ASSERT(cond, msg) _Static_assert(cond, msg)
#ifdef __cplusplus
}
@@ -37,10 +37,13 @@ extern "C" {
/**
* @typedef odp_event_type_t
- * ODP event types:
- * ODP_EVENT_BUFFER, ODP_EVENT_PACKET, ODP_EVENT_TIMEOUT,
- * ODP_EVENT_CRYPTO_COMPL
*/
+typedef enum odp_event_type_t {
+ ODP_EVENT_BUFFER = 1,
+ ODP_EVENT_PACKET = 2,
+ ODP_EVENT_TIMEOUT = 3,
+ ODP_EVENT_CRYPTO_COMPL = 4,
+} odp_event_type_t;
/**
* Get event type
@@ -62,7 +65,10 @@ odp_event_type_t odp_event_type(odp_event_t event);
* to enable applications to generate a printable value that represents
* an odp_event_t handle.
*/
-uint64_t odp_event_to_u64(odp_event_t hdl);
+static inline uint64_t odp_event_to_u64(odp_event_t hdl)
+{
+ return _odp_pri(hdl);
+}
/**
* Free event
@@ -18,8 +18,6 @@
extern "C" {
#endif
-#include <odp/api/std_types.h>
-
/** @defgroup odp_hash ODP HASH FUNCTIONS
* ODP Hash functions
* @{
@@ -27,11 +27,6 @@
extern "C" {
#endif
-#include <odp/api/std_types.h>
-#include <odp/api/hints.h>
-#include <odp/api/thread.h>
-#include <odp/api/cpumask.h>
-
/** @defgroup odp_initialization ODP INITIALIZATION
* Initialisation operations.
* @{
@@ -19,8 +19,6 @@
extern "C" {
#endif
-#include <odp/api/time.h>
-
/** @defgroup odp_packet ODP PACKET
* Operations on a packet.
* @{
@@ -55,6 +53,13 @@ extern "C" {
* @typedef odp_packet_color_t
* Color of packet for shaper/drop processing
*/
+typedef enum {
+ ODP_PACKET_GREEN = 0,
+ ODP_PACKET_YELLOW = 1,
+ ODP_PACKET_RED = 2,
+ ODP_PACKET_ALL_COLORS = 3,
+} odp_packet_color_t;
+#define ODP_NUM_PACKET_COLORS 3
/**
* @def ODP_PACKET_GREEN
@@ -1384,7 +1389,10 @@ int odp_packet_is_valid(odp_packet_t pkt);
* to enable applications to generate a printable value that represents
* an odp_packet_t handle.
*/
-uint64_t odp_packet_to_u64(odp_packet_t hdl);
+static inline uint64_t odp_packet_to_u64(odp_packet_t hdl)
+{
+ return _odp_pri(hdl);
+}
/**
* Get printable value for an odp_packet_seg_t
@@ -1397,7 +1405,10 @@ uint64_t odp_packet_to_u64(odp_packet_t hdl);
* to enable applications to generate a printable value that represents
* an odp_packet_seg_t handle.
*/
-uint64_t odp_packet_seg_to_u64(odp_packet_seg_t hdl);
+static inline uint64_t odp_packet_seg_to_u64(odp_packet_seg_t hdl)
+{
+ return _odp_pri(hdl);
+}
/**
* @}
@@ -19,9 +19,6 @@
extern "C" {
#endif
-#include <odp/api/std_types.h>
-#include <odp/api/packet.h>
-
/** @addtogroup odp_packet
* Boolean operations on a packet.
* @{
@@ -19,10 +19,6 @@
extern "C" {
#endif
-#include <odp/api/packet_io_stats.h>
-#include <odp/api/queue.h>
-#include <odp/api/time.h>
-
/** @defgroup odp_packet_io ODP PACKET IO
* Operations on a packet Input/Output interface.
*
@@ -48,11 +44,19 @@ extern "C" {
* @typedef odp_pktin_queue_t
* Direct packet input queue handle
*/
+typedef struct odp_pktin_queue_t {
+ odp_pktio_t pktio; /**< pktio handle */
+ int index; /**< pktio queue index */
+} odp_pktin_queue_t;
/**
* @typedef odp_pktout_queue_t
* Direct packet output queue handle
*/
+typedef struct odp_pktout_queue_t {
+ odp_pktio_t pktio; /**< pktio handle */
+ int index; /**< pktio queue index */
+} odp_pktout_queue_t;
/**
* @def ODP_PKTIO_INVALID
@@ -64,16 +68,19 @@ extern "C" {
* Minimum size of output buffer for odp_pktio_mac_addr()
* Actual MAC address sizes may be different.
*/
+#define ODP_PKTIO_MACADDR_MAXSIZE 16
/**
* @def ODP_PKTIN_NO_WAIT
* Do not wait on packet input
*/
+#define ODP_PKTIN_NO_WAIT 0
/**
* @def ODP_PKTIN_WAIT
* Wait infinitely on packet input
*/
+#define ODP_PKTIN_WAIT UINT64_MAX
/**
* Packet input mode
@@ -957,7 +964,10 @@ int odp_pktio_index(odp_pktio_t pktio);
* to enable applications to generate a printable value that represents
* an odp_pktio_t handle.
*/
-uint64_t odp_pktio_to_u64(odp_pktio_t pktio);
+static inline uint64_t odp_pktio_to_u64(odp_pktio_t hdl)
+{
+ return _odp_pri(hdl);
+}
/**
* Initialize pktio params
@@ -23,90 +23,6 @@ extern "C" {
*/
/**
- * Packet IO statistics
- *
- * Packet IO statistics counters follow RFCs for Management Information Base
- * (MIB)for use with network management protocols in the Internet community:
- * https://tools.ietf.org/html/rfc3635
- * https://tools.ietf.org/html/rfc2863
- * https://tools.ietf.org/html/rfc2819
- */
-typedef struct odp_pktio_stats_t {
- /**
- * The number of octets in valid MAC frames received on this interface,
- * including the MAC header and FCS. See ifHCInOctets counter
- * description in RFC 3635 for details.
- */
- uint64_t in_octets;
-
- /**
- * The number of packets, delivered by this sub-layer to a higher
- * (sub-)layer, which were not addressed to a multicast or broadcast
- * address at this sub-layer. See ifHCInUcastPkts in RFC 2863, RFC 3635.
- */
- uint64_t in_ucast_pkts;
-
- /**
- * The number of inbound packets which were chosen to be discarded
- * even though no errors had been detected to prevent their being
- * deliverable to a higher-layer protocol. One possible reason for
- * discarding such a packet could be to free up buffer space.
- * See ifInDiscards in RFC 2863.
- */
- uint64_t in_discards;
-
- /**
- * The sum for this interface of AlignmentErrors, FCSErrors, FrameTooLongs,
- * InternalMacReceiveErrors. See ifInErrors in RFC 3635.
- */
- uint64_t in_errors;
-
- /**
- * For packet-oriented interfaces, the number of packets received via
- * the interface which were discarded because of an unknown or
- * unsupported protocol. For character-oriented or fixed-length
- * interfaces that support protocol multiplexing the number of
- * transmission units received via the interface which were discarded
- * because of an unknown or unsupported protocol. For any interface
- * that does not support protocol multiplexing, this counter will always
- * be 0. See ifInUnknownProtos in RFC 2863, RFC 3635.
- */
- uint64_t in_unknown_protos;
-
- /**
- * The number of octets transmitted in valid MAC frames on this
- * interface, including the MAC header and FCS. This does include
- * the number of octets in valid MAC Control frames transmitted on
- * this interface. See ifHCOutOctets in RFC 3635.
- */
- uint64_t out_octets;
-
- /**
- * The total number of packets that higher-level protocols requested
- * be transmitted, and which were not addressed to a multicast or
- * broadcast address at this sub-layer, including those that were
- * discarded or not sent. does not include MAC Control frames.
- * See ifHCOutUcastPkts RFC 2863, 3635.
- */
- uint64_t out_ucast_pkts;
-
- /**
- * The number of outbound packets which were chosen to be discarded
- * even though no errors had been detected to prevent their being
- * transmitted. One possible reason for discarding such a packet could
- * be to free up buffer space. See OutDiscards in RFC 2863.
- */
- uint64_t out_discards;
-
- /**
- * The sum for this interface of SQETestErrors, LateCollisions,
- * ExcessiveCollisions, InternalMacTransmitErrors and
- * CarrierSenseErrors. See ifOutErrors in RFC 3635.
- */
- uint64_t out_errors;
-} odp_pktio_stats_t;
-
-/**
* Get statistics for pktio handle
*
* @param pktio Packet IO handle
@@ -19,8 +19,6 @@
extern "C" {
#endif
-#include <odp/api/std_types.h>
-
/** @defgroup odp_pool ODP POOL
* Operations on a pool.
* @{
@@ -19,9 +19,6 @@
extern "C" {
#endif
-#include <odp/api/schedule_types.h>
-#include <odp/api/event.h>
-
/** @defgroup odp_queue ODP QUEUE
* Macros and operation on a queue.
* @{
@@ -66,6 +63,13 @@ typedef enum odp_queue_type_t {
} odp_queue_type_t;
/**
+ * @def ODP_QUEUE_TYPE_TM
+ * Traffic manager queue
+ * @note Internal to the implementation -- not part of queue type API
+ */
+#define ODP_QUEUE_TYPE_TM 4
+
+/**
* Queue operation mode
*/
typedef enum odp_queue_op_mode_t {
@@ -372,7 +376,10 @@ int odp_queue_lock_count(odp_queue_t queue);
* to enable applications to generate a printable value that represents
* an odp_queue_t handle.
*/
-uint64_t odp_queue_to_u64(odp_queue_t hdl);
+static inline uint64_t odp_queue_to_u64(odp_queue_t hdl)
+{
+ return _odp_pri(hdl);
+}
/**
* Initialize queue params
@@ -19,12 +19,6 @@
extern "C" {
#endif
-#include <odp/api/std_types.h>
-#include <odp/api/event.h>
-#include <odp/api/queue.h>
-#include <odp/api/schedule_types.h>
-#include <odp/api/thrmask.h>
-
/** @defgroup odp_scheduler ODP SCHEDULER
* Operations on the scheduler.
* @{
@@ -34,11 +28,13 @@ extern "C" {
* @def ODP_SCHED_WAIT
* Wait infinitely
*/
+#define ODP_SCHED_WAIT UINT64_MAX
/**
* @def ODP_SCHED_NO_WAIT
* Do not wait
*/
+#define ODP_SCHED_NO_WAIT 0
/**
* @def ODP_SCHED_GROUP_NAME_LEN
@@ -54,16 +50,19 @@ extern "C" {
* @def ODP_SCHED_GROUP_ALL
* Predefined scheduler group of all threads
*/
+#define ODP_SCHED_GROUP_ALL 0
/**
* @def ODP_SCHED_GROUP_WORKER
* Predefined scheduler group of all worker threads
*/
+#define ODP_SCHED_GROUP_WORKER 1
/**
* @def ODP_SCHED_GROUP_CONTROL
* Predefined scheduler group of all control threads
*/
+#define ODP_SCHED_GROUP_CONTROL 2
/**
* Schedule wait time
@@ -31,16 +31,19 @@ extern "C" {
* @def ODP_SCHED_PRIO_HIGHEST
* Highest scheduling priority
*/
+#define ODP_SCHED_PRIO_HIGHEST 0
/**
* @def ODP_SCHED_PRIO_NORMAL
* Normal scheduling priority
*/
+#define ODP_SCHED_PRIO_NORMAL 4
/**
* @def ODP_SCHED_PRIO_LOWEST
* Lowest scheduling priority
*/
+#define ODP_SCHED_PRIO_LOWEST 7
/**
* @def ODP_SCHED_PRIO_DEFAULT
@@ -48,6 +51,7 @@ extern "C" {
* level - throughput, load balancing and synchronization features are more
* important than priority scheduling.
*/
+#define ODP_SCHED_PRIO_DEFAULT ODP_SCHED_PRIO_NORMAL
/**
* @typedef odp_schedule_sync_t
@@ -64,6 +68,7 @@ extern "C" {
* for concurrent processing. Application is responsible for queue context
* synchronization and event ordering (SW synchronization).
*/
+#define ODP_SCHED_SYNC_PARALLEL 0
/**
* @def ODP_SCHED_SYNC_ATOMIC
@@ -80,6 +85,7 @@ extern "C" {
* context. User may allow the scheduler to release the context earlier than
* that by calling odp_schedule_release_atomic().
*/
+#define ODP_SCHED_SYNC_ATOMIC 1
/**
* @def ODP_SCHED_SYNC_ORDERED
@@ -106,6 +112,7 @@ extern "C" {
* reordering and are skipped at this time (but can be ordered again within
* another context).
*/
+#define ODP_SCHED_SYNC_ORDERED 2
/**
* @typedef odp_schedule_group_t
@@ -113,43 +120,6 @@ extern "C" {
*/
/**
- * @def ODP_SCHED_GROUP_ALL
- * Group of all threads. All active worker and control threads belong to this
- * group. The group is automatically updated when new threads enter or old
- * threads exit ODP.
- */
-
-/**
- * @def ODP_SCHED_GROUP_WORKER
- * Group of all worker threads. All active worker threads belong to this
- * group. The group is automatically updated when new worker threads enter or
- * old threads exit ODP.
- */
-
-/** Scheduler parameters */
-typedef struct odp_schedule_param_t {
- /** Priority level
- *
- * Default value is ODP_SCHED_PRIO_DEFAULT. */
- odp_schedule_prio_t prio;
-
- /** Synchronization method
- *
- * Default value is ODP_SCHED_SYNC_PARALLEL. */
- odp_schedule_sync_t sync;
-
- /** Thread group
- *
- * Default value is ODP_SCHED_GROUP_ALL. */
- odp_schedule_group_t group;
-
- /** Ordered lock count for this queue
- *
- * Default value is 0. */
- unsigned lock_count;
-} odp_schedule_param_t;
-
-/**
* @}
*/
@@ -14,7 +14,6 @@
#ifndef ODP_API_SHARED_MEMORY_H_
#define ODP_API_SHARED_MEMORY_H_
#include <odp/visibility_begin.h>
-#include <odp/api/init.h>
#ifdef __cplusplus
extern "C" {
@@ -215,7 +214,10 @@ void odp_shm_print_all(void);
* to enable applications to generate a printable value that represents
* an odp_shm_t handle.
*/
-uint64_t odp_shm_to_u64(odp_shm_t hdl);
+static inline uint64_t odp_shm_to_u64(odp_shm_t hdl)
+{
+ return _odp_pri(hdl);
+}
/**
* @}
@@ -14,6 +14,8 @@
#define ODP_API_STD_CLIB_H_
#include <odp/visibility_begin.h>
+#include <string.h>
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -38,7 +40,10 @@ extern "C" {
*
* @return 'dst' address
*/
-void *odp_memcpy(void *dst, const void *src, size_t num);
+static inline void *odp_memcpy(void *dst, const void *src, size_t num)
+{
+ return memcpy(dst, src, num);
+}
/**
* Memset
@@ -52,7 +57,10 @@ void *odp_memcpy(void *dst, const void *src, size_t num);
*
* @return 'ptr' address
*/
-void *odp_memset(void *ptr, int value, size_t num);
+static inline void *odp_memset(void *ptr, int value, size_t num)
+{
+ return memset(ptr, value, num);
+}
/**
* Memcmp
@@ -70,7 +78,10 @@ void *odp_memset(void *ptr, int value, size_t num);
* @retval >0 when the contents of memory blocks do not match, and
* block 'ptr1' is greater than block 'ptr2'
*/
-int odp_memcmp(const void *ptr1, const void *ptr2, size_t num);
+static inline int odp_memcmp(const void *ptr1, const void *ptr2, size_t num)
+{
+ return memcmp(ptr1, ptr2, num);
+}
/**
* @}
@@ -30,6 +30,7 @@ extern "C" {
* regardless which compiler is used as this facilities interoperability
* between e.g. different compilers.
*/
+typedef int odp_bool_t;
/**
* @}
@@ -50,7 +50,10 @@ extern "C" {
*
* @see odp_mb_acquire()
*/
-void odp_mb_release(void);
+static inline void odp_mb_release(void)
+{
+ __atomic_thread_fence(__ATOMIC_RELEASE);
+}
/**
* Memory barrier for acquire operations
@@ -66,7 +69,10 @@ void odp_mb_release(void);
*
* @see odp_mb_release()
*/
-void odp_mb_acquire(void);
+static inline void odp_mb_acquire(void)
+{
+ __atomic_thread_fence(__ATOMIC_ACQUIRE);
+}
/**
* Full memory barrier
@@ -77,7 +83,10 @@ void odp_mb_acquire(void);
*
* This call is not needed when using ODP defined synchronization mechanisms.
*/
-void odp_mb_full(void);
+static inline void odp_mb_full(void)
+{
+ __atomic_thread_fence(__ATOMIC_SEQ_CST);
+}
/**
* @}
@@ -18,8 +18,6 @@
extern "C" {
#endif
-#include <odp/api/std_types.h>
-
/** @addtogroup odp_thread
* Thread mask operations.
* @{
@@ -40,6 +40,7 @@ extern "C" {
* @def ODP_TIME_NULL
* Zero time stamp
*/
+#define ODP_TIME_NULL ((odp_time_t){0, 0})
/**
* Current local time
@@ -12,9 +12,6 @@
extern "C" {
#endif
-#include <odp/api/std_types.h>
-#include <odp/api/packet_io.h>
-
/**
* @file
*
@@ -47,12 +44,14 @@ extern "C" {
* The maximum number of TM systems that may be created. On some platforms
* this might be much more limited to as little as one hardware TM system.
*/
+#define ODP_TM_MAX_NUM_SYSTEMS 64
/**
* @def ODP_TM_MAX_PRIORITIES
* The largest range of priorities that any TM system can support. All strict
* priority values MUST in the range 0..ODP_TM_MAX_PRIORITIES-1.
*/
+#define ODP_TM_MAX_PRIORITIES 16
/**
* @def ODP_TM_MAX_LEVELS
@@ -61,61 +60,72 @@ extern "C" {
* Smaller tm_node levels are associated with tm_nodes closer to the TM system
* egress.
*/
+#define ODP_TM_MAX_LEVELS 8
/**
* @def ODP_TM_MIN_SCHED_WEIGHT
* The smallest SCHED weight is 1 (i.e. 0 is not a legal WFQ/WRR value).
*/
+#define ODP_TM_MIN_SCHED_WEIGHT 1
/**
* @def ODP_TM_MAX_SCHED_WEIGHT
* The largest weight any TM system can support (at least from a configuration
* standpoint). A given TM system could have a smaller value.
*/
+#define ODP_TM_MAX_SCHED_WEIGHT 255
/**
* @def ODP_TM_MAX_TM_QUEUES
* The largest number of tm_queues that can handled by any one TM system.
*/
+#define ODP_TM_MAX_TM_QUEUES (16 * 1024 * 1024)
/**
* @def ODP_TM_MAX_NUM_OUTPUTS
* The largest number of outputs that can be configured for any one TM system.
*/
+#define ODP_TM_MAX_NUM_OUTPUTS 256
/**
* @def ODP_TM_MAX_NUM_TM_NODES
* The largest number of tm_nodes that can be in existence for any one TM
* system.
*/
+#define ODP_TM_MAX_NUM_TM_NODES (1024 * 1024)
/**
* @def ODP_TM_MAX_TM_NODE_FANIN
* The largest number of fan-in "inputs" that can be simultaneously connected
* to a single tm_node.
*/
+#define ODP_TM_MAX_TM_NODE_FANIN (1024 * 1024)
/**
* @def ODP_TM_MIN_SHAPER_BW
* The largest amount of bandwidth that any shaper's peak or commit rate can
* be set to. It is in units of 1000 bytes/second.
*/
+#define ODP_TM_MIN_SHAPER_BW 1
/**
* @def ODP_TM_MAX_SHAPER_BW
* The largest amount of bandwidth that any shaper's peak or commit rate can
* be set to. It is in units of 1000 bytes/second.
*/
+#define ODP_TM_MAX_SHAPER_BW 12500000
/**
* @def ODP_NUM_SHAPER_COLORS
* The number of enumeration values defined in the odp_tm_shaper_color_t type.
*/
+#define ODP_NUM_SHAPER_COLORS 3
/**
* @def ODP_TM_INVALID_PRIORITY
* Used to indicate an invalid priority value.
*/
+#define ODP_TM_INVALID_PRIORITY 255
/**
* @typedef odp_tm_percent_t
@@ -126,6 +136,7 @@ extern "C" {
* in any event will never be larger than 500% (i.e. it MUST be capped at
* 50000).
*/
+typedef uint16_t odp_tm_percent_t;
/**
* @typedef odp_tm_t
@@ -188,6 +199,7 @@ extern "C" {
* Constant that is used to refer to the egress/root node of the TM subsystem's
* tree/hierarchy of nodes.
*/
+#define ODP_TM_ROOT ((odp_tm_handle_t)-1)
/** Per Level Capabilities
*
@@ -18,45 +18,288 @@
extern "C" {
#endif
-#include <odp/api/version.h>
-#include <odp/api/std_types.h>
-#include <odp/api/compiler.h>
-#include <odp/api/align.h>
-#include <odp/api/hash.h>
-#include <odp/api/hints.h>
-#include <odp/api/debug.h>
-#include <odp/api/byteorder.h>
-#include <odp/api/cpu.h>
-#include <odp/api/cpumask.h>
-#include <odp/api/barrier.h>
-#include <odp/api/spinlock.h>
-#include <odp/api/atomic.h>
-#include <odp/api/init.h>
-#include <odp/api/system_info.h>
-#include <odp/api/thread.h>
-#include <odp/api/shared_memory.h>
-#include <odp/api/buffer.h>
-#include <odp/api/pool.h>
-#include <odp/api/queue.h>
-#include <odp/api/ticketlock.h>
-#include <odp/api/time.h>
-#include <odp/api/timer.h>
-#include <odp/api/schedule.h>
-#include <odp/api/sync.h>
-#include <odp/api/packet.h>
-#include <odp/api/packet_flags.h>
-#include <odp/api/packet_io.h>
-#include <odp/api/crypto.h>
-#include <odp/api/classification.h>
-#include <odp/api/rwlock.h>
-#include <odp/api/event.h>
-#include <odp/api/random.h>
-#include <odp/api/errno.h>
-#include <odp/api/thrmask.h>
-#include <odp/api/traffic_mngr.h>
-#include <odp/api/spinlock_recursive.h>
-#include <odp/api/rwlock_recursive.h>
-#include <odp/api/std_clib.h>
+#define _GNU_SOURCE
+#include <stdbool.h>
+#include <stddef.h>
+#include <stdint.h>
+
+#define ODP_HANDLE_T(obj) struct obj##_T* obj;
+
+/** Get value of an ODP handle */
+#define _odp_typeval(handle) ((uint32_t)(uintptr_t)(handle))
+
+/** Get printable value of an ODP handle */
+#define _odp_pri(handle) ((uint64_t)_odp_typeval(handle))
+
+/** Convert a scalar to a typed handle */
+#define _odp_cast_scalar(type, val) ((type)(uintptr_t)(val))
+
+/*
+ * Types, handles, #defines are defined here to avoid circular dependencies
+ * in the API header files that include the function declarations.
+ */
+
+#define ODP_THREAD_COUNT_MAX 128
+
+#if defined __OCTEON__
+#define _ODP_CACHE_LINE_SIZE 128
+#else
+#define _ODP_CACHE_LINE_SIZE 64
+#endif
+
+#ifdef __GNUC__
+
+#define ODP_ALIGNED(x) __attribute__((__aligned__(x)))
+
+#define ODP_PACKED __attribute__((__packed__))
+
+#define ODP_OFFSETOF(type, member) __builtin_offsetof(type, member)
+
+#define ODP_FIELD_SIZEOF(type, member) sizeof(((type *)0)->member)
+
+#else
+#error Please add support for your compiler in odp_api.h
+#endif
+
+#define ODP_CACHE_LINE_SIZE _ODP_CACHE_LINE_SIZE
+
+#define ODP_PAGE_SIZE 4096
+
+#define ODP_ALIGNED_CACHE ODP_ALIGNED(ODP_CACHE_LINE_SIZE)
+
+#define ODP_ALIGNED_PAGE ODP_ALIGNED(ODP_PAGE_SIZE)
+
+typedef struct {
+ 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
+} odp_atomic_u64_t __attribute__((aligned(sizeof(uint64_t))));
+
+typedef struct {
+ uint32_t v; /**< Actual storage for the atomic variable */
+} odp_atomic_u32_t __attribute__((aligned(sizeof(uint32_t))));
+
+struct odp_barrier_s {
+ uint32_t count; /**< Thread count */
+ odp_atomic_u32_t bar; /**< Barrier counter */
+};
+typedef struct odp_barrier_s odp_barrier_t;
+
+typedef ODP_HANDLE_T(odp_buffer_t);
+
+#ifdef __CHECKER__
+#define __odp_bitwise __attribute__((bitwise))
+#define __odp_force __attribute__((force))
+#else
+#define __odp_bitwise
+#define __odp_force
+#endif
+
+typedef uint16_t __odp_bitwise odp_u16le_t;
+typedef uint16_t __odp_bitwise odp_u16be_t;
+
+typedef uint32_t __odp_bitwise odp_u32le_t;
+typedef uint32_t __odp_bitwise odp_u32be_t;
+
+typedef uint64_t __odp_bitwise odp_u64le_t;
+typedef uint64_t __odp_bitwise odp_u64be_t;
+
+typedef uint16_t __odp_bitwise odp_u16sum_t;
+typedef uint32_t __odp_bitwise odp_u32sum_t;
+
+typedef ODP_HANDLE_T(odp_cos_t);
+typedef uint16_t odp_cos_flow_set_t;
+
+#define ODP_CPUMASK_SIZE 1024
+#define ODP_CPUMASK_STR_SIZE ((ODP_CPUMASK_SIZE + 3) / 4 + 3)
+typedef struct odp_cpumask_t {
+ uint8_t _u8[ODP_CPUMASK_SIZE / 8];
+} odp_cpumask_t __attribute__((aligned(8)));
+
+typedef ODP_HANDLE_T(odp_crypto_compl_t);
+typedef uint64_t odp_crypto_session_t;
+typedef ODP_HANDLE_T(odp_event_t);
+typedef ODP_HANDLE_T(odp_flowsig_t);
+typedef uint64_t odp_instance_t;
+typedef ODP_HANDLE_T(odp_packet_t);
+
+typedef struct odp_pktio_stats_t {
+ uint64_t in_octets;
+ uint64_t in_ucast_pkts;
+ uint64_t in_discards;
+ uint64_t in_errors;
+ uint64_t in_unknown_protos;
+ uint64_t out_octets;
+ uint64_t out_ucast_pkts;
+ uint64_t out_discards;
+ uint64_t out_errors;
+} odp_pktio_stats_t;
+
+typedef uint8_t odp_packet_seg_t;
+typedef ODP_HANDLE_T(odp_pktio_t);
+typedef struct odp_platform_init_t {
+ int ipc_ns; /**< Name space for ipc shared objects. */
+} odp_platform_init_t;
+typedef ODP_HANDLE_T(odp_pmr_t);
+typedef ODP_HANDLE_T(odp_pool_t);
+typedef ODP_HANDLE_T(odp_queue_t);
+typedef ODP_HANDLE_T(odp_queue_group_t);
+
+struct odp_rwlock_s {
+ odp_atomic_u32_t cnt; /**< lock count
+ 0 lock not taken
+ -1 write lock taken
+ >0 read lock(s) taken */
+};
+typedef struct odp_rwlock_s odp_rwlock_t;
+
+struct odp_rwlock_recursive_s {
+ odp_rwlock_t lock; /**< the lock */
+ int wr_owner; /**< write owner thread */
+ uint32_t wr_cnt; /**< write recursion count */
+ uint8_t rd_cnt[ODP_THREAD_COUNT_MAX]; /**< read recursion count */
+};
+typedef struct odp_rwlock_recursive_s odp_rwlock_recursive_t;
+
+typedef int odp_schedule_prio_t;
+typedef int odp_schedule_sync_t;
+typedef int odp_schedule_group_t;
+
+/** Scheduler parameters */
+typedef struct odp_schedule_param_t {
+ /** Priority level
+ *
+ * Default value is ODP_SCHED_PRIO_DEFAULT. */
+ odp_schedule_prio_t prio;
+
+ /** Synchronization method
+ *
+ * Default value is ODP_SCHED_SYNC_PARALLEL. */
+ odp_schedule_sync_t sync;
+
+ /** Thread group
+ *
+ * Default value is ODP_SCHED_GROUP_ALL. */
+ odp_schedule_group_t group;
+
+ /** Ordered lock count for this queue
+ *
+ * Default value is 0. */
+ unsigned lock_count;
+} odp_schedule_param_t;
+
+typedef ODP_HANDLE_T(odp_shm_t);
+
+struct odp_spinlock_s {
+ char lock; /**< lock flag, should match odp_atomic_flag_t */
+};
+typedef struct odp_spinlock_s odp_spinlock_t;
+
+struct odp_spinlock_recursive_s {
+ odp_spinlock_t lock; /**< the lock */
+ int owner; /**< thread owning the lock */
+ uint32_t cnt; /**< recursion count */
+};
+typedef struct odp_spinlock_recursive_s odp_spinlock_recursive_t;
+
+#define ODP_THRMASK_STR_SIZE ODP_CPUMASK_STR_SIZE
+typedef struct odp_thrmask_t {
+ odp_cpumask_t m;
+} odp_thrmask_t;
+
+struct odp_ticketlock_s {
+ odp_atomic_u32_t next_ticket; /**< Next ticket */
+ odp_atomic_u32_t cur_ticket; /**< Current ticket */
+};
+typedef struct odp_ticketlock_s odp_ticketlock_t;
+
+typedef ODP_HANDLE_T(odp_timeout_t);
+typedef ODP_HANDLE_T(odp_timer_t);
+struct odp_timer_pool_s;
+typedef struct odp_timer_pool_s *odp_timer_pool_t;
+typedef struct odp_time_t {
+ int64_t tv_sec; /**< @internal Seconds */
+ int64_t tv_nsec; /**< @internal Nanoseconds */
+} odp_time_t;
+typedef uint64_t odp_tm_handle_t;
+typedef odp_tm_handle_t odp_tm_t;
+typedef odp_tm_handle_t odp_tm_queue_t;
+typedef odp_tm_handle_t odp_tm_node_t;
+typedef odp_tm_handle_t odp_tm_shaper_t;
+typedef odp_tm_handle_t odp_tm_sched_t;
+typedef odp_tm_handle_t odp_tm_threshold_t;
+typedef odp_tm_handle_t odp_tm_wred_t;
+
+#define ODP_BUFFER_INVALID _odp_cast_scalar(odp_buffer_t, 0xffffffff)
+#define ODP_COS_INVALID _odp_cast_scalar(odp_cos_t, ~0)
+#define ODP_CRYPTO_SESSION_INVALID (0xffffffffffffffffULL)
+#define ODP_EVENT_INVALID _odp_cast_scalar(odp_event_t, 0xffffffff)
+#define ODP_PACKET_INVALID _odp_cast_scalar(odp_packet_t, 0xffffffff)
+#define ODP_PACKET_OFFSET_INVALID (0x0fffffff)
+#define ODP_PACKET_SEG_INVALID ((odp_packet_seg_t)-1)
+#define ODP_PKTIO_INVALID _odp_cast_scalar(odp_pktio_t, 0)
+#define ODP_PMR_INVAL _odp_cast_scalar(odp_pmr_t, ~0)
+#define ODP_POOL_INVALID _odp_cast_scalar(odp_pool_t, 0xffffffff)
+#define ODP_QUEUE_INVALID _odp_cast_scalar(odp_queue_t, 0)
+#define ODP_SCHED_GROUP_INVALID -1
+#define ODP_SHM_INVALID _odp_cast_scalar(odp_shm_t, 0)
+#define ODP_SHM_NULL ODP_SHM_INVALID
+#define ODP_TIMEOUT_INVALID _odp_cast_scalar(odp_timeout_t, 0xffffffff)
+#define ODP_TIMER_INVALID _odp_cast_scalar(odp_timer_t, 0xffffffff)
+#define ODP_TIMER_POOL_INVALID NULL
+#define ODP_TM_INVALID 0
+
+#define ODP_COS_NAME_LEN 32
+#define ODP_POOL_NAME_LEN 32
+#define ODP_QUEUE_NAME_LEN 32
+#define ODP_SCHED_GROUP_NAME_LEN 32
+#define ODP_SHM_NAME_LEN 32
+#define ODP_TIMER_POOL_NAME_LEN 32
+
+#include <odp/api/spec/version.h>
+#include <odp/api/spec/std_types.h>
+#include <odp/api/spec/compiler.h>
+#include <odp/api/spec/align.h>
+#include <odp/api/spec/thread.h>
+#include <odp/api/spec/hash.h>
+#include <odp/api/spec/hints.h>
+#include <odp/api/spec/debug.h>
+#include <odp/api/spec/byteorder.h>
+#include <odp/api/spec/cpu.h>
+#include <odp/api/spec/cpumask.h>
+#include <odp/api/spec/barrier.h>
+#include <odp/api/spec/spinlock.h>
+#include <odp/api/spec/atomic.h>
+#include <odp/api/spec/init.h>
+#include <odp/api/spec/system_info.h>
+#include <odp/api/spec/shared_memory.h>
+#include <odp/api/spec/buffer.h>
+#include <odp/api/spec/pool.h>
+#include <odp/api/spec/queue.h>
+#include <odp/api/spec/ticketlock.h>
+#include <odp/api/spec/time.h>
+#include <odp/api/spec/timer.h>
+#include <odp/api/spec/schedule.h>
+#include <odp/api/spec/schedule_types.h>
+#include <odp/api/spec/sync.h>
+#include <odp/api/spec/packet.h>
+#include <odp/api/spec/packet_flags.h>
+#include <odp/api/spec/packet_io.h>
+#include <odp/api/spec/packet_io_stats.h>
+#include <odp/api/spec/crypto.h>
+#include <odp/api/spec/classification.h>
+#include <odp/api/spec/rwlock.h>
+#include <odp/api/spec/event.h>
+#include <odp/api/spec/random.h>
+#include <odp/api/spec/errno.h>
+#include <odp/api/spec/thrmask.h>
+#include <odp/api/spec/traffic_mngr.h>
+#include <odp/api/spec/spinlock_recursive.h>
+#include <odp/api/spec/rwlock_recursive.h>
+#include <odp/api/spec/std_clib.h>
#ifdef __cplusplus
}
@@ -20,85 +20,8 @@ odpinclude_HEADERS = \
odpapiincludedir= $(includedir)/odp/api
odpapiinclude_HEADERS = \
- $(srcdir)/include/odp/api/align.h \
- $(srcdir)/include/odp/api/atomic.h \
- $(srcdir)/include/odp/api/barrier.h \
- $(srcdir)/include/odp/api/buffer.h \
- $(srcdir)/include/odp/api/byteorder.h \
- $(srcdir)/include/odp/api/classification.h \
- $(srcdir)/include/odp/api/compiler.h \
- $(srcdir)/include/odp/api/cpu.h \
- $(srcdir)/include/odp/api/cpumask.h \
- $(srcdir)/include/odp/api/crypto.h \
- $(srcdir)/include/odp/api/debug.h \
- $(srcdir)/include/odp/api/errno.h \
- $(srcdir)/include/odp/api/event.h \
- $(srcdir)/include/odp/api/hash.h \
- $(srcdir)/include/odp/api/hints.h \
- $(srcdir)/include/odp/api/init.h \
- $(srcdir)/include/odp/api/packet_flags.h \
- $(srcdir)/include/odp/api/packet.h \
- $(srcdir)/include/odp/api/packet_io.h \
- $(srcdir)/include/odp/api/packet_io_stats.h \
- $(srcdir)/include/odp/api/pool.h \
- $(srcdir)/include/odp/api/queue.h \
- $(srcdir)/include/odp/api/random.h \
- $(srcdir)/include/odp/api/rwlock.h \
- $(srcdir)/include/odp/api/rwlock_recursive.h \
- $(srcdir)/include/odp/api/schedule.h \
- $(srcdir)/include/odp/api/schedule_types.h \
- $(srcdir)/include/odp/api/shared_memory.h \
- $(srcdir)/include/odp/api/spinlock.h \
- $(srcdir)/include/odp/api/spinlock_recursive.h \
- $(srcdir)/include/odp/api/std_clib.h \
- $(srcdir)/include/odp/api/std_types.h \
- $(srcdir)/include/odp/api/sync.h \
- $(srcdir)/include/odp/api/system_info.h \
- $(srcdir)/include/odp/api/thread.h \
- $(srcdir)/include/odp/api/thrmask.h \
- $(srcdir)/include/odp/api/ticketlock.h \
- $(srcdir)/include/odp/api/time.h \
- $(srcdir)/include/odp/api/timer.h \
- $(srcdir)/include/odp/api/traffic_mngr.h \
- $(srcdir)/include/odp/api/version.h \
$(srcdir)/arch/@ARCH_DIR@/odp/api/cpu_arch.h
-odpapiplatincludedir= $(includedir)/odp/api/plat
-odpapiplatinclude_HEADERS = \
- $(builddir)/include/odp/api/plat/static_inline.h \
- $(srcdir)/include/odp/api/plat/atomic_inlines.h \
- $(srcdir)/include/odp/api/plat/atomic_types.h \
- $(srcdir)/include/odp/api/plat/barrier_types.h \
- $(srcdir)/include/odp/api/plat/buffer_types.h \
- $(srcdir)/include/odp/api/plat/byteorder_inlines.h \
- $(srcdir)/include/odp/api/plat/byteorder_types.h \
- $(srcdir)/include/odp/api/plat/classification_types.h \
- $(srcdir)/include/odp/api/plat/cpumask_types.h \
- $(srcdir)/include/odp/api/plat/crypto_types.h \
- $(srcdir)/include/odp/api/plat/event_types.h \
- $(srcdir)/include/odp/api/plat/init_types.h \
- $(srcdir)/include/odp/api/plat/packet_types.h \
- $(srcdir)/include/odp/api/plat/packet_io_types.h \
- $(srcdir)/include/odp/api/plat/pool_types.h \
- $(srcdir)/include/odp/api/plat/queue_types.h \
- $(srcdir)/include/odp/api/plat/rwlock_types.h \
- $(srcdir)/include/odp/api/plat/rwlock_recursive_types.h \
- $(srcdir)/include/odp/api/plat/schedule_types.h \
- $(srcdir)/include/odp/api/plat/shared_memory_types.h \
- $(srcdir)/include/odp/api/plat/spinlock_types.h \
- $(srcdir)/include/odp/api/plat/spinlock_recursive_types.h \
- $(srcdir)/include/odp/api/plat/std_clib_inlines.h \
- $(srcdir)/include/odp/api/plat/strong_types.h \
- $(srcdir)/include/odp/api/plat/sync_inlines.h \
- $(srcdir)/include/odp/api/plat/thread_types.h \
- $(srcdir)/include/odp/api/plat/thrmask_types.h \
- $(srcdir)/include/odp/api/plat/ticketlock_inlines.h \
- $(srcdir)/include/odp/api/plat/ticketlock_types.h \
- $(srcdir)/include/odp/api/plat/time_types.h \
- $(srcdir)/include/odp/api/plat/timer_types.h \
- $(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/compiler.h
@@ -137,9 +60,11 @@ noinst_HEADERS = \
${srcdir}/include/odp_schedule_if.h \
${srcdir}/include/odp_sorted_list_internal.h \
${srcdir}/include/odp_shm_internal.h \
+ ${srcdir}/include/odp_ticketlock_internal.h \
${srcdir}/include/odp_timer_internal.h \
${srcdir}/include/odp_timer_wheel_internal.h \
${srcdir}/include/odp_traffic_mngr_internal.h \
+ ${srcdir}/include/odp_version_internal.h \
${srcdir}/include/protocols/eth.h \
${srcdir}/include/protocols/ip.h \
${srcdir}/include/protocols/ipsec.h \
@@ -154,7 +79,6 @@ __LIB__libodp_linux_la_SOURCES = \
odp_atomic.c \
odp_barrier.c \
odp_buffer.c \
- odp_byteorder.c \
odp_classification.c \
odp_cpu.c \
odp_cpumask.c \
@@ -193,8 +117,6 @@ __LIB__libodp_linux_la_SOURCES = \
odp_sorted_list.c \
odp_spinlock.c \
odp_spinlock_recursive.c \
- odp_std_clib.c \
- odp_sync.c \
odp_system_info.c \
odp_thread.c \
odp_thrmask.c \
@@ -36,8 +36,10 @@
* process and get converted both when registered or looked up.
*/
+#define _GNU_SOURCE
+#include <odp_api.h>
+
#include <odp_posix_extensions.h>
-#include <odp/api/spinlock.h>
#include <odp_internal.h>
#include <odp_debug_internal.h>
#include <_fdserver_internal.h>
@@ -45,13 +45,12 @@
* memory:
* _odp_ishm_reserve(), _odp_ishm_free*() and _odp_ishm_lookup*()...
*/
+
+#include <odp_api.h>
+
#include <odp_posix_extensions.h>
#include <odp_config_internal.h>
#include <odp_internal.h>
-#include <odp/api/spinlock.h>
-#include <odp/api/align.h>
-#include <odp/api/system_info.h>
-#include <odp/api/debug.h>
#include <odp_shm_internal.h>
#include <odp_debug_internal.h>
#include <odp_align_internal.h>
@@ -8,12 +8,11 @@
* This file handles the lower end of the ishm memory allocator:
* It performs the physical mappings.
*/
+#include <odp_api.h>
+
#include <odp_posix_extensions.h>
#include <odp_config_internal.h>
#include <odp_internal.h>
-#include <odp/api/align.h>
-#include <odp/api/system_info.h>
-#include <odp/api/debug.h>
#include <odp_debug_internal.h>
#include <odp_align_internal.h>
#include <_ishm_internal.h>
@@ -11,12 +11,6 @@
extern "C" {
#endif
-#define _ODP_CACHE_LINE_SIZE 64
-
-static inline void odp_cpu_pause(void)
-{
-}
-
#ifdef __cplusplus
}
#endif
@@ -9,9 +9,6 @@
#include <stdlib.h>
#include <time.h>
-#include <odp/api/cpu.h>
-#include <odp/api/hints.h>
-#include <odp/api/system_info.h>
#include <odp_debug_internal.h>
#define GIGA 1000000000
@@ -11,12 +11,6 @@
extern "C" {
#endif
-#define _ODP_CACHE_LINE_SIZE 64
-
-static inline void odp_cpu_pause(void)
-{
-}
-
#ifdef __cplusplus
}
#endif
@@ -4,14 +4,13 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
+#include <odp_api.h>
+
#include <odp_posix_extensions.h>
#include <stdlib.h>
#include <time.h>
-#include <odp/api/cpu.h>
-#include <odp/api/hints.h>
-#include <odp/api/system_info.h>
#include <odp_debug_internal.h>
#define GIGA 1000000000
@@ -4,6 +4,8 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
+#include <odp_api.h>
+
#include <odp_internal.h>
#include <odp_debug_internal.h>
#include <string.h>
@@ -11,12 +11,6 @@
extern "C" {
#endif
-#if defined __OCTEON__
-#define _ODP_CACHE_LINE_SIZE 128
-#else
-#error Please add support for your arch in cpu_arch.h
-#endif
-
static inline void odp_cpu_pause(void)
{
__asm__ __volatile__ ("nop");
@@ -4,9 +4,7 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <odp/api/cpu.h>
-#include <odp/api/hints.h>
-#include <odp/api/system_info.h>
+#include <odp_api.h>
uint64_t odp_cpu_cycles(void)
{
@@ -4,6 +4,8 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
+#include <odp_api.h>
+
#include <odp_internal.h>
#include <string.h>
@@ -11,12 +11,6 @@
extern "C" {
#endif
-#define _ODP_CACHE_LINE_SIZE 64
-
-static inline void odp_cpu_pause(void)
-{
-}
-
#ifdef __cplusplus
}
#endif
@@ -4,14 +4,13 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
+#include <odp_api.h>
+
#include <odp_posix_extensions.h>
#include <stdlib.h>
#include <time.h>
-#include <odp/api/cpu.h>
-#include <odp/api/hints.h>
-#include <odp/api/system_info.h>
#include <odp_debug_internal.h>
#define GIGA 1000000000
@@ -4,6 +4,8 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
+#include <odp_api.h>
+
#include <odp_internal.h>
#include <string.h>
@@ -11,17 +11,6 @@
extern "C" {
#endif
-#define _ODP_CACHE_LINE_SIZE 64
-
-static inline void odp_cpu_pause(void)
-{
-#ifdef __SSE2__
- __asm__ __volatile__ ("pause");
-#else
- __asm__ __volatile__ ("rep; nop");
-#endif
-}
-
#ifdef __cplusplus
}
#endif
@@ -3,7 +3,8 @@
*
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <odp/api/cpu.h>
+
+#include <odp_api.h>
uint64_t odp_cpu_cycles(void)
{
@@ -4,6 +4,8 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
+#include <odp_api.h>
+
#include <odp_internal.h>
#include <string.h>
deleted file mode 100644
@@ -1,58 +0,0 @@
-/* Copyright (c) 2013, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-/**
- * @file
- *
- * ODP alignments
- */
-
-#ifndef ODP_PLAT_ALIGN_H_
-#define ODP_PLAT_ALIGN_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <odp/api/cpu_arch.h>
-
-/** @ingroup odp_compiler_optim
- * @{
- */
-
-#ifdef __GNUC__
-
-#define ODP_ALIGNED(x) __attribute__((__aligned__(x)))
-
-#define ODP_PACKED __attribute__((__packed__))
-
-#define ODP_OFFSETOF(type, member) __builtin_offsetof(type, member)
-
-#define ODP_FIELD_SIZEOF(type, member) sizeof(((type *)0)->member)
-
-#else
-#error Non-gcc compatible compiler
-#endif
-
-#define ODP_CACHE_LINE_SIZE _ODP_CACHE_LINE_SIZE
-
-#define ODP_PAGE_SIZE 4096
-
-#define ODP_ALIGNED_CACHE ODP_ALIGNED(ODP_CACHE_LINE_SIZE)
-
-#define ODP_ALIGNED_PAGE ODP_ALIGNED(ODP_PAGE_SIZE)
-
-/**
- * @}
- */
-
-#include <odp/api/spec/align.h>
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
deleted file mode 100644
@@ -1,42 +0,0 @@
-/* Copyright (c) 2013, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-/**
- * @file
- *
- * ODP atomic operations
- */
-
-#ifndef ODP_PLAT_ATOMIC_H_
-#define ODP_PLAT_ATOMIC_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <odp/api/align.h>
-#include <odp/api/plat/atomic_types.h>
-
-/** @ingroup odp_atomic
- * @{
- */
-
-#include <odp/api/plat/static_inline.h>
-#if ODP_ABI_COMPAT == 0
-#include <odp/api/plat/atomic_inlines.h>
-#endif
-
-/**
- * @}
- */
-
-#include <odp/api/spec/atomic.h>
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
deleted file mode 100644
@@ -1,31 +0,0 @@
-/* Copyright (c) 2013, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-/**
- * @file
- *
- * ODP execution barriers
- */
-
-#ifndef ODP_PLAT_BARRIER_H_
-#define ODP_PLAT_BARRIER_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <odp/api/std_types.h>
-#include <odp/api/atomic.h>
-#include <odp/api/plat/shared_memory_types.h>
-#include <odp/api/plat/barrier_types.h>
-
-#include <odp/api/spec/barrier.h>
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
deleted file mode 100644
@@ -1,39 +0,0 @@
-/* Copyright (c) 2013, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-/**
- * @file
- *
- * ODP buffer descriptor
- */
-
-#ifndef ODP_PLAT_BUFFER_H_
-#define ODP_PLAT_BUFFER_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <odp/api/std_types.h>
-#include <odp/api/plat/event_types.h>
-#include <odp/api/plat/buffer_types.h>
-#include <odp/api/plat/pool_types.h>
-
-/** @ingroup odp_buffer
- * @{
- */
-
-/**
- * @}
- */
-
-#include <odp/api/spec/buffer.h>
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
deleted file mode 100644
@@ -1,43 +0,0 @@
-/* Copyright (c) 2014, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-/**
- * @file
- *
- * ODP byteorder
- */
-
-#ifndef ODP_PLAT_BYTEORDER_H_
-#define ODP_PLAT_BYTEORDER_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <odp/api/std_types.h>
-#include <odp/api/plat/byteorder_types.h>
-#include <odp/api/compiler.h>
-
-/** @ingroup odp_compiler_optim
- * @{
- */
-
-#include <odp/api/plat/static_inline.h>
-#if ODP_ABI_COMPAT == 0
-#include <odp/api/plat/byteorder_inlines.h>
-#endif
-
-/**
- * @}
- */
-
-#include <odp/api/spec/byteorder.h>
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
deleted file mode 100644
@@ -1,41 +0,0 @@
-/* Copyright (c) 2014, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-/**
- * @file
- *
- * ODP classification descriptor
- */
-
-#ifndef ODP_PLAT_CLASSIFY_H_
-#define ODP_PLAT_CLASSIFY_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <odp/api/std_types.h>
-#include <odp/api/plat/pool_types.h>
-#include <odp/api/plat/classification_types.h>
-#include <odp/api/plat/packet_types.h>
-#include <odp/api/plat/packet_io_types.h>
-#include <odp/api/plat/queue_types.h>
-
-/** @ingroup odp_classification
- * @{
- */
-
-/**
- * @}
- */
-
-#include <odp/api/spec/classification.h>
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
deleted file mode 100644
@@ -1,34 +0,0 @@
-/* Copyright (c) 2014, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-/**
- * @file
- *
- * Compiler related
- */
-
-#ifndef ODP_PLAT_COMPILER_H_
-#define ODP_PLAT_COMPILER_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/** @ingroup odp_compiler_optim
- * @{
- */
-
-/**
- * @}
- */
-
-#include <odp/api/spec/compiler.h>
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
deleted file mode 100644
@@ -1,28 +0,0 @@
-/* Copyright (c) 2015, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-/**
- * @file
- *
- * ODP CPU
- */
-
-#ifndef ODP_PLAT_CPU_H_
-#define ODP_PLAT_CPU_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <odp/api/cpu_arch.h>
-
-#include <odp/api/spec/cpu.h>
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
deleted file mode 100644
@@ -1,28 +0,0 @@
-/* Copyright (c) 2013, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-/**
- * @file
- *
- * ODP CPU masks and enumeration
- */
-
-#ifndef ODP_PLAT_CPUMASK_H_
-#define ODP_PLAT_CPUMASK_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <odp/api/plat/cpumask_types.h>
-
-#include <odp/api/spec/cpumask.h>
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
deleted file mode 100644
@@ -1,41 +0,0 @@
-/* Copyright (c) 2014, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-/**
- * @file
- *
- * ODP crypto
- */
-
-#ifndef ODP_PLAT_CRYPTO_H_
-#define ODP_PLAT_CRYPTO_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <odp/api/std_types.h>
-#include <odp/api/plat/packet_types.h>
-#include <odp/api/plat/crypto_types.h>
-#include <odp/api/plat/buffer_types.h>
-#include <odp/api/plat/pool_types.h>
-#include <odp/api/queue.h>
-
-/** @ingroup odp_crypto
- * @{
- */
-
-/**
- * @}
- */
-
-#include <odp/api/spec/crypto.h>
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
deleted file mode 100644
@@ -1,48 +0,0 @@
-/* Copyright (c) 2013, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-/**
- * @file
- *
- * ODP debug
- */
-
-#ifndef ODP_PLAT_DEBUG_H_
-#define ODP_PLAT_DEBUG_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <odp/api/spec/debug.h>
-
-#if defined(__GNUC__) && !defined(__clang__)
-
-#if __GNUC__ < 4 || (__GNUC__ == 4 && (__GNUC_MINOR__ < 6))
-
-/**
- * @internal _Static_assert was only added in GCC 4.6. Provide a weak replacement
- * for previous versions.
- */
-#define _Static_assert(e, s) (extern int (*static_assert_checker(void)) \
- [sizeof(struct { unsigned int error_if_negative:(e) ? 1 : -1; })])
-
-#endif
-
-#endif
-
-/**
- * @internal Compile time assertion macro. Fails compilation and outputs 'msg'
- * if condition 'cond' is false. Macro definition is empty when compiler is not
- * supported or the compiler does not support static assertion.
- */
-#define ODP_STATIC_ASSERT(cond, msg) _Static_assert(cond, msg)
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
deleted file mode 100644
@@ -1,27 +0,0 @@
-/* Copyright (c) 2015, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-/**
- * @file
- *
- * ODP errno API
- */
-
-#ifndef ODP_PLAT_ERRNO_H_
-#define ODP_PLAT_ERRNO_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-#include <odp/api/spec/errno.h>
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
deleted file mode 100644
@@ -1,36 +0,0 @@
-/* Copyright (c) 2015, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-/**
- * @file
- *
- * ODP event
- */
-
-#ifndef ODP_PLAT_EVENT_H_
-#define ODP_PLAT_EVENT_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <odp/api/plat/event_types.h>
-
-/** @ingroup odp_event
- * @{
- */
-
-/**
- * @}
- */
-
-#include <odp/api/spec/event.h>
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
deleted file mode 100644
@@ -1,34 +0,0 @@
-/* Copyright (c) 2015, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-/**
- * @file
- *
- * ODP Hash function
- */
-
-#ifndef ODP_PLAT_HASH_H_
-#define ODP_PLAT_HASH_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/** @ingroup odp_hash
- * @{
- */
-
-/**
- * @}
- */
-
-#include <odp/api/spec/hash.h>
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
deleted file mode 100644
@@ -1,34 +0,0 @@
-/* Copyright (c) 2013, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-/**
- * @file
- *
- * ODP compiler hints
- */
-
-#ifndef ODP_PLAT_HINTS_H_
-#define ODP_PLAT_HINTS_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/** @ingroup odp_compiler_optim
- * @{
- */
-
-/**
- * @}
- */
-
-#include <odp/api/spec/hints.h>
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
deleted file mode 100644
@@ -1,36 +0,0 @@
-/* Copyright (c) 2013, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-/**
- * @file
- *
- * ODP initialization.
- */
-
-#ifndef ODP_PLAT_INIT_H_
-#define ODP_PLAT_INIT_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <odp/api/plat/init_types.h>
-
-/** @ingroup odp_initialization
- * @{
- */
-
-/**
- * @}
- */
-
-#include <odp/api/spec/init.h>
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
deleted file mode 100644
@@ -1,41 +0,0 @@
-/* Copyright (c) 2013, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-/**
- * @file
- *
- * ODP packet descriptor
- */
-
-#ifndef ODP_PLAT_PACKET_H_
-#define ODP_PLAT_PACKET_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <odp/api/std_types.h>
-#include <odp/api/plat/event_types.h>
-#include <odp/api/plat/packet_io_types.h>
-#include <odp/api/plat/packet_types.h>
-#include <odp/api/plat/buffer_types.h>
-#include <odp/api/plat/pool_types.h>
-
-/** @ingroup odp_packet
- * @{
- */
-
-/**
- * @}
- */
-
-#include <odp/api/spec/packet.h>
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
deleted file mode 100644
@@ -1,34 +0,0 @@
-/* Copyright (c) 2014, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-/**
- * @file
- *
- * ODP packet flags
- */
-
-#ifndef ODP_PLAT_PACKET_FLAGS_H_
-#define ODP_PLAT_PACKET_FLAGS_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/** @ingroup odp_packet
- * @{
- */
-
-/**
- * @}
- */
-
-#include <odp/api/spec/packet_flags.h>
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
deleted file mode 100644
@@ -1,41 +0,0 @@
-/* Copyright (c) 2013, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-/**
- * @file
- *
- * ODP Packet IO
- */
-
-#ifndef ODP_PLAT_PACKET_IO_H_
-#define ODP_PLAT_PACKET_IO_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <odp/api/std_types.h>
-#include <odp/api/plat/pool_types.h>
-#include <odp/api/plat/classification_types.h>
-#include <odp/api/plat/packet_types.h>
-#include <odp/api/plat/packet_io_types.h>
-#include <odp/api/plat/queue_types.h>
-
-/** @ingroup odp_packet_io
- * @{
- */
-
-/**
- * @}
- */
-
-#include <odp/api/spec/packet_io.h>
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
deleted file mode 100644
@@ -1,26 +0,0 @@
-/* Copyright (c) 2016, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-/**
- * @file
- *
- * ODP packet IO stats
- */
-
-#ifndef ODP_PLAT_PACKET_IO_STATS_H_
-#define ODP_PLAT_PACKET_IO_STATS_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <odp/api/spec/packet_io_stats.h>
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
deleted file mode 100644
@@ -1,385 +0,0 @@
-/* Copyright (c) 2016, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-/**
- * @file
- *
- * ODP Atomic inline functions
- */
-
-#ifndef _ODP_PLAT_ATOMIC_INLINES_H_
-#define _ODP_PLAT_ATOMIC_INLINES_H_
-
-_STATIC void odp_atomic_init_u32(odp_atomic_u32_t *atom, uint32_t val)
-{
- __atomic_store_n(&atom->v, val, __ATOMIC_RELAXED);
-}
-
-_STATIC uint32_t odp_atomic_load_u32(odp_atomic_u32_t *atom)
-{
- return __atomic_load_n(&atom->v, __ATOMIC_RELAXED);
-}
-
-_STATIC void odp_atomic_store_u32(odp_atomic_u32_t *atom, uint32_t val)
-{
- __atomic_store_n(&atom->v, val, __ATOMIC_RELAXED);
-}
-
-_STATIC uint32_t odp_atomic_fetch_add_u32(odp_atomic_u32_t *atom, uint32_t val)
-{
- return __atomic_fetch_add(&atom->v, val, __ATOMIC_RELAXED);
-}
-
-_STATIC void odp_atomic_add_u32(odp_atomic_u32_t *atom, uint32_t val)
-{
- (void)__atomic_fetch_add(&atom->v, val, __ATOMIC_RELAXED);
-}
-
-_STATIC uint32_t odp_atomic_fetch_sub_u32(odp_atomic_u32_t *atom, uint32_t val)
-{
- return __atomic_fetch_sub(&atom->v, val, __ATOMIC_RELAXED);
-}
-
-_STATIC void odp_atomic_sub_u32(odp_atomic_u32_t *atom, uint32_t val)
-{
- (void)__atomic_fetch_sub(&atom->v, val, __ATOMIC_RELAXED);
-}
-
-_STATIC uint32_t odp_atomic_fetch_inc_u32(odp_atomic_u32_t *atom)
-{
- return __atomic_fetch_add(&atom->v, 1, __ATOMIC_RELAXED);
-}
-
-_STATIC void odp_atomic_inc_u32(odp_atomic_u32_t *atom)
-{
- (void)__atomic_fetch_add(&atom->v, 1, __ATOMIC_RELAXED);
-}
-
-_STATIC uint32_t odp_atomic_fetch_dec_u32(odp_atomic_u32_t *atom)
-{
- return __atomic_fetch_sub(&atom->v, 1, __ATOMIC_RELAXED);
-}
-
-_STATIC void odp_atomic_dec_u32(odp_atomic_u32_t *atom)
-{
- (void)__atomic_fetch_sub(&atom->v, 1, __ATOMIC_RELAXED);
-}
-
-_STATIC int odp_atomic_cas_u32(odp_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 uint32_t odp_atomic_xchg_u32(odp_atomic_u32_t *atom, uint32_t new_val)
-{
- return __atomic_exchange_n(&atom->v, new_val, __ATOMIC_RELAXED);
-}
-
-_STATIC void odp_atomic_max_u32(odp_atomic_u32_t *atom, uint32_t new_max)
-{
- uint32_t old_val;
-
- old_val = odp_atomic_load_u32(atom);
-
- while (new_max > old_val) {
- if (odp_atomic_cas_u32(atom, &old_val, new_max))
- break;
- }
-}
-
-_STATIC void odp_atomic_min_u32(odp_atomic_u32_t *atom, uint32_t new_min)
-{
- uint32_t old_val;
-
- old_val = odp_atomic_load_u32(atom);
-
- while (new_min < old_val) {
- if (odp_atomic_cas_u32(atom, &old_val, new_min))
- break;
- }
-}
-
-_STATIC void odp_atomic_init_u64(odp_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 uint64_t odp_atomic_load_u64(odp_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 void odp_atomic_store_u64(odp_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 uint64_t odp_atomic_fetch_add_u64(odp_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 void odp_atomic_add_u64(odp_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 uint64_t odp_atomic_fetch_sub_u64(odp_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 void odp_atomic_sub_u64(odp_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 uint64_t odp_atomic_fetch_inc_u64(odp_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 void odp_atomic_inc_u64(odp_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 uint64_t odp_atomic_fetch_dec_u64(odp_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 void odp_atomic_dec_u64(odp_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 int odp_atomic_cas_u64(odp_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 uint64_t odp_atomic_xchg_u64(odp_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 void odp_atomic_max_u64(odp_atomic_u64_t *atom, uint64_t new_max)
-{
- uint64_t old_val;
-
- old_val = odp_atomic_load_u64(atom);
-
- while (new_max > old_val) {
- if (odp_atomic_cas_u64(atom, &old_val, new_max))
- break;
- }
-}
-
-_STATIC void odp_atomic_min_u64(odp_atomic_u64_t *atom, uint64_t new_min)
-{
- uint64_t old_val;
-
- old_val = odp_atomic_load_u64(atom);
-
- while (new_min < old_val) {
- if (odp_atomic_cas_u64(atom, &old_val, new_min))
- break;
- }
-}
-
-_STATIC uint32_t odp_atomic_load_acq_u32(odp_atomic_u32_t *atom)
-{
- return __atomic_load_n(&atom->v, __ATOMIC_ACQUIRE);
-}
-
-_STATIC void odp_atomic_store_rel_u32(odp_atomic_u32_t *atom, uint32_t val)
-{
- __atomic_store_n(&atom->v, val, __ATOMIC_RELEASE);
-}
-
-_STATIC void odp_atomic_add_rel_u32(odp_atomic_u32_t *atom, uint32_t val)
-{
- (void)__atomic_fetch_add(&atom->v, val, __ATOMIC_RELEASE);
-}
-
-_STATIC void odp_atomic_sub_rel_u32(odp_atomic_u32_t *atom, uint32_t val)
-{
- (void)__atomic_fetch_sub(&atom->v, val, __ATOMIC_RELEASE);
-}
-
-_STATIC int odp_atomic_cas_acq_u32(odp_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 int odp_atomic_cas_rel_u32(odp_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 int odp_atomic_cas_acq_rel_u32(odp_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 uint64_t odp_atomic_load_acq_u64(odp_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 void odp_atomic_store_rel_u64(odp_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 void odp_atomic_add_rel_u64(odp_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 void odp_atomic_sub_rel_u64(odp_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 int odp_atomic_cas_acq_u64(odp_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 int odp_atomic_cas_rel_u64(odp_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 int odp_atomic_cas_acq_rel_u64(odp_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
-}
-
-#endif
deleted file mode 100644
@@ -1,88 +0,0 @@
-/* Copyright (c) 2015, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-/**
- * @file
- *
- * ODP atomic operations
- */
-
-#ifndef ODP_ATOMIC_TYPES_H_
-#define ODP_ATOMIC_TYPES_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <odp/api/std_types.h>
-#include <odp/api/align.h>
-
-/**
- * @internal
- * Atomic 64-bit unsigned integer
- */
-struct odp_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
-} ODP_ALIGNED(sizeof(uint64_t)); /* Enforce alignement! */
-
-/**
- * @internal
- * Atomic 32-bit unsigned integer
- */
-struct odp_atomic_u32_s {
- uint32_t v; /**< Actual storage for the atomic variable */
-} ODP_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 odp_atomic_u64_s odp_atomic_u64_t;
-
-typedef struct odp_atomic_u32_s odp_atomic_u32_t;
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
deleted file mode 100644
@@ -1,38 +0,0 @@
-/* Copyright (c) 2015, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-/**
- * @file
- *
- * ODP barrier
- */
-
-#ifndef ODP_BARRIER_TYPES_H_
-#define ODP_BARRIER_TYPES_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <odp/api/std_types.h>
-#include <odp/api/atomic.h>
-
-/**
- * @internal
- * ODP thread synchronization barrier
- */
-struct odp_barrier_s {
- uint32_t count; /**< Thread count */
- odp_atomic_u32_t bar; /**< Barrier counter */
-};
-
-typedef struct odp_barrier_s odp_barrier_t;
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
deleted file mode 100644
@@ -1,45 +0,0 @@
-/* Copyright (c) 2015, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-/**
- * @file
- *
- * ODP buffer descriptor
- */
-
-#ifndef ODP_BUFFER_TYPES_H_
-#define ODP_BUFFER_TYPES_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <odp/api/std_types.h>
-#include <odp/api/plat/strong_types.h>
-
-/** ODP buffer */
-typedef ODP_HANDLE_T(odp_buffer_t);
-
-/** Invalid buffer */
-#define ODP_BUFFER_INVALID _odp_cast_scalar(odp_buffer_t, 0xffffffff)
-
-/** ODP buffer segment */
-typedef ODP_HANDLE_T(odp_buffer_seg_t);
-
-/** Invalid segment */
-#define ODP_SEGMENT_INVALID ((odp_buffer_seg_t)ODP_BUFFER_INVALID)
-
-/** Get printable format of odp_buffer_t */
-static inline uint64_t odp_buffer_to_u64(odp_buffer_t hdl)
-{
- return _odp_pri(hdl);
-}
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
deleted file mode 100644
@@ -1,140 +0,0 @@
-/* Copyright (c) 2016, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-/**
- * @file
- *
- * ODP byteorder
- */
-
-#ifndef ODP_PLAT_BYTEORDER_INLINES_H_
-#define ODP_PLAT_BYTEORDER_INLINES_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/** @ingroup odp_compiler_optim
- * @{
- */
-
-_STATIC uint16_t odp_be_to_cpu_16(odp_u16be_t be16)
-{
-#if ODP_BYTE_ORDER == ODP_LITTLE_ENDIAN
- return __odp_builtin_bswap16((__odp_force uint16_t)be16);
-#else
- return (__odp_force uint16_t)be16;
-#endif
-}
-
-_STATIC uint32_t odp_be_to_cpu_32(odp_u32be_t be32)
-{
-#if ODP_BYTE_ORDER == ODP_LITTLE_ENDIAN
- return __builtin_bswap32((__odp_force uint32_t)be32);
-#else
- return (__odp_force uint32_t)be32;
-#endif
-}
-
-_STATIC uint64_t odp_be_to_cpu_64(odp_u64be_t be64)
-{
-#if ODP_BYTE_ORDER == ODP_LITTLE_ENDIAN
- return __builtin_bswap64((__odp_force uint64_t)be64);
-#else
- return (__odp_force uint64_t)be64;
-#endif
-}
-
-_STATIC odp_u16be_t odp_cpu_to_be_16(uint16_t cpu16)
-{
-#if ODP_BYTE_ORDER == ODP_LITTLE_ENDIAN
- return (__odp_force odp_u16be_t)__odp_builtin_bswap16(cpu16);
-#else
- return (__odp_force odp_u16be_t)cpu16;
-#endif
-}
-
-_STATIC odp_u32be_t odp_cpu_to_be_32(uint32_t cpu32)
-{
-#if ODP_BYTE_ORDER == ODP_LITTLE_ENDIAN
- return (__odp_force odp_u32be_t)__builtin_bswap32(cpu32);
-#else
- return (__odp_force odp_u32be_t)cpu32;
-#endif
-}
-
-_STATIC odp_u64be_t odp_cpu_to_be_64(uint64_t cpu64)
-{
-#if ODP_BYTE_ORDER == ODP_LITTLE_ENDIAN
- return (__odp_force odp_u64be_t)__builtin_bswap64(cpu64);
-#else
- return (__odp_force odp_u64be_t)cpu64;
-#endif
-}
-
-_STATIC uint16_t odp_le_to_cpu_16(odp_u16le_t le16)
-{
-#if ODP_BYTE_ORDER == ODP_LITTLE_ENDIAN
- return (__odp_force uint16_t)le16;
-#else
- return __odp_builtin_bswap16((__odp_force uint16_t)le16);
-#endif
-}
-
-_STATIC uint32_t odp_le_to_cpu_32(odp_u32le_t le32)
-{
-#if ODP_BYTE_ORDER == ODP_LITTLE_ENDIAN
- return (__odp_force uint32_t)le32;
-#else
- return __builtin_bswap32((__odp_force uint32_t)le32);
-#endif
-}
-
-_STATIC uint64_t odp_le_to_cpu_64(odp_u64le_t le64)
-{
-#if ODP_BYTE_ORDER == ODP_LITTLE_ENDIAN
- return (__odp_force uint64_t)le64;
-#else
- return __builtin_bswap64((__odp_force uint64_t)le64);
-#endif
-}
-
-_STATIC odp_u16le_t odp_cpu_to_le_16(uint16_t cpu16)
-{
-#if ODP_BYTE_ORDER == ODP_LITTLE_ENDIAN
- return (__odp_force odp_u16le_t)cpu16;
-#else
- return (__odp_force odp_u16le_t)__odp_builtin_bswap16(cpu16);
-#endif
-}
-
-_STATIC odp_u32le_t odp_cpu_to_le_32(uint32_t cpu32)
-{
-#if ODP_BYTE_ORDER == ODP_LITTLE_ENDIAN
- return (__odp_force odp_u32le_t)cpu32;
-#else
- return (__odp_force odp_u32le_t)__builtin_bswap32(cpu32);
-#endif
-}
-
-_STATIC odp_u64le_t odp_cpu_to_le_64(uint64_t cpu64)
-{
-#if ODP_BYTE_ORDER == ODP_LITTLE_ENDIAN
- return (__odp_force odp_u64le_t)cpu64;
-#else
- return (__odp_force odp_u64le_t)__builtin_bswap64(cpu64);
-#endif
-}
-
-/**
- * @}
- */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
deleted file mode 100644
@@ -1,87 +0,0 @@
-/* Copyright (c) 2015, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-
-/**
- * @file
- *
- * ODP byteorder
- */
-
-#ifndef ODP_BYTEORDER_TYPES_H_
-#define ODP_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 __odp_bitwise __attribute__((bitwise))
-/** @internal force attribute */
-#define __odp_force __attribute__((force))
-#else
-/** @internal bitwise attribute */
-#define __odp_bitwise
-/** @internal force attribute */
-#define __odp_force
-#endif
-
-
-/** @addtogroup odp_compiler_optim
- * @{
- */
-#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
- #define ODP_LITTLE_ENDIAN 1
- #define ODP_BIG_ENDIAN 0
- #define ODP_BYTE_ORDER ODP_LITTLE_ENDIAN
- #define ODP_LITTLE_ENDIAN_BITFIELD 1
- #define ODP_BIG_ENDIAN_BITFIELD 0
- #define ODP_BITFIELD_ORDER ODP_LITTLE_ENDIAN_BITFIELD
-#else
- #define ODP_LITTLE_ENDIAN 0
- #define ODP_BIG_ENDIAN 1
- #define ODP_BYTE_ORDER ODP_BIG_ENDIAN
- #define ODP_LITTLE_ENDIAN_BITFIELD 0
- #define ODP_BIG_ENDIAN_BITFIELD 1
- #define ODP_BITFIELD_ORDER ODP_BIG_ENDIAN_BITFIELD
-#endif
-
-typedef uint16_t __odp_bitwise odp_u16le_t;
-typedef uint16_t __odp_bitwise odp_u16be_t;
-
-typedef uint32_t __odp_bitwise odp_u32le_t;
-typedef uint32_t __odp_bitwise odp_u32be_t;
-
-typedef uint64_t __odp_bitwise odp_u64le_t;
-typedef uint64_t __odp_bitwise odp_u64be_t;
-
-typedef uint16_t __odp_bitwise odp_u16sum_t;
-typedef uint32_t __odp_bitwise odp_u32sum_t;
-
-/**
- * @}
- */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
deleted file mode 100644
@@ -1,57 +0,0 @@
-/* Copyright (c) 2015, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-/**
- * @file
- *
- * ODP classification descriptor
- */
-
-#ifndef ODP_CLASSIFY_TYPES_H_
-#define ODP_CLASSIFY_TYPES_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <odp/api/plat/strong_types.h>
-
-/** @addtogroup odp_classification
- * @{
- */
-
-typedef ODP_HANDLE_T(odp_cos_t);
-typedef ODP_HANDLE_T(odp_flowsig_t);
-
-#define ODP_COS_INVALID _odp_cast_scalar(odp_cos_t, ~0)
-#define ODP_COS_NAME_LEN 32
-
-typedef uint16_t odp_cos_flow_set_t;
-
-typedef ODP_HANDLE_T(odp_pmr_t);
-#define ODP_PMR_INVAL _odp_cast_scalar(odp_pmr_t, ~0)
-
-/** Get printable format of odp_cos_t */
-static inline uint64_t odp_cos_to_u64(odp_cos_t hdl)
-{
- return _odp_pri(hdl);
-}
-
-/** Get printable format of odp_pmr_t */
-static inline uint64_t odp_pmr_to_u64(odp_pmr_t hdl)
-{
- return _odp_pri(hdl);
-}
-
-/**
- * @}
- */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
deleted file mode 100644
@@ -1,54 +0,0 @@
-/* Copyright (c) 2015, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-
-/**
- * @file
- *
- * ODP CPU masks and enumeration
- */
-
-#ifndef ODP_CPUMASK_TYPES_H_
-#define ODP_CPUMASK_TYPES_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/** @addtogroup odp_cpumask
- * @{
- */
-
-#include <odp/api/std_types.h>
-#include <odp/api/align.h>
-
-#define ODP_CPUMASK_SIZE 1024
-
-#define ODP_CPUMASK_STR_SIZE ((ODP_CPUMASK_SIZE + 3) / 4 + 3)
-
-/**
- * CPU mask
- *
- * Don't access directly, use access functions.
- */
-typedef struct odp_cpumask_t {
- /** @private CPU mask storage
- *
- * This is private to the implementation.
- * Don't access directly, use access functions.
- */
- uint8_t _u8[ODP_CPUMASK_SIZE / 8];
-} odp_cpumask_t ODP_ALIGNED(8);
-
-/**
- * @}
- */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
deleted file mode 100644
@@ -1,50 +0,0 @@
-/* Copyright (c) 2015, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-
-/**
- * @file
- *
- * ODP crypto
- */
-
-#ifndef ODP_CRYPTO_TYPES_H_
-#define ODP_CRYPTO_TYPES_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/** @addtogroup odp_crypto
- * @{
- */
-
-#define ODP_CRYPTO_SESSION_INVALID (0xffffffffffffffffULL)
-
-typedef uint64_t odp_crypto_session_t;
-typedef ODP_HANDLE_T(odp_crypto_compl_t);
-
-/** Get printable format of odp_crypto_session_t */
-static inline uint64_t odp_crypto_session_to_u64(odp_crypto_session_t hdl)
-{
- return (uint64_t)hdl;
-}
-
-/** Get printable format of odp_crypto_compl_t_t */
-static inline uint64_t odp_crypto_compl_to_u64(odp_crypto_compl_t hdl)
-{
- return _odp_pri(hdl);
-}
-
-/**
- * @}
- */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
deleted file mode 100644
@@ -1,57 +0,0 @@
-/* Copyright (c) 2015, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-
-/**
- * @file
- *
- * ODP event
- */
-
-#ifndef ODP_EVENT_TYPES_H_
-#define ODP_EVENT_TYPES_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <odp/api/std_types.h>
-#include <odp/api/plat/strong_types.h>
-
-/** @defgroup odp_event ODP EVENT
- * Operations on an event.
- * @{
- */
-
-typedef ODP_HANDLE_T(odp_event_t);
-
-#define ODP_EVENT_INVALID _odp_cast_scalar(odp_event_t, 0xffffffff)
-
-/**
- * Event types
- */
-typedef enum odp_event_type_t {
- ODP_EVENT_BUFFER = 1,
- ODP_EVENT_PACKET = 2,
- ODP_EVENT_TIMEOUT = 3,
- ODP_EVENT_CRYPTO_COMPL = 4,
-} odp_event_type_t;
-
-/** Get printable format of odp_event_t */
-static inline uint64_t odp_event_to_u64(odp_event_t hdl)
-{
- return _odp_pri(hdl);
-}
-
-/**
- * @}
- */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
deleted file mode 100644
@@ -1,35 +0,0 @@
-/* Copyright (c) 2015, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-/**
- * @file
- *
- * ODP initialization.
- */
-
-#ifndef ODP_INIT_TYPES_H_
-#define ODP_INIT_TYPES_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <odp/api/std_types.h>
-
-typedef uint64_t odp_instance_t;
-
-/**
- * @internal platform specific data
- */
-typedef struct odp_platform_init_t {
- int ipc_ns; /**< Name space for ipc shared objects. */
-} odp_platform_init_t;
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
deleted file mode 100644
@@ -1,64 +0,0 @@
-/* Copyright (c) 2015, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-
-/**
- * @file
- *
- * ODP Packet IO
- */
-
-#ifndef ODP_PACKET_IO_TYPES_H_
-#define ODP_PACKET_IO_TYPES_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <odp/api/std_types.h>
-#include <odp/api/plat/strong_types.h>
-
-/** @addtogroup odp_packet_io
- * Operations on a packet.
- * @{
- */
-
-typedef ODP_HANDLE_T(odp_pktio_t);
-
-/** @internal */
-typedef struct odp_pktin_queue_t {
- odp_pktio_t pktio; /**< @internal pktio handle */
- int index; /**< @internal pktio queue index */
-} odp_pktin_queue_t;
-
-/** @internal */
-typedef struct odp_pktout_queue_t {
- odp_pktio_t pktio; /**< @internal pktio handle */
- int index; /**< @internal pktio queue index */
-} odp_pktout_queue_t;
-
-#define ODP_PKTIO_INVALID _odp_cast_scalar(odp_pktio_t, 0)
-
-#define ODP_PKTIO_MACADDR_MAXSIZE 16
-
-#define ODP_PKTIN_NO_WAIT 0
-#define ODP_PKTIN_WAIT UINT64_MAX
-
-/** Get printable format of odp_pktio_t */
-static inline uint64_t odp_pktio_to_u64(odp_pktio_t hdl)
-{
- return _odp_pri(hdl);
-}
-
-/**
- * @}
- */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
deleted file mode 100644
@@ -1,72 +0,0 @@
-/* Copyright (c) 2015, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-
-/**
- * @file
- *
- * ODP packet descriptor
- */
-
-#ifndef ODP_PACKET_TYPES_H_
-#define ODP_PACKET_TYPES_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <odp/api/std_types.h>
-#include <odp/api/plat/strong_types.h>
-
-/** @addtogroup odp_packet ODP PACKET
- * Operations on a packet.
- * @{
- */
-
-typedef ODP_HANDLE_T(odp_packet_t);
-
-#define ODP_PACKET_INVALID _odp_cast_scalar(odp_packet_t, 0xffffffff)
-
-#define ODP_PACKET_OFFSET_INVALID (0x0fffffff)
-
-/* A packet segment handle stores a small index. Strong type handles are
- * pointers, which would be wasteful in this case. */
-typedef uint8_t odp_packet_seg_t;
-
-#define ODP_PACKET_SEG_INVALID ((odp_packet_seg_t)-1)
-
-/** odp_packet_color_t assigns names to the various pkt "colors" */
-typedef enum {
- ODP_PACKET_GREEN = 0,
- ODP_PACKET_YELLOW = 1,
- ODP_PACKET_RED = 2,
- ODP_PACKET_ALL_COLORS = 3,
-} odp_packet_color_t;
-
-/** Sets the maximum number of pkt "colors" */
-#define ODP_NUM_PACKET_COLORS 3
-
-/** Get printable format of odp_packet_t */
-static inline uint64_t odp_packet_to_u64(odp_packet_t hdl)
-{
- return _odp_pri(hdl);
-}
-
-/** Get printable format of odp_packet_seg_t */
-static inline uint64_t odp_packet_seg_to_u64(odp_packet_seg_t hdl)
-{
- return _odp_pri(hdl);
-}
-
-/**
- * @}
- */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
deleted file mode 100644
@@ -1,52 +0,0 @@
-/* Copyright (c) 2015, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-/**
- * @file
- *
- * ODP pool
- */
-
-#ifndef ODP_POOL_TYPES_H_
-#define ODP_POOL_TYPES_H_
-
-#include <odp/api/std_types.h>
-#include <odp/api/plat/strong_types.h>
-#include <odp/api/plat/event_types.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/** @addtogroup odp_buffer
- * Operations on a pool.
- * @{
- */
-
-typedef ODP_HANDLE_T(odp_pool_t);
-
-#define ODP_POOL_INVALID _odp_cast_scalar(odp_pool_t, 0xffffffff)
-
-#define ODP_POOL_NAME_LEN 32
-
-/**
- * Pool type
- */
-typedef enum odp_pool_type_t {
- ODP_POOL_BUFFER = ODP_EVENT_BUFFER,
- ODP_POOL_PACKET = ODP_EVENT_PACKET,
- ODP_POOL_TIMEOUT = ODP_EVENT_TIMEOUT,
-} odp_pool_type_t;
-
-/**
- * @}
- */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
deleted file mode 100644
@@ -1,57 +0,0 @@
-/* Copyright (c) 2015, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-/**
- * @file
- *
- * ODP queue
- */
-
-#ifndef ODP_QUEUE_TYPES_H_
-#define ODP_QUEUE_TYPES_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <odp/api/std_types.h>
-#include <odp/api/plat/strong_types.h>
-
-/** @addtogroup odp_queue ODP QUEUE
- * Macros and operation on a queue.
- * @{
- */
-
-typedef ODP_HANDLE_T(odp_queue_t);
-
-typedef ODP_HANDLE_T(odp_queue_group_t);
-
-#define ODP_QUEUE_INVALID _odp_cast_scalar(odp_queue_t, 0)
-
-#define ODP_QUEUE_NAME_LEN 32
-
-/**
- * @def ODP_QUEUE_TYPE_TM
- * Traffic manager queue
- * @note Internal to the implementation -- not part of queue type API
- */
-#define ODP_QUEUE_TYPE_TM 4
-
-/** Get printable format of odp_queue_t */
-static inline uint64_t odp_queue_to_u64(odp_queue_t hdl)
-{
- return _odp_pri(hdl);
-}
-
-/**
- * @}
- */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
deleted file mode 100644
@@ -1,38 +0,0 @@
-/* Copyright (c) 2015, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-/**
- * @file
- *
- * ODP recursive read/write lock
- */
-
-#ifndef ODP_RWLOCK_RECURSIVE_TYPES_H_
-#define ODP_RWLOCK_RECURSIVE_TYPES_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <odp/api/rwlock.h>
-#include <odp/api/std_types.h>
-#include <odp/api/thread.h>
-
-/** @internal */
-struct odp_rwlock_recursive_s {
- odp_rwlock_t lock; /**< the lock */
- int wr_owner; /**< write owner thread */
- uint32_t wr_cnt; /**< write recursion count */
- uint8_t rd_cnt[ODP_THREAD_COUNT_MAX]; /**< read recursion count */
-};
-
-typedef struct odp_rwlock_recursive_s odp_rwlock_recursive_t;
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
deleted file mode 100644
@@ -1,37 +0,0 @@
-/* Copyright (c) 2015, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-
-/**
- * @file
- *
- * ODP rwlock
- */
-
-#ifndef ODP_RWLOCK_TYPES_H_
-#define ODP_RWLOCK_TYPES_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <odp/api/atomic.h>
-
-/** @internal */
-struct odp_rwlock_s {
- odp_atomic_u32_t cnt; /**< lock count
- 0 lock not taken
- -1 write lock taken
- >0 read lock(s) taken */
-};
-
-typedef struct odp_rwlock_s odp_rwlock_t;
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
deleted file mode 100644
@@ -1,62 +0,0 @@
-/* Copyright (c) 2015, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-
-/**
- * @file
- *
- * ODP schedule
- */
-
-#ifndef ODP_SCHEDULE_TYPES_H_
-#define ODP_SCHEDULE_TYPES_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/** @addtogroup odp_scheduler
- * @{
- */
-
-#define ODP_SCHED_WAIT UINT64_MAX
-#define ODP_SCHED_NO_WAIT 0
-
-typedef int odp_schedule_prio_t;
-
-#define ODP_SCHED_PRIO_HIGHEST 0
-
-#define ODP_SCHED_PRIO_NORMAL 4
-
-#define ODP_SCHED_PRIO_LOWEST 7
-
-#define ODP_SCHED_PRIO_DEFAULT ODP_SCHED_PRIO_NORMAL
-
-typedef int odp_schedule_sync_t;
-
-#define ODP_SCHED_SYNC_PARALLEL 0
-#define ODP_SCHED_SYNC_ATOMIC 1
-#define ODP_SCHED_SYNC_ORDERED 2
-
-typedef int odp_schedule_group_t;
-
-/* These must be kept in sync with thread_globals_t in odp_thread.c */
-#define ODP_SCHED_GROUP_INVALID -1
-#define ODP_SCHED_GROUP_ALL 0
-#define ODP_SCHED_GROUP_WORKER 1
-#define ODP_SCHED_GROUP_CONTROL 2
-
-#define ODP_SCHED_GROUP_NAME_LEN 32
-
-/**
- * @}
- */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
deleted file mode 100644
@@ -1,50 +0,0 @@
-/* Copyright (c) 2015, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-
-/**
- * @file
- *
- * ODP shared memory
- */
-
-#ifndef ODP_SHARED_MEMORY_TYPES_H_
-#define ODP_SHARED_MEMORY_TYPES_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <odp/api/std_types.h>
-#include <odp/api/plat/strong_types.h>
-
-/** @addtogroup odp_shared_memory ODP SHARED MEMORY
- * Operations on shared memory.
- * @{
- */
-
-typedef ODP_HANDLE_T(odp_shm_t);
-
-#define ODP_SHM_INVALID _odp_cast_scalar(odp_shm_t, 0)
-#define ODP_SHM_NULL ODP_SHM_INVALID
-
-#define ODP_SHM_NAME_LEN 32
-
-/** Get printable format of odp_shm_t */
-static inline uint64_t odp_shm_to_u64(odp_shm_t hdl)
-{
- return _odp_pri(hdl);
-}
-
-/**
- * @}
- */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
deleted file mode 100644
@@ -1,36 +0,0 @@
-/* Copyright (c) 2015, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-/**
- * @file
- *
- * ODP recursive spinlock
- */
-
-#ifndef ODP_SPINLOCK_RECURSIVE_TYPES_H_
-#define ODP_SPINLOCK_RECURSIVE_TYPES_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <odp/api/spinlock.h>
-#include <odp/api/std_types.h>
-
-/** @internal */
-struct odp_spinlock_recursive_s {
- odp_spinlock_t lock; /**< the lock */
- int owner; /**< thread owning the lock */
- uint32_t cnt; /**< recursion count */
-};
-
-typedef struct odp_spinlock_recursive_s odp_spinlock_recursive_t;
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
deleted file mode 100644
@@ -1,34 +0,0 @@
-/* Copyright (c) 2015, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-
-/**
- * @file
- *
- * ODP spinlock
- */
-
-#ifndef ODP_SPINLOCK_TYPES_H_
-#define ODP_SPINLOCK_TYPES_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <odp/api/std_types.h>
-
-/** @internal */
-struct odp_spinlock_s {
- char lock; /**< lock flag, should match odp_atomic_flag_t */
-};
-
-typedef struct odp_spinlock_s odp_spinlock_t;
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
deleted file mode 100644
@@ -1,43 +0,0 @@
-/* Copyright (c) 2016, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-/**
- * @file
- *
- * Macro for static inline functions
- */
-
-#ifndef ODP_PLAT_STATIC_INLINE_H_
-#define ODP_PLAT_STATIC_INLINE_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * @internal
- * @def ODP_ABI_COMPAT
- * Control ABI compatibility
- */
-
-/**
- * @internal
- * @def _STATIC
- * Control conditional static inline expansions for ABI compatibility
- */
-#if @ODP_ABI_COMPAT@
-#define ODP_ABI_COMPAT 1
-#define _STATIC
-#else
-#define ODP_ABI_COMPAT 0
-#define _STATIC static inline
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
deleted file mode 100644
@@ -1,36 +0,0 @@
-/* Copyright (c) 2016, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-#ifndef ODP_PLAT_STD_CLIB_INLINE_H_
-#define ODP_PLAT_STD_CLIB_INLINE_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <odp/api/spec/std_types.h>
-#include <string.h>
-
-_STATIC void *odp_memcpy(void *dst, const void *src, size_t num)
-{
- return memcpy(dst, src, num);
-}
-
-_STATIC void *odp_memset(void *ptr, int value, size_t num)
-{
- return memset(ptr, value, num);
-}
-
-_STATIC int odp_memcmp(const void *ptr1, const void *ptr2, size_t num)
-{
- return memcmp(ptr1, ptr2, num);
-}
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
deleted file mode 100644
@@ -1,36 +0,0 @@
-/* Copyright (c) 2015, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-
-/**
- * @file
- *
- * ODP Strong Types. Common macros for implementing strong typing
- * for ODP abstract data types
- */
-
-#ifndef STRONG_TYPES_H_
-#define STRONG_TYPES_H_
-
-/** Use strong typing for ODP types */
-#ifdef __cplusplus
-#define ODP_HANDLE_T(type) struct _##type { uint8_t unused_dummy_var; } *type
-#else
-#define odp_handle_t struct { uint8_t unused_dummy_var; } *
-/** C/C++ helper macro for strong typing */
-#define ODP_HANDLE_T(type) odp_handle_t type
-#endif
-
-/** Internal macro to get value of an ODP handle */
-#define _odp_typeval(handle) ((uint32_t)(uintptr_t)(handle))
-
-/** Internal macro to get printable value of an ODP handle */
-#define _odp_pri(handle) ((uint64_t)_odp_typeval(handle))
-
-/** Internal macro to convert a scalar to a typed handle */
-#define _odp_cast_scalar(type, val) ((type)(uintptr_t)(val))
-
-#endif
deleted file mode 100644
@@ -1,47 +0,0 @@
-/* Copyright (c) 2016, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-/**
- * @file
- *
- * ODP synchronisation inlines
- */
-
-#ifndef ODP_PLAT_SYNC_INLINE_H_
-#define ODP_PLAT_SYNC_INLINE_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/** @ingroup odp_barrier
- * @{
- */
-
-_STATIC void odp_mb_release(void)
-{
- __atomic_thread_fence(__ATOMIC_RELEASE);
-}
-
-_STATIC void odp_mb_acquire(void)
-{
- __atomic_thread_fence(__ATOMIC_ACQUIRE);
-}
-
-_STATIC void odp_mb_full(void)
-{
- __atomic_thread_fence(__ATOMIC_SEQ_CST);
-}
-
-/**
- * @}
- */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
deleted file mode 100644
@@ -1,34 +0,0 @@
-/* Copyright (c) 2015, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-/**
- * @file
- *
- * ODP thread
- */
-
-#ifndef ODP_THREAD_TYPES_H_
-#define ODP_THREAD_TYPES_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/** @addtogroup odp_thread
- * @{
- */
-
-#define ODP_THREAD_COUNT_MAX 128
-
-/**
- * @}
- */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
deleted file mode 100644
@@ -1,48 +0,0 @@
-/* Copyright (c) 2015, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-/**
- * @file
- *
- * ODP thread masks
- */
-
-#ifndef ODP_THRMASK_TYPES_H_
-#define ODP_THRMASK_TYPES_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/** @addtogroup odp_thread
- * @{
- */
-
-#include <odp/api/cpumask.h>
-
-/**
- * Minimum size of output buffer for odp_thrmask_to_str()
- */
-#define ODP_THRMASK_STR_SIZE ODP_CPUMASK_STR_SIZE
-
-/**
- * Thread mask
- *
- * Don't access directly, use access functions.
- */
-typedef struct odp_thrmask_t {
- odp_cpumask_t m; /**< @private Mask*/
-} odp_thrmask_t;
-
-/**
- * @}
- */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
deleted file mode 100644
@@ -1,35 +0,0 @@
-/* Copyright (c) 2015, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-
-/**
- * @file
- *
- * ODP ticketlock
- */
-
-#ifndef ODP_TICKETLOCK_TYPES_H_
-#define ODP_TICKETLOCK_TYPES_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <odp/api/atomic.h>
-
-/** @internal */
-struct odp_ticketlock_s {
- odp_atomic_u32_t next_ticket; /**< Next ticket */
- odp_atomic_u32_t cur_ticket; /**< Current ticket */
-};
-
-typedef struct odp_ticketlock_s odp_ticketlock_t;
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
deleted file mode 100644
@@ -1,43 +0,0 @@
-/* Copyright (c) 2015, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-/**
- * @file
- *
- * ODP time service
- */
-
-#ifndef ODP_TIME_TYPES_H_
-#define ODP_TIME_TYPES_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/** @addtogroup odp_time
- * @{
- **/
-
-/**
- * @internal Time structure used to isolate odp-linux implementation from
- * the linux timespec structure, which is dependent on POSIX extension level.
- */
-typedef struct odp_time_t {
- int64_t tv_sec; /**< @internal Seconds */
- int64_t tv_nsec; /**< @internal Nanoseconds */
-} odp_time_t;
-
-#define ODP_TIME_NULL ((odp_time_t){0, 0})
-
-/**
- * @}
- */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
deleted file mode 100644
@@ -1,51 +0,0 @@
-/* Copyright (c) 2013, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-
-/**
- * @file
- *
- * ODP timer service
- */
-
-#ifndef ODP_TIMER_TYPES_H_
-#define ODP_TIMER_TYPES_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <odp/api/plat/strong_types.h>
-
-/** @addtogroup odp_timer
- * @{
- **/
-
-struct odp_timer_pool_s; /**< Forward declaration */
-
-typedef struct odp_timer_pool_s *odp_timer_pool_t;
-
-#define ODP_TIMER_POOL_INVALID NULL
-
-#define ODP_TIMER_POOL_NAME_LEN 32
-
-typedef ODP_HANDLE_T(odp_timer_t);
-
-#define ODP_TIMER_INVALID _odp_cast_scalar(odp_timer_t, 0xffffffff)
-
-typedef ODP_HANDLE_T(odp_timeout_t);
-
-#define ODP_TIMEOUT_INVALID _odp_cast_scalar(odp_timeout_t, 0xffffffff)
-
-/**
- * @}
- */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
deleted file mode 100644
@@ -1,185 +0,0 @@
-/* Copyright (c) 2015, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-/**
- * @file
- *
- * ODP traffic mngr
- */
-
-#ifndef ODP_TRAFFIC_MNGR_TYPES_H_
-#define ODP_TRAFFIC_MNGR_TYPES_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <odp/api/std_types.h>
-#include <odp/api/plat/strong_types.h>
-
-/** @addtogroup odp_traffic_mngr
- * Macros and operations on a TM system.
- * @{
- */
-
-/** The ODP_TM_MAX_NUM_SYSTEMS constant specifies the maximum number of TM
- * systems that may be created. On some platforms this might be much more
- * limited to as little as one hardware TM system.
- */
-#define ODP_TM_MAX_NUM_SYSTEMS 64
-
-/** The ODP_TM_MAX_PRIORITIES constant specifies the largest range of
- * priorities that any TM system can support. All strict priority values MUST
- * in the range 0..ODP_TM_MAX_PRIORITIES-1.
- */
-#define ODP_TM_MAX_PRIORITIES 16
-
-/** The ODP_TM MAX_LEVELS constant specifies the largest range of
- * tm_node levels that any TM system can support. Hence all tm_node level
- * values MUST be in the range 0..ODP_TM_MAX_LEVELS-1. Smaller tm_node
- * levels are associated with tm_nodes closer to the TM system egress.
- */
-#define ODP_TM_MAX_LEVELS 8
-
-/**
- * The smallest SCHED weight is 1 (i.e. 0 is not a legal WFQ/WRR value).
- */
-#define ODP_TM_MIN_SCHED_WEIGHT 1
-
-/** The ODP_TM_MAX_SCHED_WEIGHT constant is the largest weight any TM system
- * can support (at least from a configuration standpoint). A given TM system
- * could have a smaller value.
- */
-#define ODP_TM_MAX_SCHED_WEIGHT 255
-
-/** The ODP_TM_MAX_TM_QUEUES constant is the largest number of tm_queues
- * that can handled by any one TM system.
- */
-#define ODP_TM_MAX_TM_QUEUES (16 * 1024 * 1024)
-
-/** The ODP_TM_MAX_NUM_OUTPUTS constant is the largest number of outputs that
- * can be configured for any one TM system.
- */
-#define ODP_TM_MAX_NUM_OUTPUTS 256
-
-/** The ODP_TM_MAX_NUM_TM_NODES constant is the largest number of tm_nodes that
- * can be in existence for any one TM system.
- */
-#define ODP_TM_MAX_NUM_TM_NODES (1024 * 1024)
-
-/** The ODP_TM_MAX_TM_NODE_FANIN constant is the largest number of fan-in
- * "inputs" that can be simultaneously connected to a single tm_node.
- * *TBD* Does this need to be as large as ODP_TM_MAX_TM_QUEUES? *TBD*
- */
-#define ODP_TM_MAX_TM_NODE_FANIN (1024 * 1024)
-
-/** The ODP_TM_MIN_SHAPER_BW constant is the smallest amount of bandwidth that
- * can a shaper's peak or commit rate can be set to. It is in units of
- * 1000 bytes/second so that it and the ODP_TM_MAX_SHAPER_BW can both fit in
- * 32 bits.
- */
-#define ODP_TM_MIN_SHAPER_BW 1
-
-/** The ODP_TM_MAX_SHAPER_BW constant is the largest amound of bandwidth that
- * any shaper's peak or commit rate can be set to. It is in units of
- * 1000 bytes/second so that it and the ODP_TM_MIN_SHAPER_BW can both fit in
- * 32 bits.
- */
-#define ODP_TM_MAX_SHAPER_BW 12500000
-
-/** The ODP_NUM_SHAPER_COLORS constant just counts the number of enumeration
- * values defined in the odp_tm_shaper_color_t type.
- */
-#define ODP_NUM_SHAPER_COLORS 3
-
-/** The INVALID_PRIORITY constant is used when one needs to indicate an
- * invalid priority value.
- */
-#define ODP_TM_INVALID_PRIORITY 255
-
-/** The odp_tm_percent_t type is used when specifying fields that are
- * percentages. It is a fixed point integer whose units are 1/100 of a
- * percent. Hence 100% is represented as the integer value 10000. Note
- * that because it is often used as a ratio of the current queue value and
- * maximum queue threshold, it can be > 100%, but in any event will never
- * be larger than 500% (i.e. it MUST be capped at 50000).
- */
-typedef uint16_t odp_tm_percent_t;
-
-/** The odp_tm_handle_t type is a generic type that can stand for any of the
- * other ODP_TM handle types.
- */
-typedef uint64_t odp_tm_handle_t;
-
-/** Each odp_tm_t value represents a specific TM system. Almost all
- * functions in this API require a odp_tm_t value - either directly
- * as a function parameter or indirectly by having another ODP TM handle value
- * as a function parameter.
- */
-typedef odp_tm_handle_t odp_tm_t;
-
-/** Each odp_tm_queue_t value is an opaque ODP handle representing a specific
- * tm_queue within a specific TM system.
- */
-typedef odp_tm_handle_t odp_tm_queue_t;
-
-/** Each odp_tm_node_t value is an opaque ODP handle representing a specific
- * tm_node within a specific TM system.
- */
-typedef odp_tm_handle_t odp_tm_node_t;
-
-/** Each odp_tm_shaper_t value is an opaque ODP handle representing a specific
- * shaper profile usable across all TM systems described by this API. A given
- * shaper profile can then be attached to any tm_queue or tm_node.
- */
-typedef odp_tm_handle_t odp_tm_shaper_t;
-
-/** Each odp_tm_sched_t value is an opaque ODP handle representing a specific
- * tm_node scheduler profile usable across all TM systems described by this
- * API. A given tm_node scheduler profile can then be attached to any tm_node.
- */
-typedef odp_tm_handle_t odp_tm_sched_t;
-
-/** Each odp_tm_threshold_t value is an opaque ODP handle representing a
- * specific queue threshold profile usable across all TM systems described by
- * this API. A given queue threshold profile can then be attached to any
- * tm_queue or tm_node.
- */
-typedef odp_tm_handle_t odp_tm_threshold_t;
-
-/** Each odp_tm_wred_t value is an opaque ODP handle representing a specific
- * WRED profile usable across all TM systems described by this API. A given
- * WRED profile can then be attached to any tm_queue or tm_node.
- */
-typedef odp_tm_handle_t odp_tm_wred_t;
-
-/** The ODP_TM_INVALID constant can be used with any ODP TM handle type and
- * indicates that this value does NOT represent a valid TM object.
- */
-#define ODP_TM_INVALID 0
-
-/**
- * @def ODP_TM_ROOT
- * Constant that is used to refer to the egress/root node of the TM subsystem's
- * tree/hierarchy of nodes.
- */
-#define ODP_TM_ROOT ((odp_tm_handle_t)-1)
-
-/** Get printable format of odp_queue_t */
-static inline uint64_t odp_tm_handle_to_u64(odp_tm_handle_t hdl)
-{
- return hdl;
-}
-
-/**
- * @}
- */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
deleted file mode 100644
@@ -1,30 +0,0 @@
-/* Copyright (c) 2015, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-#ifndef ODP_VERSION_TYPESH_
-#define ODP_VERSION_TYPESH_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/** @internal Version string expand */
-#define ODP_VERSION_STR_EXPAND(x) #x
-
-/** @internal Version to string */
-#define ODP_VERSION_TO_STR(x) ODP_VERSION_STR_EXPAND(x)
-
-/** @internal API version string */
-#define ODP_VERSION_API_STR \
-ODP_VERSION_TO_STR(ODP_VERSION_API_GENERATION) "." \
-ODP_VERSION_TO_STR(ODP_VERSION_API_MAJOR) "." \
-ODP_VERSION_TO_STR(ODP_VERSION_API_MINOR)
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
deleted file mode 100644
@@ -1,37 +0,0 @@
-/* Copyright (c) 2015, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-/**
- * @file
- *
- * ODP pool
- */
-
-#ifndef ODP_PLAT_POOL_H_
-#define ODP_PLAT_POOL_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/** @ingroup odp_buffer
- * @{
- */
-
-/**
- * @}
- */
-
-#include <odp/api/plat/pool_types.h>
-#include <odp/api/plat/shared_memory_types.h>
-#include <odp/api/plat/event_types.h>
-#include <odp/api/spec/pool.h>
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
deleted file mode 100644
@@ -1,40 +0,0 @@
-/* Copyright (c) 2013, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-/**
- * @file
- *
- * ODP queue
- */
-
-#ifndef ODP_PLAT_QUEUE_H_
-#define ODP_PLAT_QUEUE_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <odp/api/std_types.h>
-#include <odp/api/plat/event_types.h>
-#include <odp/api/plat/queue_types.h>
-#include <odp/api/plat/buffer_types.h>
-#include <odp/api/plat/pool_types.h>
-
-/** @ingroup odp_queue
- * @{
- */
-
-/**
- * @}
- */
-
-#include <odp/api/spec/queue.h>
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
deleted file mode 100644
@@ -1,34 +0,0 @@
-/* Copyright (c) 2015, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-/**
- * @file
- *
- * ODP random number API
- */
-
-#ifndef ODP_PLAT_RANDOM_H_
-#define ODP_PLAT_RANDOM_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/** @ingroup odp_random ODP RANDOM
- * @{
- */
-
-/**
- * @}
- */
-
-#include <odp/api/spec/random.h>
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
deleted file mode 100644
@@ -1,28 +0,0 @@
-/* Copyright (c) 2014, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-/**
- * @file
- *
- * ODP RW Locks
- */
-
-#ifndef ODP_PLAT_RWLOCK_H_
-#define ODP_PLAT_RWLOCK_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <odp/api/plat/rwlock_types.h>
-
-#include <odp/api/spec/rwlock.h>
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* ODP_RWLOCK_H_ */
deleted file mode 100644
@@ -1,28 +0,0 @@
-/* Copyright (c) 2015, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-/**
- * @file
- *
- * ODP resursive read/write lock
- */
-
-#ifndef ODP_PLAT_RWLOCK_RECURSIVE_H_
-#define ODP_PLAT_RWLOCK_RECURSIVE_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <odp/api/plat/rwlock_recursive_types.h>
-
-#include <odp/api/spec/rwlock_recursive.h>
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
deleted file mode 100644
@@ -1,36 +0,0 @@
-/* Copyright (c) 2013, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-/**
- * @file
- *
- * ODP schedule
- */
-
-#ifndef ODP_PLAT_SCHEDULE_H_
-#define ODP_PLAT_SCHEDULE_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <odp/api/plat/schedule_types.h>
-
-/** @ingroup odp_scheduler
- * @{
- */
-
-/**
- * @}
- */
-
-#include <odp/api/spec/schedule.h>
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
deleted file mode 100644
@@ -1,28 +0,0 @@
-/* Copyright (c) 2013, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-/**
- * @file
- *
- * ODP schedule
- */
-
-#ifndef ODP_PLAT_SCHEDULE_TYPES_H_
-#define ODP_PLAT_SCHEDULE_TYPES_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <odp/api/plat/schedule_types.h>
-
-#include <odp/api/spec/schedule_types.h>
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
deleted file mode 100644
@@ -1,36 +0,0 @@
-/* Copyright (c) 2013-2014, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-/**
- * @file
- *
- * ODP shared memory
- */
-
-#ifndef ODP_PLAT_SHARED_MEMORY_H_
-#define ODP_PLAT_SHARED_MEMORY_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <odp/api/plat/shared_memory_types.h>
-
-/** @ingroup odp_shared_memory
- * @{
- */
-
-/**
- * @}
- */
-
-#include <odp/api/spec/shared_memory.h>
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
deleted file mode 100644
@@ -1,28 +0,0 @@
-/* Copyright (c) 2013, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-/**
- * @file
- *
- * ODP spinlock
- */
-
-#ifndef ODP_PLAT_SPINLOCK_H_
-#define ODP_PLAT_SPINLOCK_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <odp/api/plat/spinlock_types.h>
-
-#include <odp/api/spec/spinlock.h>
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
deleted file mode 100644
@@ -1,28 +0,0 @@
-/* Copyright (c) 2015, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-/**
- * @file
- *
- * ODP resursive spinlock
- */
-
-#ifndef ODP_PLAT_SPINLOCK_RECURSIVE_H_
-#define ODP_PLAT_SPINLOCK_RECURSIVE_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <odp/api/plat/spinlock_recursive_types.h>
-
-#include <odp/api/spec/spinlock_recursive.h>
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
deleted file mode 100644
@@ -1,28 +0,0 @@
-/* Copyright (c) 2015, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-#ifndef ODP_PLAT_STD_CLIB_H_
-#define ODP_PLAT_STD_CLIB_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <odp/api/spec/std_types.h>
-#include <string.h>
-
-#include <odp/api/plat/static_inline.h>
-#if ODP_ABI_COMPAT == 0
-#include <odp/api/plat/std_clib_inlines.h>
-#endif
-
-#include <odp/api/spec/std_clib.h>
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
deleted file mode 100644
@@ -1,42 +0,0 @@
-/* Copyright (c) 2013, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-/**
- * @file
- *
- * Standard C language types and definitions for ODP.
- */
-
-#ifndef ODP_PLAT_STD_TYPES_H_
-#define ODP_PLAT_STD_TYPES_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* uint64_t, uint32_t, etc */
-#include <stdint.h>
-
-/* true and false for odp_bool_t */
-#include <stdbool.h>
-
-/** @addtogroup odp_system ODP SYSTEM
- * @{
- */
-
-typedef int odp_bool_t;
-
-/**
- * @}
- */
-
-#include <odp/api/spec/std_types.h>
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
deleted file mode 100644
@@ -1,39 +0,0 @@
-/* Copyright (c) 2013, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-/**
- * @file
- *
- * ODP synchronisation
- */
-
-#ifndef ODP_PLAT_SYNC_H_
-#define ODP_PLAT_SYNC_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/** @ingroup odp_barrier
- * @{
- */
-
-#include <odp/api/plat/static_inline.h>
-#if ODP_ABI_COMPAT == 0
-#include <odp/api/plat/sync_inlines.h>
-#endif
-
-/**
- * @}
- */
-
-#include <odp/api/spec/sync.h>
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
deleted file mode 100644
@@ -1,29 +0,0 @@
-/* Copyright (c) 2013, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-/**
- * @file
- *
- * ODP system information
- */
-
-#ifndef ODP_PLAT_SYSTEM_INFO_H_
-#define ODP_PLAT_SYSTEM_INFO_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <odp/api/std_types.h>
-
-
-#include <odp/api/spec/system_info.h>
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
deleted file mode 100644
@@ -1,28 +0,0 @@
-/* Copyright (c) 2013, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-/**
- * @file
- *
- * ODP thread API
- */
-
-#ifndef ODP_PLAT_THREAD_H_
-#define ODP_PLAT_THREAD_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <odp/api/plat/thread_types.h>
-
-#include <odp/api/spec/thread.h>
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
deleted file mode 100644
@@ -1,36 +0,0 @@
-/* Copyright (c) 2015, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-/**
- * @file
- *
- * ODP thread masks
- */
-
-#ifndef ODP_PLAT_THRMASK_H_
-#define ODP_PLAT_THRMASK_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <odp/api/plat/thrmask_types.h>
-
-/** @ingroup odp_thread
- * @{
- */
-
-/**
- * @}
- */
-
-#include <odp/api/spec/thrmask.h>
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
deleted file mode 100644
@@ -1,28 +0,0 @@
-/* Copyright (c) 2013, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-/**
- * @file
- *
- * ODP ticketlock
- */
-
-#ifndef ODP_PLAT_TICKETLOCK_H_
-#define ODP_PLAT_TICKETLOCK_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <odp/api/plat/ticketlock_types.h>
-
-#include <odp/api/spec/ticketlock.h>
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
deleted file mode 100644
@@ -1,31 +0,0 @@
-/* Copyright (c) 2013, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-/**
- * @file
- *
- * ODP time
- */
-
-#ifndef ODP_PLAT_TIME_H_
-#define ODP_PLAT_TIME_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <odp/api/std_types.h>
-
-
-
-#include <odp/api/plat/time_types.h>
-#include <odp/api/spec/time.h>
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
deleted file mode 100644
@@ -1,40 +0,0 @@
-/* Copyright (c) 2013, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-/**
- * @file
- *
- * ODP timer service
- */
-
-#ifndef ODP_PLAT_TIMER_H_
-#define ODP_PLAT_TIMER_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <odp/api/std_types.h>
-#include <odp/api/plat/event_types.h>
-#include <odp/api/plat/pool_types.h>
-#include <odp/api/plat/queue_types.h>
-#include <odp/api/plat/timer_types.h>
-
-/** @ingroup odp_timer
- * @{
- */
-
-/**
- * @}
- */
-
-#include <odp/api/spec/timer.h>
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
deleted file mode 100644
@@ -1,35 +0,0 @@
-/* Copyright (c) 2015, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-/**
- * @file
- *
- * ODP Traffic manager
- */
-
-#ifndef ODP_PLAT_TRAFFIC_MNGR_H_
-#define ODP_PLAT_TRAFFIC_MNGR_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/** @ingroup odp_traffic_mngr
- * @{
- */
-
-/**
- * @}
- */
-
-#include <odp/api/plat/traffic_mngr_types.h>
-#include <odp/api/spec/traffic_mngr.h>
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
deleted file mode 100644
@@ -1,27 +0,0 @@
-/* Copyright (c) 2013, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-/**
- * @file
- *
- * ODP version
- */
-
-#ifndef ODP_PLAT_VERSION_H_
-#define ODP_PLAT_VERSION_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <odp/api/plat/version_types.h>
-#include <odp/api/spec/version.h>
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
@@ -17,7 +17,6 @@
extern "C" {
#endif
-#include <odp/api/align.h>
#include <stdint.h>
/* Macros to calculate ODP_ROUNDUP_POWER2_U32() in five rounds of shift
@@ -16,10 +16,6 @@
#ifndef ODP_ATOMIC_INTERNAL_H_
#define ODP_ATOMIC_INTERNAL_H_
-#include <odp/api/std_types.h>
-#include <odp/api/align.h>
-#include <odp/api/hints.h>
-#include <odp/api/atomic.h>
#include <stdbool.h>
#ifdef __cplusplus
@@ -18,17 +18,8 @@
extern "C" {
#endif
-#include <odp/api/std_types.h>
-#include <odp/api/atomic.h>
-#include <odp/api/pool.h>
-#include <odp/api/buffer.h>
-#include <odp/api/debug.h>
-#include <odp/api/align.h>
#include <odp_align_internal.h>
#include <odp_config_internal.h>
-#include <odp/api/byteorder.h>
-#include <odp/api/thread.h>
-#include <odp/api/event.h>
#include <odp_forward_typedefs_internal.h>
#include <odp_schedule_if.h>
#include <stddef.h>
@@ -19,8 +19,6 @@
extern "C" {
#endif
-#include <odp/api/spinlock.h>
-#include <odp/api/classification.h>
#include <odp_pool_internal.h>
#include <odp_packet_internal.h>
#include <odp_packet_io_internal.h>
@@ -18,7 +18,6 @@
extern "C" {
#endif
-#include <odp/api/debug.h>
#include <protocols/eth.h>
#include <protocols/ip.h>
#include <protocols/ipsec.h>
@@ -19,10 +19,7 @@
extern "C" {
#endif
-#include <odp/api/classification.h>
-#include <odp/api/queue.h>
#include <odp_packet_internal.h>
-#include <odp/api/packet_io.h>
#include <odp_packet_io_internal.h>
#include <odp_classification_datamodel.h>
@@ -18,8 +18,8 @@
#include <stdio.h>
#include <stdlib.h>
-#include <odp/api/debug.h>
#include <odp_internal.h>
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -17,9 +17,6 @@
extern "C" {
#endif
-#include <odp/api/init.h>
-#include <odp/api/cpumask.h>
-#include <odp/api/thread.h>
#include <stdio.h>
#include <sys/types.h>
@@ -7,10 +7,6 @@
#ifndef ODP_PACKET_DPDK_H
#define ODP_PACKET_DPDK_H
-#include <odp/api/packet_io.h>
-#include <odp/api/pool.h>
-#include <odp/api/ticketlock.h>
-
#include <net/if.h>
#ifdef ODP_PKTIO_DPDK
@@ -17,14 +17,9 @@
extern "C" {
#endif
-#include <odp/api/align.h>
-#include <odp/api/debug.h>
#include <odp_buffer_internal.h>
#include <odp_pool_internal.h>
#include <odp_buffer_inlines.h>
-#include <odp/api/packet.h>
-#include <odp/api/packet_io.h>
-#include <odp/api/crypto.h>
#include <odp_crypto_internal.h>
/** Minimum segment length expected by packet_parse_common() */
@@ -18,15 +18,12 @@
extern "C" {
#endif
-#include <odp/api/spinlock.h>
-#include <odp/api/ticketlock.h>
#include <odp_classification_datamodel.h>
#include <odp_align_internal.h>
#include <odp_debug_internal.h>
#include <odp_packet_io_ring_internal.h>
#include <odp_config_internal.h>
-#include <odp/api/hints.h>
#include <net/if.h>
#define PKTIO_MAX_QUEUES 64
@@ -4,12 +4,9 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <odp/api/packet_io.h>
#include <odp_packet_io_internal.h>
-#include <odp/api/packet.h>
#include <odp_packet_internal.h>
#include <odp_internal.h>
-#include <odp/api/shared_memory.h>
#include <string.h>
#include <unistd.h>
@@ -96,9 +96,6 @@
extern "C" {
#endif
-#include <odp/api/std_types.h>
-#include <odp/api/hints.h>
-#include <odp/api/atomic.h>
#include <errno.h>
#include <sys/queue.h>
#include <odp_debug_internal.h>
@@ -7,11 +7,6 @@
#ifndef ODP_PACKET_NETMAP_H
#define ODP_PACKET_NETMAP_H
-#include <odp/api/align.h>
-#include <odp/api/debug.h>
-#include <odp/api/packet_io.h>
-#include <odp/api/pool.h>
-#include <odp/api/ticketlock.h>
#include <odp_align_internal.h>
#include <linux/if_ether.h>
@@ -14,13 +14,6 @@
#include <string.h>
#include <stddef.h>
-#include <odp/api/align.h>
-#include <odp/api/buffer.h>
-#include <odp/api/debug.h>
-#include <odp/api/pool.h>
-#include <odp/api/packet.h>
-#include <odp/api/packet_io.h>
-
#include <linux/version.h>
/*
@@ -7,8 +7,6 @@
#ifndef ODP_PACKET_TAP_H_
#define ODP_PACKET_TAP_H_
-#include <odp/api/pool.h>
-
typedef struct {
int fd; /**< file descriptor for tap interface*/
int skfd; /**< socket descriptor */
@@ -18,9 +18,6 @@
extern "C" {
#endif
-#include <odp/api/shared_memory.h>
-#include <odp/api/ticketlock.h>
-
#include <odp_buffer_internal.h>
#include <odp_config_internal.h>
#include <odp_ring_internal.h>
@@ -18,15 +18,10 @@
extern "C" {
#endif
-#include <odp/api/queue.h>
#include <odp_forward_typedefs_internal.h>
#include <odp_schedule_if.h>
#include <odp_buffer_internal.h>
#include <odp_align_internal.h>
-#include <odp/api/packet_io.h>
-#include <odp/api/align.h>
-#include <odp/api/hints.h>
-#include <odp/api/ticketlock.h>
#include <odp_config_internal.h>
#define QUEUE_MULTI_MAX CONFIG_BURST_SIZE
@@ -11,8 +11,6 @@
extern "C" {
#endif
-#include <odp/api/atomic.h>
-#include <odp/api/hints.h>
#include <odp_align_internal.h>
/* Ring empty, not a valid data value. */
@@ -11,9 +11,6 @@
extern "C" {
#endif
-#include <odp/api/queue.h>
-#include <odp/api/schedule.h>
-
typedef void (*schedule_pktio_start_fn_t)(int pktio_index, int num_in_queue,
int in_queue_idx[]);
typedef int (*schedule_thr_add_fn_t)(odp_schedule_group_t group, int thr);
@@ -11,8 +11,6 @@
extern "C" {
#endif
-#include <odp/api/shared_memory.h>
-
#define SHM_DEVNAME_MAXLEN (ODP_SHM_NAME_LEN + 16)
#define SHM_DEVNAME_FORMAT "/odp-%d-%s" /* /dev/shm/odp-<pid>-<name> */
similarity index 90%
rename from platform/linux-generic/include/odp/api/plat/ticketlock_inlines.h
rename to platform/linux-generic/include/odp_ticketlock_internal.h
@@ -1,22 +1,15 @@
-/* Copyright (c) 2016, Linaro Limited
+/* Copyright (c) 2013, Linaro Limited
* All rights reserved.
*
- * SPDX-License-Identifier: BSD-3-Clause
+ * SPDX-License-Identifier: BSD-3-Clause
*/
-/**
- * @file
- *
- * Ticketlock inline functions
- */
+#ifndef ODP_TICKETLOCK_INTERNAL_H_
+#define ODP_TICKETLOCK_INTERNAL_H_
-#ifndef _ODP_PLAT_TICKETLOCK_INLINES_H_
-#define _ODP_PLAT_TICKETLOCK_INLINES_H_
-
-#include <odp/api/ticketlock.h>
-#include <odp/api/atomic.h>
-#include <odp/api/sync.h>
-#include <odp/api/cpu.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
/** @internal
* Acquire ticket lock.
@@ -110,4 +103,8 @@ static inline int _odp_ticketlock_is_locked(odp_ticketlock_t *ticketlock)
odp_atomic_load_u32(&ticketlock->next_ticket);
}
+#ifdef __cplusplus
+}
+#endif
+
#endif
@@ -14,11 +14,8 @@
#ifndef ODP_TIMER_INTERNAL_H_
#define ODP_TIMER_INTERNAL_H_
-#include <odp/api/align.h>
-#include <odp/api/debug.h>
#include <odp_buffer_internal.h>
#include <odp_pool_internal.h>
-#include <odp/api/timer.h>
/**
* Internal Timeout header
@@ -20,8 +20,6 @@ extern "C" {
#endif
#include <pthread.h>
-#include <odp/api/traffic_mngr.h>
-#include <odp/api/packet_io.h>
#include <odp_name_table_internal.h>
#include <odp_timer_wheel_internal.h>
#include <odp_pkt_queue_internal.h>
new file mode 100644
@@ -0,0 +1,26 @@
+/* Copyright (c) 2013, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+#ifndef ODP_VERSION_INTERNAL_H_
+#define ODP_VERSION_INTERNAL_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define ODP_VERSION_STR_EXPAND(x) #x
+#define ODP_VERSION_TO_STR(x) ODP_VERSION_STR_EXPAND(x)
+
+#define ODP_VERSION_API_STR \
+ ODP_VERSION_TO_STR(ODP_VERSION_API_GENERATION) "." \
+ ODP_VERSION_TO_STR(ODP_VERSION_API_MAJOR) "." \
+ ODP_VERSION_TO_STR(ODP_VERSION_API_MINOR)
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
@@ -36,5 +36,4 @@ m4_include([platform/linux-generic/m4/odp_dpdk.m4])
m4_include([platform/linux-generic/m4/odp_ipc.m4])
m4_include([platform/linux-generic/m4/odp_schedule.m4])
-AC_CONFIG_FILES([platform/linux-generic/Makefile
- platform/linux-generic/include/odp/api/plat/static_inline.h])
+AC_CONFIG_FILES([platform/linux-generic/Makefile])
@@ -4,10 +4,7 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <odp/api/atomic.h>
-#if ODP_ABI_COMPAT == 1
-#include <odp/api/plat/atomic_inlines.h>
-#endif
+#include <odp_api.h>
int odp_atomic_lock_free_u64(odp_atomic_op_t *atomic_op)
{
@@ -4,10 +4,7 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <odp/api/barrier.h>
-#include <odp/api/sync.h>
-#include <odp/api/cpu.h>
-#include <odp/api/atomic.h>
+#include <odp_api.h>
void odp_barrier_init(odp_barrier_t *barrier, int count)
{
@@ -4,7 +4,8 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <odp/api/buffer.h>
+#include <odp_api.h>
+
#include <odp_pool_internal.h>
#include <odp_buffer_internal.h>
#include <odp_buffer_inlines.h>
deleted file mode 100644
@@ -1,10 +0,0 @@
-/* Copyright (c) 2016, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-#include <odp/api/byteorder.h>
-#if ODP_ABI_COMPAT == 1
-#include <odp/api/plat/byteorder_inlines.h>
-#endif
@@ -4,25 +4,20 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <odp/api/classification.h>
-#include <odp/api/align.h>
-#include <odp/api/queue.h>
-#include <odp/api/debug.h>
+#include <odp_api.h>
+
#include <odp_internal.h>
#include <odp_debug_internal.h>
#include <odp_packet_internal.h>
-#include <odp/api/packet_io.h>
#include <odp_packet_io_internal.h>
#include <odp_classification_datamodel.h>
#include <odp_classification_inlines.h>
#include <odp_classification_internal.h>
-#include <odp/api/shared_memory.h>
#include <protocols/eth.h>
#include <protocols/ip.h>
#include <string.h>
#include <errno.h>
#include <stdbool.h>
-#include <odp/api/spinlock.h>
#define LOCK(a) odp_spinlock_lock(a)
#define UNLOCK(a) odp_spinlock_unlock(a)
@@ -4,8 +4,7 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <odp/api/cpu.h>
-#include <odp/api/hints.h>
+#include <odp_api.h>
uint64_t odp_cpu_cycles_diff(uint64_t c2, uint64_t c1)
{
@@ -4,13 +4,13 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
+#include <odp_api.h>
+
#include <odp_posix_extensions.h>
#include <sched.h>
#include <pthread.h>
-#include <odp/api/cpumask.h>
-#include <odp/api/init.h>
#include <odp_debug_internal.h>
#include <stdlib.h>
@@ -4,12 +4,13 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
+#include <odp_api.h>
+
#include <odp_posix_extensions.h>
#include <sched.h>
#include <pthread.h>
-#include <odp/api/cpumask.h>
#include <odp_debug_internal.h>
int odp_cpumask_default_worker(odp_cpumask_t *mask, int num)
@@ -4,19 +4,12 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
+#include <odp_api.h>
+
#include <odp_posix_extensions.h>
-#include <odp/api/crypto.h>
#include <odp_internal.h>
-#include <odp/api/atomic.h>
-#include <odp/api/spinlock.h>
-#include <odp/api/sync.h>
-#include <odp/api/debug.h>
-#include <odp/api/align.h>
-#include <odp/api/shared_memory.h>
#include <odp_crypto_internal.h>
#include <odp_debug_internal.h>
-#include <odp/api/hints.h>
-#include <odp/api/random.h>
#include <odp_packet_internal.h>
#include <string.h>
@@ -4,7 +4,8 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <odp/api/errno.h>
+#include <odp_api.h>
+
#include <odp_internal.h>
#include <string.h>
#include <stdio.h>
@@ -4,12 +4,8 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <odp/api/event.h>
-#include <odp/api/buffer.h>
-#include <odp/api/crypto.h>
-#include <odp/api/packet.h>
-#include <odp/api/timer.h>
-#include <odp/api/pool.h>
+#include <odp_api.h>
+
#include <odp_buffer_internal.h>
#include <odp_buffer_inlines.h>
#include <odp_debug_internal.h>
@@ -37,8 +37,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <odp/api/hash.h>
-#include <odp/api/std_types.h>
+#include <odp_api.h>
#include <stddef.h>
@@ -18,7 +18,8 @@
extern "C" {
#endif
-#include <odp/api/version.h>
+#include <odp_api.h>
+#include <odp_version_internal.h>
#define ODP_VERSION_IMPL 0
#define ODP_VERSION_IMPL_STR \
@@ -3,9 +3,10 @@
*
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <odp/api/init.h>
+
+#include <odp_api.h>
+
#include <odp_debug_internal.h>
-#include <odp/api/debug.h>
#include <unistd.h>
#include <odp_internal.h>
#include <odp_schedule_if.h>
@@ -6,6 +6,8 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
+#include <odp_api.h>
+
#include <stdint.h>
#include <string.h>
#include <malloc.h>
@@ -4,11 +4,10 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <odp/api/packet.h>
+#include <odp_api.h>
+
#include <odp_packet_internal.h>
#include <odp_debug_internal.h>
-#include <odp/api/hints.h>
-#include <odp/api/byteorder.h>
#include <protocols/eth.h>
#include <protocols/ip.h>
@@ -4,7 +4,8 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <odp/api/packet_flags.h>
+#include <odp_api.h>
+
#include <odp_packet_internal.h>
#define retflag(pkt, x, layer) do { \
@@ -3,17 +3,15 @@
*
* SPDX-License-Identifier: BSD-3-Clause
*/
+
+#include <odp_api.h>
+
#include <odp_posix_extensions.h>
-#include <odp/api/packet_io.h>
#include <odp_packet_io_internal.h>
#include <odp_packet_io_queue.h>
-#include <odp/api/packet.h>
#include <odp_packet_internal.h>
#include <odp_internal.h>
-#include <odp/api/spinlock.h>
-#include <odp/api/ticketlock.h>
-#include <odp/api/shared_memory.h>
#include <odp_packet_socket.h>
#include <odp_config_internal.h>
#include <odp_queue_internal.h>
@@ -21,7 +19,6 @@
#include <odp_classification_internal.h>
#include <odp_debug_internal.h>
#include <odp_packet_io_ipc_internal.h>
-#include <odp/api/time.h>
#include <string.h>
#include <inttypes.h>
@@ -4,10 +4,7 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <odp/api/pool.h>
-#include <odp/api/shared_memory.h>
-#include <odp/api/align.h>
-#include <odp/api/ticketlock.h>
+#include <odp_api.h>
#include <odp_pool_internal.h>
#include <odp_internal.h>
@@ -16,12 +13,12 @@
#include <odp_config_internal.h>
#include <odp_debug_internal.h>
#include <odp_ring_internal.h>
+#include <odp_ticketlock_internal.h>
#include <string.h>
#include <stdio.h>
#include <inttypes.h>
-#include <odp/api/plat/ticketlock_inlines.h>
#define LOCK(a) _odp_ticketlock_lock(a)
#define UNLOCK(a) _odp_ticketlock_unlock(a)
#define LOCK_INIT(a) odp_ticketlock_init(a)
@@ -4,29 +4,22 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <odp/api/queue.h>
+#include <odp_api.h>
+
#include <odp_queue_internal.h>
-#include <odp/api/std_types.h>
-#include <odp/api/align.h>
-#include <odp/api/buffer.h>
#include <odp_buffer_internal.h>
#include <odp_pool_internal.h>
#include <odp_buffer_inlines.h>
#include <odp_internal.h>
-#include <odp/api/shared_memory.h>
-#include <odp/api/schedule.h>
#include <odp_schedule_if.h>
#include <odp_config_internal.h>
#include <odp_packet_io_internal.h>
#include <odp_packet_io_queue.h>
#include <odp_debug_internal.h>
-#include <odp/api/hints.h>
-#include <odp/api/sync.h>
-#include <odp/api/traffic_mngr.h>
+#include <odp_ticketlock_internal.h>
#define NUM_INTERNAL_QUEUES 64
-#include <odp/api/plat/ticketlock_inlines.h>
#define LOCK(a) _odp_ticketlock_lock(a)
#define UNLOCK(a) _odp_ticketlock_unlock(a)
#define LOCK_INIT(a) odp_ticketlock_init(a)
@@ -4,10 +4,9 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
+#include <odp_api.h>
+
#include <stdbool.h>
-#include <odp/api/atomic.h>
-#include <odp/api/rwlock.h>
-#include <odp/api/cpu.h>
void odp_rwlock_init(odp_rwlock_t *rwlock)
{
@@ -4,8 +4,8 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <odp/api/rwlock_recursive.h>
-#include <odp/api/thread.h>
+#include <odp_api.h>
+
#include <string.h>
#define NO_OWNER (-1)
@@ -4,22 +4,14 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
+#include <odp_api.h>
+
#include <string.h>
-#include <odp/api/schedule.h>
#include <odp_schedule_if.h>
-#include <odp/api/align.h>
-#include <odp/api/shared_memory.h>
#include <odp_internal.h>
#include <odp_debug_internal.h>
-#include <odp/api/thread.h>
-#include <odp/api/time.h>
-#include <odp/api/spinlock.h>
-#include <odp/api/hints.h>
-#include <odp/api/cpu.h>
-#include <odp/api/thrmask.h>
#include <odp_config_internal.h>
#include <odp_align_internal.h>
-#include <odp/api/sync.h>
#include <odp_ring_internal.h>
#include <odp_queue_internal.h>
@@ -4,6 +4,8 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
+#include <odp_api.h>
+
#include <odp_schedule_if.h>
extern const schedule_fn_t schedule_sp_fn;
@@ -4,11 +4,9 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
+#include <odp_api.h>
+
#include <string.h>
-#include <odp/api/ticketlock.h>
-#include <odp/api/thread.h>
-#include <odp/api/time.h>
-#include <odp/api/schedule.h>
#include <odp_schedule_if.h>
#include <odp_debug_internal.h>
#include <odp_align_internal.h>
@@ -4,10 +4,9 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
+#include <odp_api.h>
+
#include <odp_config_internal.h>
-#include <odp/api/debug.h>
-#include <odp/api/std_types.h>
-#include <odp/api/shared_memory.h>
#include <_ishm_internal.h>
#include <string.h>
@@ -6,6 +6,8 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
+#include <odp_api.h>
+
#include <stdint.h>
#include <string.h>
#include <malloc.h>
@@ -4,8 +4,8 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <odp/api/spinlock.h>
-#include <odp/api/cpu.h>
+#include <odp_api.h>
+
#include <odp_atomic_internal.h>
void odp_spinlock_init(odp_spinlock_t *spinlock)
@@ -4,8 +4,7 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <odp/api/spinlock_recursive.h>
-#include <odp/api/thread.h>
+#include <odp_api.h>
#define NO_OWNER (-1)
deleted file mode 100644
@@ -1,10 +0,0 @@
-/* Copyright (c) 2016, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-#include <odp/api/std_clib.h>
-#if ODP_ABI_COMPAT == 1
-#include <odp/api/plat/std_clib_inlines.h>
-#endif
deleted file mode 100644
@@ -1,10 +0,0 @@
-/* Copyright (c) 2016, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-#include <odp/api/sync.h>
-#if ODP_ABI_COMPAT == 1
-#include <odp/api/plat/sync_inlines.h>
-#endif
@@ -11,13 +11,12 @@
* All rights reserved.
*/
+#include <odp_api.h>
+
#include <odp_posix_extensions.h>
-#include <odp/api/system_info.h>
#include <odp_internal.h>
#include <odp_debug_internal.h>
-#include <odp/api/align.h>
-#include <odp/api/cpu.h>
#include <errno.h>
#include <pthread.h>
#include <sched.h>
@@ -4,18 +4,14 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
+#include <odp_api.h>
+
#include <odp_posix_extensions.h>
#include <sched.h>
-#include <odp/api/thread.h>
-#include <odp/api/thrmask.h>
#include <odp_internal.h>
-#include <odp/api/spinlock.h>
#include <odp_config_internal.h>
#include <odp_debug_internal.h>
-#include <odp/api/shared_memory.h>
-#include <odp/api/align.h>
-#include <odp/api/cpu.h>
#include <odp_schedule_if.h>
#include <string.h>
@@ -4,8 +4,7 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <odp/api/thrmask.h>
-#include <odp/api/cpumask.h>
+#include <odp_api.h>
void odp_thrmask_from_str(odp_thrmask_t *mask, const char *str)
{
@@ -4,7 +4,9 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <odp/api/plat/ticketlock_inlines.h>
+#include <odp_api.h>
+
+#include <odp_ticketlock_internal.h>
void odp_ticketlock_init(odp_ticketlock_t *ticketlock)
{
@@ -4,11 +4,11 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
+#include <odp_api.h>
+
#include <odp_posix_extensions.h>
#include <time.h>
-#include <odp/api/time.h>
-#include <odp/api/hints.h>
#include <odp_debug_internal.h>
static odp_time_t start_time;
@@ -19,6 +19,8 @@
#define TB_SET_PAD(x) (void)(x)
#endif
+#include <odp_api.h>
+
#include <odp_posix_extensions.h>
#include <errno.h>
@@ -31,27 +33,12 @@
#include <inttypes.h>
#include <string.h>
-#include <odp/api/align.h>
#include <odp_align_internal.h>
-#include <odp/api/atomic.h>
#include <odp_atomic_internal.h>
-#include <odp/api/buffer.h>
#include <odp_buffer_inlines.h>
-#include <odp/api/cpu.h>
-#include <odp/api/pool.h>
#include <odp_pool_internal.h>
-#include <odp/api/debug.h>
#include <odp_debug_internal.h>
-#include <odp/api/event.h>
-#include <odp/api/hints.h>
#include <odp_internal.h>
-#include <odp/api/queue.h>
-#include <odp/api/shared_memory.h>
-#include <odp/api/spinlock.h>
-#include <odp/api/std_types.h>
-#include <odp/api/sync.h>
-#include <odp/api/time.h>
-#include <odp/api/timer.h>
#include <odp_timer_internal.h>
#define TMO_UNUSED ((uint64_t)0xFFFFFFFFFFFFFFFF)
@@ -6,6 +6,8 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
+#include <odp_api.h>
+
#include <stdint.h>
#include <string.h>
#include <malloc.h>
@@ -6,6 +6,8 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
+#include <odp_api.h>
+
#define _GNU_SOURCE
#include <stdint.h>
#include <string.h>
@@ -18,7 +20,6 @@
#include <sched.h>
#include <unistd.h>
#include <pthread.h>
-#include <odp/api/std_types.h>
#include <protocols/eth.h>
#include <protocols/ip.h>
#include <odp_traffic_mngr_internal.h>
@@ -4,7 +4,9 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#include <odp/api/version.h>
+#include <odp_api.h>
+
+#include <odp_version_internal.h>
const char *odp_version_api_str(void)
{
@@ -4,10 +4,10 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
+#include <odp_api.h>
+
#include <odp_internal.h>
-#include <odp/api/debug.h>
#include <odp_debug_internal.h>
-#include <odp/api/hints.h>
#include <stdarg.h>
@@ -12,8 +12,6 @@
#include <ctype.h>
#include <unistd.h>
-#include <odp/api/cpumask.h>
-
#include <odp_packet_io_internal.h>
#include <odp_classification_internal.h>
#include <odp_packet_dpdk.h>
@@ -4,6 +4,8 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
+#include <odp_api.h>
+
#include <odp_packet_io_internal.h>
/* Ops for all implementation of pktio.
@@ -3,10 +3,12 @@
*
* SPDX-License-Identifier: BSD-3-Clause
*/
+
+#include <odp_api.h>
+
#include <odp_packet_io_ipc_internal.h>
#include <odp_debug_internal.h>
#include <odp_packet_io_internal.h>
-#include <odp/api/system_info.h>
#include <odp_shm_internal.h>
#include <_ishm_internal.h>
@@ -10,7 +10,6 @@
#include <odp_packet_io_internal.h>
#include <odp_classification_internal.h>
#include <odp_debug_internal.h>
-#include <odp/api/hints.h>
#include <protocols/eth.h>
#include <protocols/ip.h>
@@ -5,6 +5,8 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
+#include <odp_api.h>
+
#include <odp_packet_io_internal.h>
#include <odp_classification_internal.h>
#include <errno.h>
@@ -41,7 +41,6 @@
#include <odp_classification_datamodel.h>
#include <odp_classification_inlines.h>
#include <odp_classification_internal.h>
-#include <odp/api/hints.h>
#include <protocols/eth.h>
#include <protocols/ip.h>
@@ -5,6 +5,8 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
+#include <odp_api.h>
+
#include <odp_posix_extensions.h>
#include <odp_packet_io_internal.h>
@@ -30,7 +32,6 @@
#include <odp_classification_datamodel.h>
#include <odp_classification_inlines.h>
#include <odp_classification_internal.h>
-#include <odp/api/hints.h>
#include <protocols/eth.h>
#include <protocols/ip.h>
@@ -6,7 +6,6 @@
#include <ctype.h>
#include <odp_api.h>
-#include <odp/api/cpumask.h>
#include "odp_cunit_common.h"
#include "test_debug.h"
#include "system.h"
Not all of the C code for the ODP API specification is found in the .h header files. Some of it is found in the ODP implementation's repo. There is no real reason for this, and it allows a particular ODP implementation to define whatever C code for the types of the API that is specified. This also means that the implementation defines the ABI. Which means it completely kills portability. Universal API header files yields 1 set of .h header files that contains _all_ of the C code for the entire specification. Applications only need these header files for compilation. The same for implementations. These header files can be cared for and gardened independently. There is debate on whether variable types should be opaque pointers or other scalar types, and the API function declarations too. In addition to providing a universal set of API header files found in /include/odp/ and /include/odp/api/spec/ this patch removes 2600 lines of code and 76 files. Signed-off-by: Brian Brooks <brian.brooks@linaro.org> --- doc/implementers-guide/implementers-guide.adoc | 6 - example/time/time_global_test.c | 1 + example/traffic_mgmt/odp_traffic_mgmt.c | 1 + helper/test/odpthreads.c | 1 + helper/test/table.c | 2 + helper/threads.c | 2 + include/odp/api/spec/atomic.h | 501 +++++++++++++++++---- include/odp/api/spec/buffer.h | 5 +- include/odp/api/spec/byteorder.h | 138 +++++- include/odp/api/spec/classification.h | 10 +- include/odp/api/spec/cpu.h | 21 +- include/odp/api/spec/crypto.h | 10 +- include/odp/api/spec/debug.h | 21 + include/odp/api/spec/event.h | 14 +- include/odp/api/spec/hash.h | 2 - include/odp/api/spec/init.h | 5 - include/odp/api/spec/packet.h | 19 +- include/odp/api/spec/packet_flags.h | 3 - include/odp/api/spec/packet_io.h | 20 +- include/odp/api/spec/packet_io_stats.h | 84 ---- include/odp/api/spec/pool.h | 2 - include/odp/api/spec/queue.h | 15 +- include/odp/api/spec/schedule.h | 11 +- include/odp/api/spec/schedule_types.h | 44 +- include/odp/api/spec/shared_memory.h | 6 +- include/odp/api/spec/std_clib.h | 17 +- include/odp/api/spec/std_types.h | 1 + include/odp/api/spec/sync.h | 15 +- include/odp/api/spec/thrmask.h | 2 - include/odp/api/spec/time.h | 1 + include/odp/api/spec/traffic_mngr.h | 18 +- include/odp_api.h | 321 +++++++++++-- platform/linux-generic/Makefile.am | 82 +--- platform/linux-generic/_fdserver.c | 4 +- platform/linux-generic/_ishm.c | 7 +- platform/linux-generic/_ishmphy.c | 5 +- platform/linux-generic/arch/arm/odp/api/cpu_arch.h | 6 - platform/linux-generic/arch/arm/odp_cpu_arch.c | 3 - .../linux-generic/arch/default/odp/api/cpu_arch.h | 6 - platform/linux-generic/arch/default/odp_cpu_arch.c | 5 +- .../linux-generic/arch/default/odp_sysinfo_parse.c | 2 + .../linux-generic/arch/mips64/odp/api/cpu_arch.h | 6 - platform/linux-generic/arch/mips64/odp_cpu_arch.c | 4 +- .../linux-generic/arch/mips64/odp_sysinfo_parse.c | 2 + .../linux-generic/arch/powerpc/odp/api/cpu_arch.h | 6 - platform/linux-generic/arch/powerpc/odp_cpu_arch.c | 5 +- .../linux-generic/arch/powerpc/odp_sysinfo_parse.c | 2 + platform/linux-generic/arch/x86/odp/api/cpu_arch.h | 11 - platform/linux-generic/arch/x86/odp_cpu_arch.c | 3 +- .../linux-generic/arch/x86/odp_sysinfo_parse.c | 2 + platform/linux-generic/include/odp/api/align.h | 58 --- platform/linux-generic/include/odp/api/atomic.h | 42 -- platform/linux-generic/include/odp/api/barrier.h | 31 -- platform/linux-generic/include/odp/api/buffer.h | 39 -- platform/linux-generic/include/odp/api/byteorder.h | 43 -- .../linux-generic/include/odp/api/classification.h | 41 -- platform/linux-generic/include/odp/api/compiler.h | 34 -- platform/linux-generic/include/odp/api/cpu.h | 28 -- platform/linux-generic/include/odp/api/cpumask.h | 28 -- platform/linux-generic/include/odp/api/crypto.h | 41 -- platform/linux-generic/include/odp/api/debug.h | 48 -- platform/linux-generic/include/odp/api/errno.h | 27 -- platform/linux-generic/include/odp/api/event.h | 36 -- platform/linux-generic/include/odp/api/hash.h | 34 -- platform/linux-generic/include/odp/api/hints.h | 34 -- platform/linux-generic/include/odp/api/init.h | 36 -- platform/linux-generic/include/odp/api/packet.h | 41 -- .../linux-generic/include/odp/api/packet_flags.h | 34 -- platform/linux-generic/include/odp/api/packet_io.h | 41 -- .../include/odp/api/packet_io_stats.h | 26 -- .../include/odp/api/plat/atomic_inlines.h | 385 ---------------- .../include/odp/api/plat/atomic_types.h | 88 ---- .../include/odp/api/plat/barrier_types.h | 38 -- .../include/odp/api/plat/buffer_types.h | 45 -- .../include/odp/api/plat/byteorder_inlines.h | 140 ------ .../include/odp/api/plat/byteorder_types.h | 87 ---- .../include/odp/api/plat/classification_types.h | 57 --- .../include/odp/api/plat/cpumask_types.h | 54 --- .../include/odp/api/plat/crypto_types.h | 50 -- .../include/odp/api/plat/event_types.h | 57 --- .../include/odp/api/plat/init_types.h | 35 -- .../include/odp/api/plat/packet_io_types.h | 64 --- .../include/odp/api/plat/packet_types.h | 72 --- .../include/odp/api/plat/pool_types.h | 52 --- .../include/odp/api/plat/queue_types.h | 57 --- .../include/odp/api/plat/rwlock_recursive_types.h | 38 -- .../include/odp/api/plat/rwlock_types.h | 37 -- .../include/odp/api/plat/schedule_types.h | 62 --- .../include/odp/api/plat/shared_memory_types.h | 50 -- .../odp/api/plat/spinlock_recursive_types.h | 36 -- .../include/odp/api/plat/spinlock_types.h | 34 -- .../include/odp/api/plat/static_inline.h.in | 43 -- .../include/odp/api/plat/std_clib_inlines.h | 36 -- .../include/odp/api/plat/strong_types.h | 36 -- .../include/odp/api/plat/sync_inlines.h | 47 -- .../include/odp/api/plat/thread_types.h | 34 -- .../include/odp/api/plat/thrmask_types.h | 48 -- .../include/odp/api/plat/ticketlock_types.h | 35 -- .../include/odp/api/plat/time_types.h | 43 -- .../include/odp/api/plat/timer_types.h | 51 --- .../include/odp/api/plat/traffic_mngr_types.h | 185 -------- .../include/odp/api/plat/version_types.h | 30 -- platform/linux-generic/include/odp/api/pool.h | 37 -- platform/linux-generic/include/odp/api/queue.h | 40 -- platform/linux-generic/include/odp/api/random.h | 34 -- platform/linux-generic/include/odp/api/rwlock.h | 28 -- .../include/odp/api/rwlock_recursive.h | 28 -- platform/linux-generic/include/odp/api/schedule.h | 36 -- .../linux-generic/include/odp/api/schedule_types.h | 28 -- .../linux-generic/include/odp/api/shared_memory.h | 36 -- platform/linux-generic/include/odp/api/spinlock.h | 28 -- .../include/odp/api/spinlock_recursive.h | 28 -- platform/linux-generic/include/odp/api/std_clib.h | 28 -- platform/linux-generic/include/odp/api/std_types.h | 42 -- platform/linux-generic/include/odp/api/sync.h | 39 -- .../linux-generic/include/odp/api/system_info.h | 29 -- platform/linux-generic/include/odp/api/thread.h | 28 -- platform/linux-generic/include/odp/api/thrmask.h | 36 -- .../linux-generic/include/odp/api/ticketlock.h | 28 -- platform/linux-generic/include/odp/api/time.h | 31 -- platform/linux-generic/include/odp/api/timer.h | 40 -- .../linux-generic/include/odp/api/traffic_mngr.h | 35 -- platform/linux-generic/include/odp/api/version.h | 27 -- .../linux-generic/include/odp_align_internal.h | 1 - .../linux-generic/include/odp_atomic_internal.h | 4 - .../linux-generic/include/odp_buffer_internal.h | 9 - .../include/odp_classification_datamodel.h | 2 - .../include/odp_classification_inlines.h | 1 - .../include/odp_classification_internal.h | 3 - .../linux-generic/include/odp_debug_internal.h | 2 +- platform/linux-generic/include/odp_internal.h | 3 - platform/linux-generic/include/odp_packet_dpdk.h | 4 - .../linux-generic/include/odp_packet_internal.h | 5 - .../linux-generic/include/odp_packet_io_internal.h | 3 - .../include/odp_packet_io_ipc_internal.h | 3 - .../include/odp_packet_io_ring_internal.h | 3 - platform/linux-generic/include/odp_packet_netmap.h | 5 - platform/linux-generic/include/odp_packet_socket.h | 7 - platform/linux-generic/include/odp_packet_tap.h | 2 - platform/linux-generic/include/odp_pool_internal.h | 3 - .../linux-generic/include/odp_queue_internal.h | 5 - platform/linux-generic/include/odp_ring_internal.h | 2 - platform/linux-generic/include/odp_schedule_if.h | 3 - platform/linux-generic/include/odp_shm_internal.h | 2 - ...ketlock_inlines.h => odp_ticketlock_internal.h} | 25 +- .../linux-generic/include/odp_timer_internal.h | 3 - .../include/odp_traffic_mngr_internal.h | 2 - .../linux-generic/include/odp_version_internal.h | 26 ++ platform/linux-generic/m4/configure.m4 | 3 +- platform/linux-generic/odp_atomic.c | 5 +- platform/linux-generic/odp_barrier.c | 5 +- platform/linux-generic/odp_buffer.c | 3 +- platform/linux-generic/odp_byteorder.c | 10 - platform/linux-generic/odp_classification.c | 9 +- platform/linux-generic/odp_cpu.c | 3 +- platform/linux-generic/odp_cpumask.c | 4 +- platform/linux-generic/odp_cpumask_task.c | 3 +- platform/linux-generic/odp_crypto.c | 11 +- platform/linux-generic/odp_errno.c | 3 +- platform/linux-generic/odp_event.c | 8 +- platform/linux-generic/odp_hash.c | 3 +- platform/linux-generic/odp_impl.c | 3 +- platform/linux-generic/odp_init.c | 5 +- platform/linux-generic/odp_name_table.c | 2 + platform/linux-generic/odp_packet.c | 5 +- platform/linux-generic/odp_packet_flags.c | 3 +- platform/linux-generic/odp_packet_io.c | 9 +- platform/linux-generic/odp_pool.c | 7 +- platform/linux-generic/odp_queue.c | 13 +- platform/linux-generic/odp_rwlock.c | 5 +- platform/linux-generic/odp_rwlock_recursive.c | 4 +- platform/linux-generic/odp_schedule.c | 12 +- platform/linux-generic/odp_schedule_if.c | 2 + platform/linux-generic/odp_schedule_sp.c | 6 +- platform/linux-generic/odp_shared_memory.c | 5 +- platform/linux-generic/odp_sorted_list.c | 2 + platform/linux-generic/odp_spinlock.c | 4 +- platform/linux-generic/odp_spinlock_recursive.c | 3 +- platform/linux-generic/odp_std_clib.c | 10 - platform/linux-generic/odp_sync.c | 10 - platform/linux-generic/odp_system_info.c | 5 +- platform/linux-generic/odp_thread.c | 8 +- platform/linux-generic/odp_thrmask.c | 3 +- platform/linux-generic/odp_ticketlock.c | 4 +- platform/linux-generic/odp_time.c | 4 +- platform/linux-generic/odp_timer.c | 17 +- platform/linux-generic/odp_timer_wheel.c | 2 + platform/linux-generic/odp_traffic_mngr.c | 3 +- platform/linux-generic/odp_version.c | 4 +- platform/linux-generic/odp_weak.c | 4 +- platform/linux-generic/pktio/dpdk.c | 2 - platform/linux-generic/pktio/io_ops.c | 2 + platform/linux-generic/pktio/ipc.c | 4 +- platform/linux-generic/pktio/loop.c | 1 - platform/linux-generic/pktio/pktio_common.c | 2 + platform/linux-generic/pktio/socket.c | 1 - platform/linux-generic/pktio/socket_mmap.c | 3 +- test/common_plat/validation/api/system/system.c | 1 - 198 files changed, 1139 insertions(+), 4273 deletions(-) delete mode 100644 platform/linux-generic/include/odp/api/align.h delete mode 100644 platform/linux-generic/include/odp/api/atomic.h delete mode 100644 platform/linux-generic/include/odp/api/barrier.h delete mode 100644 platform/linux-generic/include/odp/api/buffer.h delete mode 100644 platform/linux-generic/include/odp/api/byteorder.h delete mode 100644 platform/linux-generic/include/odp/api/classification.h delete mode 100644 platform/linux-generic/include/odp/api/compiler.h delete mode 100644 platform/linux-generic/include/odp/api/cpu.h delete mode 100644 platform/linux-generic/include/odp/api/cpumask.h delete mode 100644 platform/linux-generic/include/odp/api/crypto.h delete mode 100644 platform/linux-generic/include/odp/api/debug.h delete mode 100644 platform/linux-generic/include/odp/api/errno.h delete mode 100644 platform/linux-generic/include/odp/api/event.h delete mode 100644 platform/linux-generic/include/odp/api/hash.h delete mode 100644 platform/linux-generic/include/odp/api/hints.h delete mode 100644 platform/linux-generic/include/odp/api/init.h delete mode 100644 platform/linux-generic/include/odp/api/packet.h delete mode 100644 platform/linux-generic/include/odp/api/packet_flags.h delete mode 100644 platform/linux-generic/include/odp/api/packet_io.h delete mode 100644 platform/linux-generic/include/odp/api/packet_io_stats.h delete mode 100644 platform/linux-generic/include/odp/api/plat/atomic_inlines.h delete mode 100644 platform/linux-generic/include/odp/api/plat/atomic_types.h delete mode 100644 platform/linux-generic/include/odp/api/plat/barrier_types.h delete mode 100644 platform/linux-generic/include/odp/api/plat/buffer_types.h delete mode 100644 platform/linux-generic/include/odp/api/plat/byteorder_inlines.h delete mode 100644 platform/linux-generic/include/odp/api/plat/byteorder_types.h delete mode 100644 platform/linux-generic/include/odp/api/plat/classification_types.h delete mode 100644 platform/linux-generic/include/odp/api/plat/cpumask_types.h delete mode 100644 platform/linux-generic/include/odp/api/plat/crypto_types.h delete mode 100644 platform/linux-generic/include/odp/api/plat/event_types.h delete mode 100644 platform/linux-generic/include/odp/api/plat/init_types.h delete mode 100644 platform/linux-generic/include/odp/api/plat/packet_io_types.h delete mode 100644 platform/linux-generic/include/odp/api/plat/packet_types.h delete mode 100644 platform/linux-generic/include/odp/api/plat/pool_types.h delete mode 100644 platform/linux-generic/include/odp/api/plat/queue_types.h delete mode 100644 platform/linux-generic/include/odp/api/plat/rwlock_recursive_types.h delete mode 100644 platform/linux-generic/include/odp/api/plat/rwlock_types.h delete mode 100644 platform/linux-generic/include/odp/api/plat/schedule_types.h delete mode 100644 platform/linux-generic/include/odp/api/plat/shared_memory_types.h delete mode 100644 platform/linux-generic/include/odp/api/plat/spinlock_recursive_types.h delete mode 100644 platform/linux-generic/include/odp/api/plat/spinlock_types.h delete mode 100644 platform/linux-generic/include/odp/api/plat/static_inline.h.in delete mode 100644 platform/linux-generic/include/odp/api/plat/std_clib_inlines.h delete mode 100644 platform/linux-generic/include/odp/api/plat/strong_types.h delete mode 100644 platform/linux-generic/include/odp/api/plat/sync_inlines.h delete mode 100644 platform/linux-generic/include/odp/api/plat/thread_types.h delete mode 100644 platform/linux-generic/include/odp/api/plat/thrmask_types.h delete mode 100644 platform/linux-generic/include/odp/api/plat/ticketlock_types.h delete mode 100644 platform/linux-generic/include/odp/api/plat/time_types.h delete mode 100644 platform/linux-generic/include/odp/api/plat/timer_types.h delete mode 100644 platform/linux-generic/include/odp/api/plat/traffic_mngr_types.h delete mode 100644 platform/linux-generic/include/odp/api/plat/version_types.h delete mode 100644 platform/linux-generic/include/odp/api/pool.h delete mode 100644 platform/linux-generic/include/odp/api/queue.h delete mode 100644 platform/linux-generic/include/odp/api/random.h delete mode 100644 platform/linux-generic/include/odp/api/rwlock.h delete mode 100644 platform/linux-generic/include/odp/api/rwlock_recursive.h delete mode 100644 platform/linux-generic/include/odp/api/schedule.h delete mode 100644 platform/linux-generic/include/odp/api/schedule_types.h delete mode 100644 platform/linux-generic/include/odp/api/shared_memory.h delete mode 100644 platform/linux-generic/include/odp/api/spinlock.h delete mode 100644 platform/linux-generic/include/odp/api/spinlock_recursive.h delete mode 100644 platform/linux-generic/include/odp/api/std_clib.h delete mode 100644 platform/linux-generic/include/odp/api/std_types.h delete mode 100644 platform/linux-generic/include/odp/api/sync.h delete mode 100644 platform/linux-generic/include/odp/api/system_info.h delete mode 100644 platform/linux-generic/include/odp/api/thread.h delete mode 100644 platform/linux-generic/include/odp/api/thrmask.h delete mode 100644 platform/linux-generic/include/odp/api/ticketlock.h delete mode 100644 platform/linux-generic/include/odp/api/time.h delete mode 100644 platform/linux-generic/include/odp/api/timer.h delete mode 100644 platform/linux-generic/include/odp/api/traffic_mngr.h delete mode 100644 platform/linux-generic/include/odp/api/version.h rename platform/linux-generic/include/{odp/api/plat/ticketlock_inlines.h => odp_ticketlock_internal.h} (90%) create mode 100644 platform/linux-generic/include/odp_version_internal.h delete mode 100644 platform/linux-generic/odp_byteorder.c delete mode 100644 platform/linux-generic/odp_std_clib.c delete mode 100644 platform/linux-generic/odp_sync.c -- 2.11.0