[PATCHv2] linux-dpdk: configure: harmonize inline support with linux-generic

Message ID 1472555697-23076-1-git-send-email-bill.fischofer@linaro.org
State New
Headers show

Commit Message

Bill Fischofer Aug. 30, 2016, 11:14 a.m.
Merge the linux-generic changes from patch
http://patches.opendataplane.org/patch/6903/ into odp-dpdk and harmonize
the inline support for the --enable-shared=[yes|no] option between
the two implementations to enhance ABI compatibility.

Suggested-by: Zoltan Kiss <zoltan.kiss@linaro.org>
Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org>
---
v2: correct filename in .gitignore

 .gitignore                                         |   3 +-
 platform/linux-dpdk/Makefile.am                    |   8 +-
 platform/linux-dpdk/include/odp/api/inlines.h.in   |  33 --
 platform/linux-dpdk/include/odp/api/packet.h       |   4 +-
 platform/linux-dpdk/include/odp/api/packet_flags.h |   4 +-
 .../include/odp/api/packet_flags_inlines.h         |  44 ---
 .../linux-dpdk/include/odp/api/packet_inlines.h    |  83 -----
 .../include/odp/api/plat/atomic_inlines.h          |   1 +
 .../include/odp/api/plat/byteorder_inlines.h       |   1 +
 .../linux-dpdk/include/odp/api/plat/inlines.h.in   |  32 ++
 .../include/odp/api/plat/packet_flags_inlines.h    |  44 +++
 .../include/odp/api/plat/packet_inlines.h          |  84 +++++
 .../include/odp/api/plat/std_clib_inlines.h        |  38 ++
 .../linux-dpdk/include/odp/api/plat/sync_inlines.h |   1 +
 platform/linux-dpdk/include/odp/api/std_clib.h     |  20 +-
 platform/linux-dpdk/m4/configure.m4                |   2 +-
 platform/linux-dpdk/odp_packet.c                   |   2 +-
 platform/linux-dpdk/odp_packet_flags.c             |   2 +-
 platform/linux-dpdk/odp_std_clib.c                 |  10 +
 platform/linux-generic/Makefile.am                 |   9 +
 platform/linux-generic/include/odp/api/atomic.h    | 384 +-------------------
 platform/linux-generic/include/odp/api/byteorder.h | 114 +-----
 .../include/odp/api/plat/atomic_inlines.h          | 385 +++++++++++++++++++++
 .../include/odp/api/plat/byteorder_inlines.h       | 140 ++++++++
 .../include/odp/api/plat/inlines.h.in              |  33 ++
 .../include/odp/api/plat/std_clib_inlines.h        |  36 ++
 .../include/odp/api/plat/sync_inlines.h            |  47 +++
 platform/linux-generic/include/odp/api/std_clib.h  |  18 +-
 platform/linux-generic/include/odp/api/sync.h      |  18 +-
 platform/linux-generic/m4/configure.m4             |   3 +-
 platform/linux-generic/odp_atomic.c                |   3 +
 platform/linux-generic/odp_byteorder.c             |  11 +
 platform/linux-generic/odp_std_clib.c              |  11 +
 platform/linux-generic/odp_sync.c                  |  11 +
 34 files changed, 934 insertions(+), 705 deletions(-)
 delete mode 100644 platform/linux-dpdk/include/odp/api/inlines.h.in
 delete mode 100644 platform/linux-dpdk/include/odp/api/packet_flags_inlines.h
 delete mode 100644 platform/linux-dpdk/include/odp/api/packet_inlines.h
 create mode 120000 platform/linux-dpdk/include/odp/api/plat/atomic_inlines.h
 create mode 120000 platform/linux-dpdk/include/odp/api/plat/byteorder_inlines.h
 create mode 100644 platform/linux-dpdk/include/odp/api/plat/inlines.h.in
 create mode 100644 platform/linux-dpdk/include/odp/api/plat/packet_flags_inlines.h
 create mode 100644 platform/linux-dpdk/include/odp/api/plat/packet_inlines.h
 create mode 100644 platform/linux-dpdk/include/odp/api/plat/std_clib_inlines.h
 create mode 120000 platform/linux-dpdk/include/odp/api/plat/sync_inlines.h
 create mode 100644 platform/linux-generic/include/odp/api/plat/atomic_inlines.h
 create mode 100644 platform/linux-generic/include/odp/api/plat/byteorder_inlines.h
 create mode 100644 platform/linux-generic/include/odp/api/plat/inlines.h.in
 create mode 100644 platform/linux-generic/include/odp/api/plat/std_clib_inlines.h
 create mode 100644 platform/linux-generic/include/odp/api/plat/sync_inlines.h
 create mode 100644 platform/linux-generic/odp_byteorder.c
 create mode 100644 platform/linux-generic/odp_std_clib.c
 create mode 100644 platform/linux-generic/odp_sync.c

Comments

Zoltan Kiss Aug. 30, 2016, 5:45 p.m. | #1
Hi,

If you merge this, the next time you pull patches from odp.git it will 
conflict with your changes made here to files in platform/linux-generic. 
If you apply the same changes there (in regards of 
platform/linux-generic), chances are git will be smart enough to 
recognize this, but I think it's better to avoid this by separating out 
those changes into another patch, and apply it to odp.git first, then 
pull it into odp-dpdk. I've usually pulled all the new patches, that 
needs to be done anyway sometimes.
Also, I recommend to split out the file moving parts into a separate 
patch. A big part of this patch is essentially moving some files under 
the plat directory, it would be easier to review the rest of the changes.


