From 896ad66d38abba4508d82776c91e41137c075067 Mon Sep 17 00:00:00 2001 From: Anders Roxell Date: Wed, 7 Jan 2015 20:47:11 +0100 Subject: api: plat: move platform type headers into plat directory Makes it easier to see what's platform specific types Signed-off-by: Anders Roxell Reviewed-by: Balasubramanian Manoharan Reviewed-by: Taras Kondratiuk Signed-off-by: Maxim Uvarov --- include/odp/api/pool.h | 2 +- platform/linux-generic/Makefile.am | 21 ++--- platform/linux-generic/include/odp/atomic.h | 2 +- platform/linux-generic/include/odp/atomic_types.h | 81 ------------------- platform/linux-generic/include/odp/barrier.h | 2 +- platform/linux-generic/include/odp/buffer.h | 4 +- platform/linux-generic/include/odp/buffer_types.h | 45 ----------- platform/linux-generic/include/odp/byteorder.h | 2 +- .../linux-generic/include/odp/byteorder_types.h | 90 ---------------------- .../linux-generic/include/odp/classification.h | 8 +- .../include/odp/classification_types.h | 42 ---------- platform/linux-generic/include/odp/cpumask.h | 2 +- platform/linux-generic/include/odp/cpumask_types.h | 44 ----------- platform/linux-generic/include/odp/packet.h | 4 +- platform/linux-generic/include/odp/packet_io.h | 8 +- .../linux-generic/include/odp/packet_io_types.h | 40 ---------- platform/linux-generic/include/odp/packet_types.h | 47 ----------- .../linux-generic/include/odp/plat/atomic_types.h | 81 +++++++++++++++++++ .../linux-generic/include/odp/plat/buffer_types.h | 45 +++++++++++ .../include/odp/plat/byteorder_types.h | 90 ++++++++++++++++++++++ .../include/odp/plat/classification_types.h | 42 ++++++++++ .../linux-generic/include/odp/plat/cpumask_types.h | 44 +++++++++++ .../include/odp/plat/packet_io_types.h | 40 ++++++++++ .../linux-generic/include/odp/plat/packet_types.h | 47 +++++++++++ .../linux-generic/include/odp/plat/pool_types.h | 37 +++++++++ .../include/odp/plat/shared_memory_types.h | 39 ++++++++++ .../linux-generic/include/odp/platform_types.h | 2 +- platform/linux-generic/include/odp/pool_types.h | 37 --------- platform/linux-generic/include/odp/shared_memory.h | 2 +- .../include/odp/shared_memory_types.h | 39 ---------- 30 files changed, 496 insertions(+), 493 deletions(-) delete mode 100644 platform/linux-generic/include/odp/atomic_types.h delete mode 100644 platform/linux-generic/include/odp/buffer_types.h delete mode 100644 platform/linux-generic/include/odp/byteorder_types.h delete mode 100644 platform/linux-generic/include/odp/classification_types.h delete mode 100644 platform/linux-generic/include/odp/cpumask_types.h delete mode 100644 platform/linux-generic/include/odp/packet_io_types.h delete mode 100644 platform/linux-generic/include/odp/packet_types.h create mode 100644 platform/linux-generic/include/odp/plat/atomic_types.h create mode 100644 platform/linux-generic/include/odp/plat/buffer_types.h create mode 100644 platform/linux-generic/include/odp/plat/byteorder_types.h create mode 100644 platform/linux-generic/include/odp/plat/classification_types.h create mode 100644 platform/linux-generic/include/odp/plat/cpumask_types.h create mode 100644 platform/linux-generic/include/odp/plat/packet_io_types.h create mode 100644 platform/linux-generic/include/odp/plat/packet_types.h create mode 100644 platform/linux-generic/include/odp/plat/pool_types.h create mode 100644 platform/linux-generic/include/odp/plat/shared_memory_types.h delete mode 100644 platform/linux-generic/include/odp/pool_types.h delete mode 100644 platform/linux-generic/include/odp/shared_memory_types.h diff --git a/include/odp/api/pool.h b/include/odp/api/pool.h index 343558f20..158210219 100644 --- a/include/odp/api/pool.h +++ b/include/odp/api/pool.h @@ -21,7 +21,7 @@ extern "C" { #include -#include +#include #include #include diff --git a/platform/linux-generic/Makefile.am b/platform/linux-generic/Makefile.am index 3fdb1305e..79b37435f 100644 --- a/platform/linux-generic/Makefile.am +++ b/platform/linux-generic/Makefile.am @@ -12,18 +12,13 @@ odpincludedir= $(includedir)/odp odpinclude_HEADERS = \ $(top_srcdir)/platform/linux-generic/include/odp/align.h \ $(top_srcdir)/platform/linux-generic/include/odp/atomic.h \ - $(top_srcdir)/platform/linux-generic/include/odp/atomic_types.h \ $(top_srcdir)/platform/linux-generic/include/odp/barrier.h \ $(top_srcdir)/platform/linux-generic/include/odp/buffer.h \ - $(top_srcdir)/platform/linux-generic/include/odp/buffer_types.h \ $(top_srcdir)/platform/linux-generic/include/odp/byteorder.h \ - $(top_srcdir)/platform/linux-generic/include/odp/byteorder_types.h \ $(top_srcdir)/platform/linux-generic/include/odp/classification.h \ - $(top_srcdir)/platform/linux-generic/include/odp/classification_types.h \ $(top_srcdir)/platform/linux-generic/include/odp/compiler.h \ $(top_srcdir)/platform/linux-generic/include/odp/config.h \ $(top_srcdir)/platform/linux-generic/include/odp/cpumask.h \ - $(top_srcdir)/platform/linux-generic/include/odp/cpumask_types.h \ $(top_srcdir)/platform/linux-generic/include/odp/crypto.h \ $(top_srcdir)/platform/linux-generic/include/odp/debug.h \ $(top_srcdir)/platform/linux-generic/include/odp/event.h \ @@ -32,16 +27,12 @@ odpinclude_HEADERS = \ $(top_srcdir)/platform/linux-generic/include/odp/packet_flags.h \ $(top_srcdir)/platform/linux-generic/include/odp/packet.h \ $(top_srcdir)/platform/linux-generic/include/odp/packet_io.h \ - $(top_srcdir)/platform/linux-generic/include/odp/packet_io_types.h \ - $(top_srcdir)/platform/linux-generic/include/odp/packet_types.h \ $(top_srcdir)/platform/linux-generic/include/odp/platform_types.h \ $(top_srcdir)/platform/linux-generic/include/odp/pool.h \ - $(top_srcdir)/platform/linux-generic/include/odp/pool_types.h \ $(top_srcdir)/platform/linux-generic/include/odp/queue.h \ $(top_srcdir)/platform/linux-generic/include/odp/rwlock.h \ $(top_srcdir)/platform/linux-generic/include/odp/schedule.h \ $(top_srcdir)/platform/linux-generic/include/odp/shared_memory.h \ - $(top_srcdir)/platform/linux-generic/include/odp/shared_memory_types.h \ $(top_srcdir)/platform/linux-generic/include/odp/spinlock.h \ $(top_srcdir)/platform/linux-generic/include/odp/std_types.h \ $(top_srcdir)/platform/linux-generic/include/odp/sync.h \ @@ -52,6 +43,18 @@ odpinclude_HEADERS = \ $(top_srcdir)/platform/linux-generic/include/odp/timer.h \ $(top_srcdir)/platform/linux-generic/include/odp/version.h +odpplatincludedir= $(includedir)/odp/plat +odpplatinclude_HEADERS = \ + $(top_srcdir)/platform/linux-generic/include/odp/plat/atomic_types.h \ + $(top_srcdir)/platform/linux-generic/include/odp/plat/buffer_types.h \ + $(top_srcdir)/platform/linux-generic/include/odp/plat/byteorder_types.h \ + $(top_srcdir)/platform/linux-generic/include/odp/plat/classification_types.h \ + $(top_srcdir)/platform/linux-generic/include/odp/plat/cpumask_types.h \ + $(top_srcdir)/platform/linux-generic/include/odp/plat/packet_types.h \ + $(top_srcdir)/platform/linux-generic/include/odp/plat/packet_io_types.h \ + $(top_srcdir)/platform/linux-generic/include/odp/plat/pool_types.h \ + $(top_srcdir)/platform/linux-generic/include/odp/plat/shared_memory_types.h + odpapiincludedir= $(includedir)/odp/api odpapiinclude_HEADERS = \ $(top_srcdir)/include/odp/api/align.h \ diff --git a/platform/linux-generic/include/odp/atomic.h b/platform/linux-generic/include/odp/atomic.h index 952b0f4a0..e47a280bf 100644 --- a/platform/linux-generic/include/odp/atomic.h +++ b/platform/linux-generic/include/odp/atomic.h @@ -19,7 +19,7 @@ extern "C" { #include #include -#include +#include /** @ingroup odp_synchronizers * @{ diff --git a/platform/linux-generic/include/odp/atomic_types.h b/platform/linux-generic/include/odp/atomic_types.h deleted file mode 100644 index 3cdcab8bd..000000000 --- a/platform/linux-generic/include/odp/atomic_types.h +++ /dev/null @@ -1,81 +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 - -/** - * @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 - * 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 - -/** @addtogroup odp_synchronizers - * @{ - */ - -typedef struct odp_atomic_u64_s odp_atomic_u64_t; - -typedef struct odp_atomic_u32_s odp_atomic_u32_t; - -/** - * @} - */ - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/platform/linux-generic/include/odp/barrier.h b/platform/linux-generic/include/odp/barrier.h index 382acd516..bce373471 100644 --- a/platform/linux-generic/include/odp/barrier.h +++ b/platform/linux-generic/include/odp/barrier.h @@ -26,7 +26,7 @@ extern "C" { */ #include -#include +#include #include #ifdef __cplusplus diff --git a/platform/linux-generic/include/odp/buffer.h b/platform/linux-generic/include/odp/buffer.h index 9c11300ca..dd255ecaa 100644 --- a/platform/linux-generic/include/odp/buffer.h +++ b/platform/linux-generic/include/odp/buffer.h @@ -18,8 +18,8 @@ extern "C" { #endif #include -#include -#include +#include +#include /** @ingroup odp_buffer * @{ diff --git a/platform/linux-generic/include/odp/buffer_types.h b/platform/linux-generic/include/odp/buffer_types.h deleted file mode 100644 index f5cce1550..000000000 --- a/platform/linux-generic/include/odp/buffer_types.h +++ /dev/null @@ -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 - -/** @addtogroup odp_buffer ODP BUFFER - * Operations on a buffer. - * @{ - */ - -/** ODP buffer */ -typedef uint32_t odp_buffer_t; - -/** Invalid buffer */ -#define ODP_BUFFER_INVALID (0xffffffff) - -/** ODP buffer segment */ -typedef odp_buffer_t odp_buffer_seg_t; - -/** Invalid segment */ -#define ODP_SEGMENT_INVALID ODP_BUFFER_INVALID - -/** - * @} - */ - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/platform/linux-generic/include/odp/byteorder.h b/platform/linux-generic/include/odp/byteorder.h index a44b6ece5..173b0475d 100644 --- a/platform/linux-generic/include/odp/byteorder.h +++ b/platform/linux-generic/include/odp/byteorder.h @@ -19,7 +19,7 @@ extern "C" { #include #include -#include +#include #include #include diff --git a/platform/linux-generic/include/odp/byteorder_types.h b/platform/linux-generic/include/odp/byteorder_types.h deleted file mode 100644 index cf917b1a2..000000000 --- a/platform/linux-generic/include/odp/byteorder_types.h +++ /dev/null @@ -1,90 +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 __BIG_ENDIAN -#error __BIG_ENDIAN not defined! -#endif - -#ifndef __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 - * @{ - */ - -#define ODP_BIG_ENDIAN __BIG_ENDIAN - -#define ODP_LITTLE_ENDIAN __LITTLE_ENDIAN - -#ifdef __BIG_ENDIAN_BITFIELD -#define ODP_BIG_ENDIAN_BITFIELD -#endif - -#ifdef __LITTLE_ENDIAN_BITFIELD -#define ODP_LITTLE_ENDIAN_BITFIELD -#endif - -#if __BYTE_ORDER == __LITTLE_ENDIAN -#define ODP_BYTE_ORDER ODP_LITTLE_ENDIAN -#elif __BYTE_ORDER == __BIG_ENDIAN -#define ODP_BYTE_ORDER ODP_BIG_ENDIAN -#endif - -typedef uint16_t __odp_bitwise uint16le_t; -typedef uint16_t __odp_bitwise uint16be_t; - -typedef uint32_t __odp_bitwise uint32le_t; -typedef uint32_t __odp_bitwise uint32be_t; - -typedef uint64_t __odp_bitwise uint64le_t; -typedef uint64_t __odp_bitwise uint64be_t; - -typedef uint16_t __odp_bitwise uint16sum_t; -typedef uint32_t __odp_bitwise uint32sum_t; - -/** - * @} - */ - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/platform/linux-generic/include/odp/classification.h b/platform/linux-generic/include/odp/classification.h index 57255536c..335523c00 100644 --- a/platform/linux-generic/include/odp/classification.h +++ b/platform/linux-generic/include/odp/classification.h @@ -18,10 +18,10 @@ extern "C" { #endif #include -#include -#include -#include -#include +#include +#include +#include +#include /** @ingroup odp_classification * @{ diff --git a/platform/linux-generic/include/odp/classification_types.h b/platform/linux-generic/include/odp/classification_types.h deleted file mode 100644 index 07d640e62..000000000 --- a/platform/linux-generic/include/odp/classification_types.h +++ /dev/null @@ -1,42 +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 - -/** @addtogroup odp_classification - * @{ - */ - -typedef uint32_t odp_cos_t; -typedef uint32_t odp_flowsig_t; - -#define ODP_COS_INVALID ((odp_cos_t)~0) -#define ODP_COS_NAME_LEN 32 - -typedef uint16_t odp_cos_flow_set_t; -typedef uint32_t odp_pmr_t; -typedef uint32_t odp_pmr_set_t; - -/** - * @} - */ - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/platform/linux-generic/include/odp/cpumask.h b/platform/linux-generic/include/odp/cpumask.h index a219a66f5..f09bb91d4 100644 --- a/platform/linux-generic/include/odp/cpumask.h +++ b/platform/linux-generic/include/odp/cpumask.h @@ -21,7 +21,7 @@ extern "C" { #include #include -#include +#include /** @ingroup odp_scheduler * @{ diff --git a/platform/linux-generic/include/odp/cpumask_types.h b/platform/linux-generic/include/odp/cpumask_types.h deleted file mode 100644 index 6d9e12995..000000000 --- a/platform/linux-generic/include/odp/cpumask_types.h +++ /dev/null @@ -1,44 +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_compiler_optim - * @{ - */ - -#include - -/** - * CPU mask - * - * Don't access directly, use access functions. - */ -typedef struct odp_cpumask_t { - cpu_set_t set; /**< @private Mask*/ -} odp_cpumask_t; - -/** - * @} - */ - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/platform/linux-generic/include/odp/packet.h b/platform/linux-generic/include/odp/packet.h index 2120c68af..6a41f3f5c 100644 --- a/platform/linux-generic/include/odp/packet.h +++ b/platform/linux-generic/include/odp/packet.h @@ -18,8 +18,8 @@ extern "C" { #endif #include -#include -#include +#include +#include /** @ingroup odp_packet * @{ diff --git a/platform/linux-generic/include/odp/packet_io.h b/platform/linux-generic/include/odp/packet_io.h index 01bd777d9..134cd7882 100644 --- a/platform/linux-generic/include/odp/packet_io.h +++ b/platform/linux-generic/include/odp/packet_io.h @@ -18,10 +18,10 @@ extern "C" { #endif #include -#include -#include -#include -#include +#include +#include +#include +#include /** @ingroup odp_packet_io * @{ diff --git a/platform/linux-generic/include/odp/packet_io_types.h b/platform/linux-generic/include/odp/packet_io_types.h deleted file mode 100644 index a6bbacffa..000000000 --- a/platform/linux-generic/include/odp/packet_io_types.h +++ /dev/null @@ -1,40 +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 - -/** @addtogroup odp_packet_io ODP PACKET IO - * Operations on a packet. - * @{ - */ - -typedef uint32_t odp_pktio_t; - -#define ODP_PKTIO_INVALID 0 - -#define ODP_PKTIO_ANY ((odp_pktio_t)~0) - -/** - * @} - */ - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/platform/linux-generic/include/odp/packet_types.h b/platform/linux-generic/include/odp/packet_types.h deleted file mode 100644 index 80c0c28ad..000000000 --- a/platform/linux-generic/include/odp/packet_types.h +++ /dev/null @@ -1,47 +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 - -/** @addtogroup odp_packet ODP PACKET - * Operations on a packet. - * @{ - */ - -typedef odp_buffer_t odp_packet_t; - -#define ODP_PACKET_INVALID ODP_BUFFER_INVALID - -#define ODP_PACKET_OFFSET_INVALID (0x0fffffff) - -typedef odp_buffer_t odp_packet_seg_t; - -#define ODP_PACKET_SEG_INVALID ODP_BUFFER_INVALID - -/** - * @} - */ - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/platform/linux-generic/include/odp/plat/atomic_types.h b/platform/linux-generic/include/odp/plat/atomic_types.h new file mode 100644 index 000000000..3cdcab8bd --- /dev/null +++ b/platform/linux-generic/include/odp/plat/atomic_types.h @@ -0,0 +1,81 @@ +/* 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 + +/** + * @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 + * 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 + +/** @addtogroup odp_synchronizers + * @{ + */ + +typedef struct odp_atomic_u64_s odp_atomic_u64_t; + +typedef struct odp_atomic_u32_s odp_atomic_u32_t; + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/platform/linux-generic/include/odp/plat/buffer_types.h b/platform/linux-generic/include/odp/plat/buffer_types.h new file mode 100644 index 000000000..f5cce1550 --- /dev/null +++ b/platform/linux-generic/include/odp/plat/buffer_types.h @@ -0,0 +1,45 @@ +/* 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 + +/** @addtogroup odp_buffer ODP BUFFER + * Operations on a buffer. + * @{ + */ + +/** ODP buffer */ +typedef uint32_t odp_buffer_t; + +/** Invalid buffer */ +#define ODP_BUFFER_INVALID (0xffffffff) + +/** ODP buffer segment */ +typedef odp_buffer_t odp_buffer_seg_t; + +/** Invalid segment */ +#define ODP_SEGMENT_INVALID ODP_BUFFER_INVALID + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/platform/linux-generic/include/odp/plat/byteorder_types.h b/platform/linux-generic/include/odp/plat/byteorder_types.h new file mode 100644 index 000000000..cf917b1a2 --- /dev/null +++ b/platform/linux-generic/include/odp/plat/byteorder_types.h @@ -0,0 +1,90 @@ +/* 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 __BIG_ENDIAN +#error __BIG_ENDIAN not defined! +#endif + +#ifndef __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 + * @{ + */ + +#define ODP_BIG_ENDIAN __BIG_ENDIAN + +#define ODP_LITTLE_ENDIAN __LITTLE_ENDIAN + +#ifdef __BIG_ENDIAN_BITFIELD +#define ODP_BIG_ENDIAN_BITFIELD +#endif + +#ifdef __LITTLE_ENDIAN_BITFIELD +#define ODP_LITTLE_ENDIAN_BITFIELD +#endif + +#if __BYTE_ORDER == __LITTLE_ENDIAN +#define ODP_BYTE_ORDER ODP_LITTLE_ENDIAN +#elif __BYTE_ORDER == __BIG_ENDIAN +#define ODP_BYTE_ORDER ODP_BIG_ENDIAN +#endif + +typedef uint16_t __odp_bitwise uint16le_t; +typedef uint16_t __odp_bitwise uint16be_t; + +typedef uint32_t __odp_bitwise uint32le_t; +typedef uint32_t __odp_bitwise uint32be_t; + +typedef uint64_t __odp_bitwise uint64le_t; +typedef uint64_t __odp_bitwise uint64be_t; + +typedef uint16_t __odp_bitwise uint16sum_t; +typedef uint32_t __odp_bitwise uint32sum_t; + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/platform/linux-generic/include/odp/plat/classification_types.h b/platform/linux-generic/include/odp/plat/classification_types.h new file mode 100644 index 000000000..07d640e62 --- /dev/null +++ b/platform/linux-generic/include/odp/plat/classification_types.h @@ -0,0 +1,42 @@ +/* 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 + +/** @addtogroup odp_classification + * @{ + */ + +typedef uint32_t odp_cos_t; +typedef uint32_t odp_flowsig_t; + +#define ODP_COS_INVALID ((odp_cos_t)~0) +#define ODP_COS_NAME_LEN 32 + +typedef uint16_t odp_cos_flow_set_t; +typedef uint32_t odp_pmr_t; +typedef uint32_t odp_pmr_set_t; + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/platform/linux-generic/include/odp/plat/cpumask_types.h b/platform/linux-generic/include/odp/plat/cpumask_types.h new file mode 100644 index 000000000..6d9e12995 --- /dev/null +++ b/platform/linux-generic/include/odp/plat/cpumask_types.h @@ -0,0 +1,44 @@ +/* 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_compiler_optim + * @{ + */ + +#include + +/** + * CPU mask + * + * Don't access directly, use access functions. + */ +typedef struct odp_cpumask_t { + cpu_set_t set; /**< @private Mask*/ +} odp_cpumask_t; + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/platform/linux-generic/include/odp/plat/packet_io_types.h b/platform/linux-generic/include/odp/plat/packet_io_types.h new file mode 100644 index 000000000..a6bbacffa --- /dev/null +++ b/platform/linux-generic/include/odp/plat/packet_io_types.h @@ -0,0 +1,40 @@ +/* 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 + +/** @addtogroup odp_packet_io ODP PACKET IO + * Operations on a packet. + * @{ + */ + +typedef uint32_t odp_pktio_t; + +#define ODP_PKTIO_INVALID 0 + +#define ODP_PKTIO_ANY ((odp_pktio_t)~0) + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/platform/linux-generic/include/odp/plat/packet_types.h b/platform/linux-generic/include/odp/plat/packet_types.h new file mode 100644 index 000000000..60d64439c --- /dev/null +++ b/platform/linux-generic/include/odp/plat/packet_types.h @@ -0,0 +1,47 @@ +/* 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 + +/** @addtogroup odp_packet ODP PACKET + * Operations on a packet. + * @{ + */ + +typedef odp_buffer_t odp_packet_t; + +#define ODP_PACKET_INVALID ODP_BUFFER_INVALID + +#define ODP_PACKET_OFFSET_INVALID (0x0fffffff) + +typedef odp_buffer_t odp_packet_seg_t; + +#define ODP_PACKET_SEG_INVALID ODP_BUFFER_INVALID + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/platform/linux-generic/include/odp/plat/pool_types.h b/platform/linux-generic/include/odp/plat/pool_types.h new file mode 100644 index 000000000..7bfbbfc0a --- /dev/null +++ b/platform/linux-generic/include/odp/plat/pool_types.h @@ -0,0 +1,37 @@ +/* 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_ + +#ifdef __cplusplus +extern "C" { +#endif + +/** @addtogroup odp_buffer + * Operations on a pool. + * @{ + */ + +typedef uint32_t odp_pool_t; + +#define ODP_POOL_INVALID (0xffffffff) + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/platform/linux-generic/include/odp/plat/shared_memory_types.h b/platform/linux-generic/include/odp/plat/shared_memory_types.h new file mode 100644 index 000000000..c044cb935 --- /dev/null +++ b/platform/linux-generic/include/odp/plat/shared_memory_types.h @@ -0,0 +1,39 @@ +/* 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 + +/** @addtogroup odp_shared_memory ODP SHARED MEMORY + * Operations on shared memory. + * @{ + */ + +typedef uint32_t odp_shm_t; + +#define ODP_SHM_INVALID 0 +#define ODP_SHM_NULL ODP_SHM_INVALID + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/platform/linux-generic/include/odp/platform_types.h b/platform/linux-generic/include/odp/platform_types.h index 2313aed48..a77ee7cf2 100644 --- a/platform/linux-generic/include/odp/platform_types.h +++ b/platform/linux-generic/include/odp/platform_types.h @@ -19,7 +19,7 @@ #define ODP_IMPL_TYPES_H_ #include -#include +#include /** @defgroup odp_platform_types ODP PLATFORM TYPES * Implementation specific definitions for ODP abstract types. diff --git a/platform/linux-generic/include/odp/pool_types.h b/platform/linux-generic/include/odp/pool_types.h deleted file mode 100644 index 7bfbbfc0a..000000000 --- a/platform/linux-generic/include/odp/pool_types.h +++ /dev/null @@ -1,37 +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_ - -#ifdef __cplusplus -extern "C" { -#endif - -/** @addtogroup odp_buffer - * Operations on a pool. - * @{ - */ - -typedef uint32_t odp_pool_t; - -#define ODP_POOL_INVALID (0xffffffff) - -/** - * @} - */ - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/platform/linux-generic/include/odp/shared_memory.h b/platform/linux-generic/include/odp/shared_memory.h index fb81eadd9..5b1ded8ae 100644 --- a/platform/linux-generic/include/odp/shared_memory.h +++ b/platform/linux-generic/include/odp/shared_memory.h @@ -18,7 +18,7 @@ extern "C" { #endif #include -#include +#include /** @ingroup odp_shared_memory * @{ diff --git a/platform/linux-generic/include/odp/shared_memory_types.h b/platform/linux-generic/include/odp/shared_memory_types.h deleted file mode 100644 index c044cb935..000000000 --- a/platform/linux-generic/include/odp/shared_memory_types.h +++ /dev/null @@ -1,39 +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 - -/** @addtogroup odp_shared_memory ODP SHARED MEMORY - * Operations on shared memory. - * @{ - */ - -typedef uint32_t odp_shm_t; - -#define ODP_SHM_INVALID 0 -#define ODP_SHM_NULL ODP_SHM_INVALID - -/** - * @} - */ - -#ifdef __cplusplus -} -#endif - -#endif -- cgit v1.2.3