diff options
author | Zoltan Kiss <zoltan.kiss@schaman.hu> | 2015-02-26 18:25:30 +0000 |
---|---|---|
committer | Venkatesh Vivekanandan <venkatesh.vivekanandan@linaro.org> | 2015-02-27 14:48:18 +0530 |
commit | 0116343f423f0fd5e83b1b14de7514d7faf124f1 (patch) | |
tree | f579f9aac86008be8fa45fc1bd53e7831b763d82 | |
parent | 0c9164ee5fa8bb52943e766378e708f870c476ea (diff) |
api: Use our own platform type definitions
We only need it to define odp_buffer_t and odp_packet_t as unsigned longs, so it
will be compatible with both 32 and 64 bit archs.
Signed-off-by: Venkatesh Vivekanandan <venkatesh.vivekanandan@linaro.org>
Signed-off-by: Zoltan Kiss <zoltan.kiss@linaro.org>
-rw-r--r-- | platform/linux-dpdk/Makefile.am | 4 | ||||
-rw-r--r-- | platform/linux-dpdk/include/api/odp_platform_types.h | 81 |
2 files changed, 83 insertions, 2 deletions
diff --git a/platform/linux-dpdk/Makefile.am b/platform/linux-dpdk/Makefile.am index 1a74d2f77..cd6a96455 100644 --- a/platform/linux-dpdk/Makefile.am +++ b/platform/linux-dpdk/Makefile.am @@ -52,9 +52,9 @@ include_HEADERS = \ $(top_srcdir)/platform/linux-generic/include/api/odp_thread.h \ $(top_srcdir)/platform/linux-generic/include/api/odp_ticketlock.h \ $(top_srcdir)/platform/linux-generic/include/api/odp_time.h \ - $(top_srcdir)/platform/linux-generic/include/api/odp_platform_types.h \ $(top_srcdir)/platform/linux-generic/include/api/odp_timer.h \ - $(top_srcdir)/platform/linux-generic/include/api/odp_version.h + $(top_srcdir)/platform/linux-generic/include/api/odp_version.h \ + $(srcdir)/include/api/odp_platform_types.h subdirheadersdir = $(includedir)/helper subdirheaders_HEADERS = \ diff --git a/platform/linux-dpdk/include/api/odp_platform_types.h b/platform/linux-dpdk/include/api/odp_platform_types.h new file mode 100644 index 000000000..25315f693 --- /dev/null +++ b/platform/linux-dpdk/include/api/odp_platform_types.h @@ -0,0 +1,81 @@ +/* Copyright (c) 2014, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + + +/** + * @file + * ODP implementation types + * This file contains all of the implementation-defined types for ODP abstract + * definitions. Having this in one file means that other ODP API files are + * implementation-independent and avoids circular dependencies for files that + * refer to types managed by other components. Included here are typedefs and + * related typed constants that are referenced by other ODP API files. + */ + +#ifndef ODP_IMPL_TYPES_H_ +#define ODP_IMPL_TYPES_H_ + +/** @defgroup odp_platform_types ODP PLATFORM TYPES + * Implementation specific definitions for ODP abstract types. + * @{ + */ + +/** ODP Buffer pool */ +typedef unsigned long odp_buffer_pool_t; + +/** Invalid buffer pool */ +#define ODP_BUFFER_POOL_INVALID (0xffffffff) + +/** ODP buffer */ +typedef unsigned long 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 + +/** ODP packet */ +typedef odp_buffer_t odp_packet_t; + +/** Invalid packet */ +#define ODP_PACKET_INVALID ODP_BUFFER_INVALID + +/** Invalid packet offset */ +#define ODP_PACKET_OFFSET_INVALID (0x0fffffff) + +/** ODP packet segment */ +typedef odp_buffer_t odp_packet_seg_t; + +/** Invalid packet segment */ +#define ODP_PACKET_SEG_INVALID ODP_BUFFER_INVALID + +/** ODP packet IO handle */ +typedef uint32_t odp_pktio_t; + +/** Invalid packet IO handle */ +#define ODP_PKTIO_INVALID 0 + +/** odp_pktio_t value to indicate any port */ +#define ODP_PKTIO_ANY ((odp_pktio_t)~0) + +/** + * ODP shared memory block + */ +typedef uint32_t odp_shm_t; + +/** Invalid shared memory block */ +#define ODP_SHM_INVALID 0 +#define ODP_SHM_NULL ODP_SHM_INVALID /**< Synonym for buffer pool use */ + +/** + * @} + */ + +#endif |