On 30/08/16 13:14, Bill Fischofer wrote:
> Merge the linux-generic changes from patch
> http://patches.opendataplane.org/patch/6903/ into odp-dpdk and harmonize
> the inline support for the --enable-shared=[yes|no] option between
> the two implementations to enhance ABI compatibility.
>
> Suggested-by: Zoltan Kiss <zoltan.kiss@linaro.org>
> Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org>
> ---
> v2: correct filename in .gitignore
>
...
> diff --git a/platform/linux-dpdk/Makefile.am b/platform/linux-dpdk/Makefile.am
> index d4e9c79..ddca12e 100644
> --- a/platform/linux-dpdk/Makefile.am
> +++ b/platform/linux-dpdk/Makefile.am
> @@ -47,11 +47,8 @@ odpapiinclude_HEADERS = \
>   		  $(srcdir)/include/odp/api/hash.h \
>   		  $(srcdir)/include/odp/api/hints.h \
>   		  $(srcdir)/include/odp/api/init.h \
> -		  $(builddir)/include/odp/api/inlines.h \

$(builddir) had a role here for CI, please check with blame what was that.
Bill Fischofer Aug. 30, 2016, 6:46 p.m. | #2
On Tue, Aug 30, 2016 at 12:45 PM, Zoltan Kiss <zoltan.kiss@schaman.hu>
wrote:

> Hi,
>
> If you merge this, the next time you pull patches from odp.git it will
> conflict with your changes made here to files in platform/linux-generic. If
> you apply the same changes there (in regards of platform/linux-generic),
> chances are git will be smart enough to recognize this, but I think it's
> better to avoid this by separating out those changes into another patch,
> and apply it to odp.git first, then pull it into odp-dpdk. I've usually
> pulled all the new patches, that needs to be done anyway sometimes.
>

OK, I wasn't sure how you were keeping these in sync. The linux-generic
patch doesn't apply cleanly by itself due to conflicts in common files like
.gitignore but that should be workable. Might be better to push those down
into the individual directories.


> Also, I recommend to split out the file moving parts into a separate
> patch. A big part of this patch is essentially moving some files under the
> plat directory, it would be easier to review the rest of the changes.


Sounds good. I'll work up a v3 that's multi-part.


>
>
>
> On 30/08/16 13:14, Bill Fischofer wrote:
>
>> Merge the linux-generic changes from patch
>> http://patches.opendataplane.org/patch/6903/ into odp-dpdk and harmonize
>> the inline support for the --enable-shared=[yes|no] option between
>> the two implementations to enhance ABI compatibility.
>>
>> Suggested-by: Zoltan Kiss <zoltan.kiss@linaro.org>
>> Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org>
>> ---
>> v2: correct filename in .gitignore
>>
>> ...
>
>> diff --git a/platform/linux-dpdk/Makefile.am
>> b/platform/linux-dpdk/Makefile.am
>> index d4e9c79..ddca12e 100644
>> --- a/platform/linux-dpdk/Makefile.am
>> +++ b/platform/linux-dpdk/Makefile.am
>> @@ -47,11 +47,8 @@ odpapiinclude_HEADERS = \
>>                   $(srcdir)/include/odp/api/hash.h \
>>                   $(srcdir)/include/odp/api/hints.h \
>>                   $(srcdir)/include/odp/api/init.h \
>> -                 $(builddir)/include/odp/api/inlines.h \
>>
>
> $(builddir) had a role here for CI, please check with blame what was that.
>
>
OK, will check with Anders on that. We want to run this through CI before
acceptance so that may require some adjustment.

Patch hide | download patch | download mbox

diff --git a/.gitignore b/.gitignore
index bcc556c..709cb7f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -41,6 +41,7 @@  ltmain.sh
 m4/*.m4
 missing
 pkgconfig/libodp*.pc
-platform/linux-dpdk/include/odp/api/inlines.h
+platform/linux-dpdk/include/odp/api/plat/inlines.h
+platform/linux-generic/include/odp/api/plat/inlines.h
 tags
 test-driver
diff --git a/platform/linux-dpdk/Makefile.am b/platform/linux-dpdk/Makefile.am
index d4e9c79..ddca12e 100644
--- a/platform/linux-dpdk/Makefile.am
+++ b/platform/linux-dpdk/Makefile.am
@@ -47,11 +47,8 @@  odpapiinclude_HEADERS = \
 		  $(srcdir)/include/odp/api/hash.h \
 		  $(srcdir)/include/odp/api/hints.h \
 		  $(srcdir)/include/odp/api/init.h \
-		  $(builddir)/include/odp/api/inlines.h \
 		  $(srcdir)/include/odp/api/packet_flags.h \
-		  $(srcdir)/include/odp/api/packet_flags_inlines.h \
 		  $(srcdir)/include/odp/api/packet.h \
-		  $(srcdir)/include/odp/api/packet_inlines.h \
 		  $(srcdir)/include/odp/api/packet_io.h \
 		  $(srcdir)/include/odp/api/packet_io_stats.h \
 		  $(srcdir)/include/odp/api/pool.h \
@@ -90,7 +87,10 @@  odpapiplatinclude_HEADERS = \
 		  $(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/inlines.h \
+		  $(srcdir)/include/odp/api/plat/packet_flags_inlines.h \
 		  $(srcdir)/include/odp/api/plat/packet_types.h \
+		  $(srcdir)/include/odp/api/plat/packet_inlines.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 \
@@ -155,6 +155,7 @@  __LIB__libodp_dpdk_la_SOURCES = \
 			   ../linux-generic/odp_atomic.c \
 			   ../linux-generic/odp_barrier.c \
 			   odp_buffer.c \
+			   ../linux-generic/odp_byteorder.c \
 			   ../linux-generic/odp_classification.c \
 			   ../linux-generic/odp_cpu.c \
 			   ../linux-generic/odp_cpumask.c \
@@ -184,6 +185,7 @@  __LIB__libodp_dpdk_la_SOURCES = \
 			   ../linux-generic/odp_spinlock.c \
 			   ../linux-generic/odp_spinlock_recursive.c \
 			   odp_std_clib.c \
+			   ../linux-generic/odp_sync.c \
 			   ../linux-generic/odp_system_info.c \
 			   odp_thread.c \
 			   ../linux-generic/odp_thrmask.c \
diff --git a/platform/linux-dpdk/include/odp/api/inlines.h.in b/platform/linux-dpdk/include/odp/api/inlines.h.in
deleted file mode 100644
index 43e542b..0000000
--- a/platform/linux-dpdk/include/odp/api/inlines.h.in
+++ /dev/null
@@ -1,33 +0,0 @@ 
-/* Copyright (c) 2016, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-/**
- * @file
- *
- * ODP packet inline functions
- */
-
-#ifndef ODP_PLAT_INLINES_H_
-#define ODP_PLAT_INLINES_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define @_ODP_INLINES@
-
-#ifdef _ODP_INLINES
-#define _STATIC static inline
-#else
-#define _STATIC
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-
-#endif /* ODP_PLAT_INLINES_H_ */
diff --git a/platform/linux-dpdk/include/odp/api/packet.h b/platform/linux-dpdk/include/odp/api/packet.h
index 61543fa..f9123d8 100644
--- a/platform/linux-dpdk/include/odp/api/packet.h
+++ b/platform/linux-dpdk/include/odp/api/packet.h
@@ -28,9 +28,9 @@  extern "C" {
  *  @{
  */
 
-#include <odp/api/inlines.h>
+#include <odp/api/plat/inlines.h>
 #ifdef _ODP_INLINES
-#include <odp/api/packet_inlines.h>
+#include <odp/api/plat/packet_inlines.h>
 #endif
 
 /**
diff --git a/platform/linux-dpdk/include/odp/api/packet_flags.h b/platform/linux-dpdk/include/odp/api/packet_flags.h
index 00dd845..b6ae9f8 100644
--- a/platform/linux-dpdk/include/odp/api/packet_flags.h
+++ b/platform/linux-dpdk/include/odp/api/packet_flags.h
@@ -28,9 +28,9 @@  extern "C" {
  *  @{
  */
 
-#include <odp/api/inlines.h>
+#include <odp/api/plat/inlines.h>
 #ifdef _ODP_INLINES
-#include <odp/api/packet_flags_inlines.h>
+#include <odp/api/plat/packet_flags_inlines.h>
 #endif
 
 /**
diff --git a/platform/linux-dpdk/include/odp/api/packet_flags_inlines.h b/platform/linux-dpdk/include/odp/api/packet_flags_inlines.h
deleted file mode 100644
index 7d2464e..0000000
--- a/platform/linux-dpdk/include/odp/api/packet_flags_inlines.h
+++ /dev/null
@@ -1,44 +0,0 @@ 
-/* Copyright (c) 2016, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-/**
- * @file
- *
- * ODP packet flags inline functions
- */
-
-#ifndef ODP_PLAT_PACKET_FLAGS_INLINES_H_
-#define ODP_PLAT_PACKET_FLAGS_INLINES_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-extern const unsigned int ol_flags_offset;
-extern const uint64_t rss_flag;
-
-/*
- * NOTE: These functions are inlined because they are on a performance hot path.
- * As we can't force the application to directly include DPDK headers we have to
- * export these fields through constants calculated compile time in
- * odp_packet.c, where we can see the DPDK definitions.
- *
- */
-_STATIC int odp_packet_has_flow_hash(odp_packet_t pkt)
-{
-	return *(uint64_t *)((char *)pkt + ol_flags_offset) & rss_flag;
-}
-
-_STATIC void odp_packet_has_flow_hash_clr(odp_packet_t pkt)
-{
-	*(uint64_t *)((char *)pkt + ol_flags_offset) &= ~rss_flag;
-}
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* ODP_PLAT_PACKET_FLAGS_INLINES_H_ */
diff --git a/platform/linux-dpdk/include/odp/api/packet_inlines.h b/platform/linux-dpdk/include/odp/api/packet_inlines.h
deleted file mode 100644
index 444919d..0000000
--- a/platform/linux-dpdk/include/odp/api/packet_inlines.h
+++ /dev/null
@@ -1,83 +0,0 @@ 
-/* Copyright (c) 2016, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-/**
- * @file
- *
- * ODP packet inline functions
- */
-
-#ifndef ODP_PLAT_PACKET_INLINES_H_
-#define ODP_PLAT_PACKET_INLINES_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef _ODP_INLINES
-
-extern const unsigned int buf_addr_offset;
-extern const unsigned int data_off_offset;
-extern const unsigned int pkt_len_offset;
-extern const unsigned int seg_len_offset;
-extern const unsigned int udata_len_offset;
-extern const unsigned int udata_offset;
-extern const unsigned int rss_offset;
-extern const unsigned int ol_flags_offset;
-extern const uint64_t rss_flag;
-
-#endif /* _ODP_INLINES */
-/*
- * NOTE: These functions are inlined because they are on a performance hot path.
- * As we can't force the application to directly include DPDK headers we have to
- * export these fields through constants calculated compile time in
- * odp_packet.c, where we can see the DPDK definitions.
- *
- */
-_STATIC uint32_t odp_packet_len(odp_packet_t pkt)
-{
-	return *(uint32_t *)(void *)((char *)pkt + pkt_len_offset);
-}
-
-_STATIC uint32_t odp_packet_seg_len(odp_packet_t pkt)
-{
-	return *(uint16_t *)(void *)((char *)pkt + seg_len_offset);
-}
-
-_STATIC void *odp_packet_user_area(odp_packet_t pkt)
-{
-	return (void *)((char *)pkt + udata_offset);
-}
-
-_STATIC uint32_t odp_packet_user_area_size(odp_packet_t pkt)
-{
-	return *(uint32_t *)(void *)((char *)pkt + udata_len_offset);
-}
-
-_STATIC void *odp_packet_data(odp_packet_t pkt)
-{
-	char **buf_addr = (char **)(void *)((char *)pkt + buf_addr_offset);
-	uint16_t data_off = *(uint16_t *)(void *)((char *)pkt + data_off_offset);
-
-	return (void *)(*buf_addr + data_off);
-}
-
-_STATIC uint32_t odp_packet_flow_hash(odp_packet_t pkt)
-{
-	return *(uint32_t *)(void *)((char *)pkt + rss_offset);
-}
-
-_STATIC void odp_packet_flow_hash_set(odp_packet_t pkt, uint32_t flow_hash)
-{
-	*(uint32_t *)(void *)((char *)pkt + rss_offset) = flow_hash;
-	*(uint64_t *)(void *)((char *)pkt + ol_flags_offset) |= rss_flag;
-}
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* ODP_PLAT_PACKET_INLINES_H_ */
diff --git a/platform/linux-dpdk/include/odp/api/plat/atomic_inlines.h b/platform/linux-dpdk/include/odp/api/plat/atomic_inlines.h
new file mode 120000
index 0000000..5ecc5b8
--- /dev/null
+++ b/platform/linux-dpdk/include/odp/api/plat/atomic_inlines.h
@@ -0,0 +1 @@ 
+../../../../../linux-generic/include/odp/api/plat/atomic_inlines.h
\ No newline at end of file
diff --git a/platform/linux-dpdk/include/odp/api/plat/byteorder_inlines.h b/platform/linux-dpdk/include/odp/api/plat/byteorder_inlines.h
new file mode 120000
index 0000000..5f37516
--- /dev/null
+++ b/platform/linux-dpdk/include/odp/api/plat/byteorder_inlines.h
@@ -0,0 +1 @@ 
+../../../../../linux-generic/include/odp/api/plat/byteorder_inlines.h
\ No newline at end of file
diff --git a/platform/linux-dpdk/include/odp/api/plat/inlines.h.in b/platform/linux-dpdk/include/odp/api/plat/inlines.h.in
new file mode 100644
index 0000000..f8020cc
--- /dev/null
+++ b/platform/linux-dpdk/include/odp/api/plat/inlines.h.in
@@ -0,0 +1,32 @@ 
+/* Copyright (c) 2016, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+/**
+ * @file
+ *
+ * ODP packet inline functions
+ */
+
+#ifndef ODP_PLAT_INLINES_H_
+#define ODP_PLAT_INLINES_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define @_ODP_INLINES@
+
+#ifdef _ODP_INLINES
+#define _STATIC static inline
+#else
+#define _STATIC
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* ODP_PLAT_INLINES_H_ */
diff --git a/platform/linux-dpdk/include/odp/api/plat/packet_flags_inlines.h b/platform/linux-dpdk/include/odp/api/plat/packet_flags_inlines.h
new file mode 100644
index 0000000..7d2464e
--- /dev/null
+++ b/platform/linux-dpdk/include/odp/api/plat/packet_flags_inlines.h
@@ -0,0 +1,44 @@ 
+/* Copyright (c) 2016, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+/**
+ * @file
+ *
+ * ODP packet flags inline functions
+ */
+
+#ifndef ODP_PLAT_PACKET_FLAGS_INLINES_H_
+#define ODP_PLAT_PACKET_FLAGS_INLINES_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern const unsigned int ol_flags_offset;
+extern const uint64_t rss_flag;
+
+/*
+ * NOTE: These functions are inlined because they are on a performance hot path.
+ * As we can't force the application to directly include DPDK headers we have to
+ * export these fields through constants calculated compile time in
+ * odp_packet.c, where we can see the DPDK definitions.
+ *
+ */
+_STATIC int odp_packet_has_flow_hash(odp_packet_t pkt)
+{
+	return *(uint64_t *)((char *)pkt + ol_flags_offset) & rss_flag;
+}
+
+_STATIC void odp_packet_has_flow_hash_clr(odp_packet_t pkt)
+{
+	*(uint64_t *)((char *)pkt + ol_flags_offset) &= ~rss_flag;
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* ODP_PLAT_PACKET_FLAGS_INLINES_H_ */
diff --git a/platform/linux-dpdk/include/odp/api/plat/packet_inlines.h b/platform/linux-dpdk/include/odp/api/plat/packet_inlines.h
new file mode 100644
index 0000000..cd403bf
--- /dev/null
+++ b/platform/linux-dpdk/include/odp/api/plat/packet_inlines.h
@@ -0,0 +1,84 @@ 
+/* Copyright (c) 2016, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+/**
+ * @file
+ *
+ * ODP packet inline functions
+ */
+
+#ifndef ODP_PLAT_PACKET_INLINES_H_
+#define ODP_PLAT_PACKET_INLINES_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifdef _ODP_INLINES
+
+extern const unsigned int buf_addr_offset;
+extern const unsigned int data_off_offset;
+extern const unsigned int pkt_len_offset;
+extern const unsigned int seg_len_offset;
+extern const unsigned int udata_len_offset;
+extern const unsigned int udata_offset;
+extern const unsigned int rss_offset;
+extern const unsigned int ol_flags_offset;
+extern const uint64_t rss_flag;
+
+#endif /* _ODP_INLINES */
+/*
+ * NOTE: These functions are inlined because they are on a performance hot path.
+ * As we can't force the application to directly include DPDK headers we have to
+ * export these fields through constants calculated compile time in
+ * odp_packet.c, where we can see the DPDK definitions.
+ *
+ */
+_STATIC uint32_t odp_packet_len(odp_packet_t pkt)
+{
+	return *(uint32_t *)(void *)((char *)pkt + pkt_len_offset);
+}
+
+_STATIC uint32_t odp_packet_seg_len(odp_packet_t pkt)
+{
+	return *(uint16_t *)(void *)((char *)pkt + seg_len_offset);
+}
+
+_STATIC void *odp_packet_user_area(odp_packet_t pkt)
+{
+	return (void *)((char *)pkt + udata_offset);
+}
+
+_STATIC uint32_t odp_packet_user_area_size(odp_packet_t pkt)
+{
+	return *(uint32_t *)(void *)((char *)pkt + udata_len_offset);
+}
+
+_STATIC void *odp_packet_data(odp_packet_t pkt)
+{
+	char **buf_addr = (char **)(void *)((char *)pkt + buf_addr_offset);
+	uint16_t data_off =
+		*(uint16_t *)(void *)((char *)pkt + data_off_offset);
+
+	return (void *)(*buf_addr + data_off);
+}
+
+_STATIC uint32_t odp_packet_flow_hash(odp_packet_t pkt)
+{
+	return *(uint32_t *)(void *)((char *)pkt + rss_offset);
+}
+
+_STATIC void odp_packet_flow_hash_set(odp_packet_t pkt, uint32_t flow_hash)
+{
+	*(uint32_t *)(void *)((char *)pkt + rss_offset) = flow_hash;
+	*(uint64_t *)(void *)((char *)pkt + ol_flags_offset) |= rss_flag;
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* ODP_PLAT_PACKET_INLINES_H_ */
diff --git a/platform/linux-dpdk/include/odp/api/plat/std_clib_inlines.h b/platform/linux-dpdk/include/odp/api/plat/std_clib_inlines.h
new file mode 100644
index 0000000..4b02aba
--- /dev/null
+++ b/platform/linux-dpdk/include/odp/api/plat/std_clib_inlines.h
@@ -0,0 +1,38 @@ 
+/* 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>
+
+extern void* (*const dpdk_memcpy)(void*, const void*, size_t);
+
+_STATIC void *odp_memcpy(void *dst, const void *src, size_t num)
+{
+	return (*dpdk_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
diff --git a/platform/linux-dpdk/include/odp/api/plat/sync_inlines.h b/platform/linux-dpdk/include/odp/api/plat/sync_inlines.h
new file mode 120000
index 0000000..1225fd3
--- /dev/null
+++ b/platform/linux-dpdk/include/odp/api/plat/sync_inlines.h
@@ -0,0 +1 @@ 
+../../../../../linux-generic/include/odp/api/plat/sync_inlines.h
\ No newline at end of file
diff --git a/platform/linux-dpdk/include/odp/api/std_clib.h b/platform/linux-dpdk/include/odp/api/std_clib.h
index 278f708..c498f68 100644
--- a/platform/linux-dpdk/include/odp/api/std_clib.h
+++ b/platform/linux-dpdk/include/odp/api/std_clib.h
@@ -14,22 +14,12 @@  extern "C" {
 #include <odp/api/spec/std_types.h>
 #include <string.h>
 
-extern void* (*const dpdk_memcpy)(void*, const void*, size_t);
-
-static inline void *odp_memcpy(void *dst, const void *src, size_t num)
-{
-	return (*dpdk_memcpy)(dst, src, num);
-}
-
-static inline void *odp_memset(void *ptr, int value, size_t num)
-{
-	return memset(ptr, value, num);
-}
+#include <odp/api/plat/inlines.h>
+#ifdef _ODP_INLINES
+#include <odp/api/plat/std_clib_inlines.h>
+#endif
 
-static inline int odp_memcmp(const void *ptr1, const void *ptr2, size_t num)
-{
-	return memcmp(ptr1, ptr2, num);
-}
+#include <odp/api/spec/std_clib.h>
 
 #ifdef __cplusplus
 }
diff --git a/platform/linux-dpdk/m4/configure.m4 b/platform/linux-dpdk/m4/configure.m4
index 730b6e8..6807de4 100644
--- a/platform/linux-dpdk/m4/configure.m4
+++ b/platform/linux-dpdk/m4/configure.m4
@@ -75,5 +75,5 @@  LDFLAGS=$OLD_LDFLAGS
 CPPFLAGS=$OLD_CPPFLAGS
 
 AC_CONFIG_FILES([platform/linux-dpdk/Makefile
-		 platform/linux-dpdk/include/odp/api/inlines.h])
+		 platform/linux-dpdk/include/odp/api/plat/inlines.h])
 
diff --git a/platform/linux-dpdk/odp_packet.c b/platform/linux-dpdk/odp_packet.c
index b536281..8bd7379 100644
--- a/platform/linux-dpdk/odp_packet.c
+++ b/platform/linux-dpdk/odp_packet.c
@@ -62,7 +62,7 @@  ODP_STATIC_ASSERT(sizeof(dummy.ol_flags) == sizeof(uint64_t),
 		  "ol_flags should be uint64_t");
 
 #ifndef _ODP_INLINES
-#include <odp/api/packet_inlines.h>
+#include <odp/api/plat/packet_inlines.h>
 #endif
 
 /*
diff --git a/platform/linux-dpdk/odp_packet_flags.c b/platform/linux-dpdk/odp_packet_flags.c
index 1c3b503..10d4097 100644
--- a/platform/linux-dpdk/odp_packet_flags.c
+++ b/platform/linux-dpdk/odp_packet_flags.c
@@ -8,7 +8,7 @@ 
 #include <odp_packet_internal.h>
 
 #ifndef _ODP_INLINES
-#include <odp/api/packet_flags_inlines.h>
+#include <odp/api/plat/packet_flags_inlines.h>
 #endif
 
 #define retflag(pkt, x) do {                             \
diff --git a/platform/linux-dpdk/odp_std_clib.c b/platform/linux-dpdk/odp_std_clib.c
index d53dbcf..6e36abc 100644
--- a/platform/linux-dpdk/odp_std_clib.c
+++ b/platform/linux-dpdk/odp_std_clib.c
@@ -10,7 +10,12 @@  extern "C" {
 
 #include <rte_memcpy.h>
 
+#include <odp/api/std_clib.h>
+
+#ifdef _ODP_INLINES
 #include <odp/api/visibility_begin.h>
+#endif
+
 #if defined(__arm__) || defined(__aarch64__)
 static void *_rte_memcpy(void *dst, const void *src, size_t n)
 {
@@ -21,7 +26,12 @@  void* (*const dpdk_memcpy)(void*, const void*, size_t) = &_rte_memcpy;
 #else
 void* (*const dpdk_memcpy)(void*, const void*, size_t) = &rte_memcpy;
 #endif
+
+#ifdef _ODP_INLINES
 #include <odp/api/visibility_end.h>
+#else
+#include <odp/api/plat/std_clib_inlines.h>
+#endif
 
 #ifdef __cplusplus
 }
diff --git a/platform/linux-generic/Makefile.am b/platform/linux-generic/Makefile.am
index 0cfd0fe..ae3cbba 100644
--- a/platform/linux-generic/Makefile.am
+++ b/platform/linux-generic/Makefile.am
@@ -6,6 +6,7 @@  include $(top_srcdir)/platform/@with_platform@/Makefile.inc
 
 AM_CFLAGS +=  -I$(srcdir)/include
 AM_CFLAGS +=  -I$(top_srcdir)/include
+AM_CFLAGS +=  -Iinclude
 
 include_HEADERS = \
 		  $(top_srcdir)/include/odp.h \
@@ -60,15 +61,18 @@  odpapiinclude_HEADERS = \
 
 odpapiplatincludedir= $(includedir)/odp/api/plat
 odpapiplatinclude_HEADERS = \
+		  $(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/inlines.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 \
@@ -79,7 +83,9 @@  odpapiplatinclude_HEADERS = \
 		  $(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_types.h \
@@ -134,6 +140,7 @@  __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 \
@@ -173,6 +180,8 @@  __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 \
diff --git a/platform/linux-generic/include/odp/api/atomic.h b/platform/linux-generic/include/odp/api/atomic.h
index b487383..c18e68b 100644
--- a/platform/linux-generic/include/odp/api/atomic.h
+++ b/platform/linux-generic/include/odp/api/atomic.h
@@ -24,388 +24,10 @@  extern "C" {
  *  @{
  */
 
-static inline void odp_atomic_init_u32(odp_atomic_u32_t *atom, uint32_t val)
-{
-	__atomic_store_n(&atom->v, val, __ATOMIC_RELAXED);
-}
-
-static inline uint32_t odp_atomic_load_u32(odp_atomic_u32_t *atom)
-{
-	return __atomic_load_n(&atom->v, __ATOMIC_RELAXED);
-}
-
-static inline void odp_atomic_store_u32(odp_atomic_u32_t *atom,
-					uint32_t val)
-{
-	__atomic_store_n(&atom->v, val, __ATOMIC_RELAXED);
-}
-
-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);
-}
-
-static inline void odp_atomic_add_u32(odp_atomic_u32_t *atom,
-				      uint32_t val)
-{
-	(void)__atomic_fetch_add(&atom->v, val, __ATOMIC_RELAXED);
-}
-
-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);
-}
-
-static inline void odp_atomic_sub_u32(odp_atomic_u32_t *atom,
-				      uint32_t val)
-{
-	(void)__atomic_fetch_sub(&atom->v, val, __ATOMIC_RELAXED);
-}
-
-static inline uint32_t odp_atomic_fetch_inc_u32(odp_atomic_u32_t *atom)
-{
-	return __atomic_fetch_add(&atom->v, 1, __ATOMIC_RELAXED);
-}
-
-static inline void odp_atomic_inc_u32(odp_atomic_u32_t *atom)
-{
-	(void)__atomic_fetch_add(&atom->v, 1, __ATOMIC_RELAXED);
-}
-
-static inline uint32_t odp_atomic_fetch_dec_u32(odp_atomic_u32_t *atom)
-{
-	return __atomic_fetch_sub(&atom->v, 1, __ATOMIC_RELAXED);
-}
-
-static inline void odp_atomic_dec_u32(odp_atomic_u32_t *atom)
-{
-	(void)__atomic_fetch_sub(&atom->v, 1, __ATOMIC_RELAXED);
-}
-
-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);
-}
-
-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);
-}
-
-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;
-	}
-}
-
-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;
-	}
-}
-
-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
-}
-
-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
-}
-
-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
-}
-
-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
-}
-
-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
-}
-
-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
-}
-
-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
-}
-
-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
-}
-
-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
-}
-
-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);
+#include <odp/api/plat/inlines.h>
+#ifdef _ODP_INLINES
+#include <odp/api/plat/atomic_inlines.h>
 #endif
