aboutsummaryrefslogtreecommitdiff
path: root/include/odp/api/abi-default/byteorder.h
diff options
context:
space:
mode:
authorDmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org>2017-11-23 01:40:14 +0300
committerMaxim Uvarov <maxim.uvarov@linaro.org>2018-01-18 22:07:23 +0300
commitd70c5f1ce3e98c3a7409312ccfdc3ce0087a2d49 (patch)
tree07b55518e58b84552e6509f4d28a8facb90cc3fb /include/odp/api/abi-default/byteorder.h
parent47932d20fdf72f73e5de4961569fda760200edc6 (diff)
linux-gen, include: switch byteorder.h to api+abi
Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org> Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Diffstat (limited to 'include/odp/api/abi-default/byteorder.h')
-rw-r--r--include/odp/api/abi-default/byteorder.h73
1 files changed, 73 insertions, 0 deletions
diff --git a/include/odp/api/abi-default/byteorder.h b/include/odp/api/abi-default/byteorder.h
new file mode 100644
index 000000000..92f9743ad
--- /dev/null
+++ b/include/odp/api/abi-default/byteorder.h
@@ -0,0 +1,73 @@
+/* Copyright (c) 2015, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+/**
+ * @file
+ *
+ * ODP byteorder
+ */
+
+#ifndef ODP_ABI_BYTEORDER_H_
+#define ODP_ABI_BYTEORDER_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <odp/api/std_types.h>
+
+#ifndef __BYTE_ORDER__
+#error __BYTE_ORDER__ not defined!
+#endif
+
+#ifndef __ORDER_BIG_ENDIAN__
+#error __ORDER_BIG_ENDIAN__ not defined!
+#endif
+
+#ifndef __ORDER_LITTLE_ENDIAN__
+#error __ORDER_LITTLE_ENDIAN__ not defined!
+#endif
+
+/** @addtogroup odp_compiler_optim
+ * @{
+ */
+#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
+ #define ODP_LITTLE_ENDIAN 1
+ #define ODP_BIG_ENDIAN 0
+ #define ODP_BYTE_ORDER ODP_LITTLE_ENDIAN
+ #define ODP_LITTLE_ENDIAN_BITFIELD 1
+ #define ODP_BIG_ENDIAN_BITFIELD 0
+ #define ODP_BITFIELD_ORDER ODP_LITTLE_ENDIAN_BITFIELD
+#else
+ #define ODP_LITTLE_ENDIAN 0
+ #define ODP_BIG_ENDIAN 1
+ #define ODP_BYTE_ORDER ODP_BIG_ENDIAN
+ #define ODP_LITTLE_ENDIAN_BITFIELD 0
+ #define ODP_BIG_ENDIAN_BITFIELD 1
+ #define ODP_BITFIELD_ORDER ODP_BIG_ENDIAN_BITFIELD
+#endif
+
+typedef uint16_t odp_u16le_t;
+typedef uint16_t odp_u16be_t;
+
+typedef uint32_t odp_u32le_t;
+typedef uint32_t odp_u32be_t;
+
+typedef uint64_t odp_u64le_t;
+typedef uint64_t odp_u64be_t;
+
+typedef uint16_t odp_u16sum_t;
+typedef uint32_t odp_u32sum_t;
+
+/**
+ * @}
+ */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif