aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPetri Savolainen <petri.savolainen@nokia.com>2016-07-04 18:42:24 +0300
committerMaxim Uvarov <maxim.uvarov@linaro.org>2016-07-05 15:09:24 +0300
commitc2784fbafbf8a29b6daa48429133e25b777536cf (patch)
treef1516b0e07f7b86c86ffe767d58d26bb441a6c12
parent9f0f2b86309aa8021ec937e7c0ee1d6f48b0d769 (diff)
linux-gen: byteorder: remove dependency to linux headers
Platform specific API files included endian.h and asm/byteorder.h. These are Linux headers and should not be visible to application through odp_api.h. Used __ORDER_LITTLE_ENDIAN__, etc instead which are supported by both gcc and clang. Signed-off-by: Petri Savolainen <petri.savolainen@nokia.com> Reviewed-and-tested-by: Bill Fischofer <bill.fischofer@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
-rw-r--r--platform/linux-generic/include/odp/api/plat/byteorder_types.h33
-rw-r--r--platform/linux-generic/include/odp/api/std_types.h2
2 files changed, 13 insertions, 22 deletions
diff --git a/platform/linux-generic/include/odp/api/plat/byteorder_types.h b/platform/linux-generic/include/odp/api/plat/byteorder_types.h
index 0a8e4096e..679d4cf92 100644
--- a/platform/linux-generic/include/odp/api/plat/byteorder_types.h
+++ b/platform/linux-generic/include/odp/api/plat/byteorder_types.h
@@ -18,15 +18,15 @@
extern "C" {
#endif
-#ifndef __BYTE_ORDER
+#ifndef __BYTE_ORDER__
#error __BYTE_ORDER not defined!
#endif
-#ifndef __BIG_ENDIAN
+#ifndef __ORDER_BIG_ENDIAN__
#error __BIG_ENDIAN not defined!
#endif
-#ifndef __LITTLE_ENDIAN
+#ifndef __ORDER_LITTLE_ENDIAN__
#error __LITTLE_ENDIAN not defined!
#endif
@@ -48,23 +48,16 @@ extern "C" {
/** @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
+#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
+ #define ODP_LITTLE_ENDIAN 1
+ #define ODP_BIG_ENDIAN 0
+ #define ODP_BYTE_ORDER ODP_LITTLE_ENDIAN
+ #define ODP_LITTLE_ENDIAN_BITFIELD
+#else
+ #define ODP_LITTLE_ENDIAN 0
+ #define ODP_BIG_ENDIAN 1
+ #define ODP_BYTE_ORDER ODP_BIG_ENDIAN
+ #define ODP_BIG_ENDIAN_BITFIELD
#endif
typedef uint16_t __odp_bitwise odp_u16le_t;
diff --git a/platform/linux-generic/include/odp/api/std_types.h b/platform/linux-generic/include/odp/api/std_types.h
index 5737e43b2..d4eeb5d55 100644
--- a/platform/linux-generic/include/odp/api/std_types.h
+++ b/platform/linux-generic/include/odp/api/std_types.h
@@ -17,8 +17,6 @@
extern "C" {
#endif
-#include <endian.h>
-#include <asm/byteorder.h>
#include <stdlib.h>
#include <stdint.h>
#include <stddef.h>