-}
-
-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
-}
-
-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
-}
-
-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
-}
-
-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;
-	}
-}
-
-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;
-	}
-}
-
-static inline uint32_t odp_atomic_load_acq_u32(odp_atomic_u32_t *atom)
-{
-	return __atomic_load_n(&atom->v, __ATOMIC_ACQUIRE);
-}
-
-static inline void odp_atomic_store_rel_u32(odp_atomic_u32_t *atom,
-					    uint32_t val)
-{
-	__atomic_store_n(&atom->v, val, __ATOMIC_RELEASE);
-}
-
-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);
-}
-
-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);
-}
-
-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);
-}
-
-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);
-}
-
-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);
-}
-
-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
-}
-
-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
-}
-
-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
-}
-
-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
-}
-
-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
-}
-
-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
-}
-
-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
-}
 
 /**
  * @}
diff --git a/platform/linux-generic/include/odp/api/byteorder.h b/platform/linux-generic/include/odp/api/byteorder.h
index c347be0..84d1173 100644
--- a/platform/linux-generic/include/odp/api/byteorder.h
+++ b/platform/linux-generic/include/odp/api/byteorder.h
@@ -17,124 +17,18 @@ 
 extern "C" {
 #endif
 
-#include <odp/api/plat/byteorder_types.h>
 #include <odp/api/std_types.h>
+#include <odp/api/plat/byteorder_types.h>
 #include <odp/api/compiler.h>
 
 /** @ingroup odp_compiler_optim
  *  @{
  */
 
-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
-}
-
-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
-}
-
-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
-}
-
-
-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
-}
-
-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;
+#include <odp/api/plat/inlines.h>
+#ifdef _ODP_INLINES
+#include <odp/api/plat/byteorder_inlines.h>
 #endif
-}
-
-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
-}
-
-
-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
-}
-
-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
-}
-
-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
-}
-
-
-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
-}
-
-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
-}
-
-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
-}
 
 /**
  * @}
diff --git a/platform/linux-generic/include/odp/api/plat/atomic_inlines.h b/platform/linux-generic/include/odp/api/plat/atomic_inlines.h
new file mode 100644
index 0000000..4471f2e
--- /dev/null
+++ b/platform/linux-generic/include/odp/api/plat/atomic_inlines.h
@@ -0,0 +1,385 @@ 
+/* 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
diff --git a/platform/linux-generic/include/odp/api/plat/byteorder_inlines.h b/platform/linux-generic/include/odp/api/plat/byteorder_inlines.h
new file mode 100644
index 0000000..c91a3b1
--- /dev/null
+++ b/platform/linux-generic/include/odp/api/plat/byteorder_inlines.h
@@ -0,0 +1,140 @@ 
+/* 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
diff --git a/platform/linux-generic/include/odp/api/plat/inlines.h.in b/platform/linux-generic/include/odp/api/plat/inlines.h.in
new file mode 100644
index 0000000..5d8c0dc
--- /dev/null
+++ b/platform/linux-generic/include/odp/api/plat/inlines.h.in
@@ -0,0 +1,33 @@ 
+/* Copyright (c) 2016, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+/**
+ * @file
+ *
+ * ODP platform inline functions
+ */
+
+#ifndef ODP_PLAT_INLINES_H_
+#define ODP_PLAT_INLINES_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define @_ODP_INLINES@
+
+#ifdef _ODP_INLINES
+#define _STATIC static inline
+#else
+#define _STATIC
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#endif /* ODP_PLAT_INLINES_H_ */
diff --git a/platform/linux-generic/include/odp/api/plat/std_clib_inlines.h b/platform/linux-generic/include/odp/api/plat/std_clib_inlines.h
new file mode 100644
index 0000000..2e833e4
--- /dev/null
+++ b/platform/linux-generic/include/odp/api/plat/std_clib_inlines.h
@@ -0,0 +1,36 @@ 
+/* 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
diff --git a/platform/linux-generic/include/odp/api/plat/sync_inlines.h b/platform/linux-generic/include/odp/api/plat/sync_inlines.h
new file mode 100644
index 0000000..245c750
--- /dev/null
+++ b/platform/linux-generic/include/odp/api/plat/sync_inlines.h
@@ -0,0 +1,47 @@ 
+/* 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
diff --git a/platform/linux-generic/include/odp/api/std_clib.h b/platform/linux-generic/include/odp/api/std_clib.h
index 40c0ea8..c498f68 100644
--- a/platform/linux-generic/include/odp/api/std_clib.h
+++ b/platform/linux-generic/include/odp/api/std_clib.h
@@ -14,20 +14,12 @@  extern "C" {
 #include <odp/api/spec/std_types.h>
 #include <string.h>
 
-static inline void *odp_memcpy(void *dst, const void *src, size_t num)
-{
-	return memcpy(dst, src, num);
-}
-
-static inline void *odp_memset(void *ptr, int value, size_t num)
-{
-	return memset(ptr, value, num);
-}
+#include <odp/api/plat/inlines.h>
+#ifdef _ODP_INLINES
+#include <odp/api/plat/std_clib_inlines.h>
+#endif
 
-static inline int odp_memcmp(const void *ptr1, const void *ptr2, size_t num)
-{
-	return memcmp(ptr1, ptr2, num);
-}
+#include <odp/api/spec/std_clib.h>
 
 #ifdef __cplusplus
 }
diff --git a/platform/linux-generic/include/odp/api/sync.h b/platform/linux-generic/include/odp/api/sync.h
index 45fe6bd..d2becb9 100644
--- a/platform/linux-generic/include/odp/api/sync.h
+++ b/platform/linux-generic/include/odp/api/sync.h
@@ -21,20 +21,10 @@  extern "C" {
  *  @{
  */
 
-static inline void odp_mb_release(void)
-{
-	__atomic_thread_fence(__ATOMIC_RELEASE);
-}
-
-static inline void odp_mb_acquire(void)
-{
-	__atomic_thread_fence(__ATOMIC_ACQUIRE);
-}
-
-static inline void odp_mb_full(void)
-{
-	__atomic_thread_fence(__ATOMIC_SEQ_CST);
-}
+#include <odp/api/plat/inlines.h>
+#ifdef _ODP_INLINES
+#include <odp/api/plat/sync_inlines.h>
+#endif
 
 /**
  * @}
diff --git a/platform/linux-generic/m4/configure.m4 b/platform/linux-generic/m4/configure.m4
index 1b1b883..6fb05c0 100644
--- a/platform/linux-generic/m4/configure.m4
+++ b/platform/linux-generic/m4/configure.m4
@@ -36,4 +36,5 @@  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])
+AC_CONFIG_FILES([platform/linux-generic/Makefile
+		 platform/linux-generic/include/odp/api/plat/inlines.h])
diff --git a/platform/linux-generic/odp_atomic.c b/platform/linux-generic/odp_atomic.c
index 680e66d..e9a3ed0 100644
--- a/platform/linux-generic/odp_atomic.c
+++ b/platform/linux-generic/odp_atomic.c
@@ -5,6 +5,9 @@ 
  */
 
 #include <odp/api/atomic.h>
+#ifndef _ODP_INLINES
+#include <odp/api/plat/atomic_inlines.h>
+#endif
 
 int odp_atomic_lock_free_u64(odp_atomic_op_t *atomic_op)
 {
diff --git a/platform/linux-generic/odp_byteorder.c b/platform/linux-generic/odp_byteorder.c
new file mode 100644
index 0000000..13a3f0c
--- /dev/null
+++ b/platform/linux-generic/odp_byteorder.c
@@ -0,0 +1,11 @@ 
+/* Copyright (c) 2016, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier:     BSD-3-Clause
+ */
+
+#include <odp/api/byteorder.h>
+#ifndef _ODP_INLINES
+#include <odp/api/plat/byteorder_inlines.h>
+#endif
+
diff --git a/platform/linux-generic/odp_std_clib.c b/platform/linux-generic/odp_std_clib.c
new file mode 100644
index 0000000..7d360af
--- /dev/null
+++ b/platform/linux-generic/odp_std_clib.c
@@ -0,0 +1,11 @@ 
+/* Copyright (c) 2016, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier:     BSD-3-Clause
+ */
+
+#include <odp/api/std_clib.h>
+#ifndef _ODP_INLINES
+#include <odp/api/plat/std_clib_inlines.h>
+#endif
+
diff --git a/platform/linux-generic/odp_sync.c b/platform/linux-generic/odp_sync.c
new file mode 100644
index 0000000..5b99d2d
--- /dev/null
+++ b/platform/linux-generic/odp_sync.c
@@ -0,0 +1,11 @@ 
+/* Copyright (c) 2016, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier:     BSD-3-Clause
+ */
+
+#include <odp/api/sync.h>
+#ifndef _ODP_INLINES
+#include <odp/api/plat/sync_inlines.h>
+#endif
+