diff options
author | Matias Elo <matias.elo@nokia.com> | 2018-07-25 16:34:03 +0300 |
---|---|---|
committer | Maxim Uvarov <maxim.uvarov@linaro.org> | 2018-07-27 11:06:30 +0300 |
commit | 67acf499acbfb34d9c7dde2bc556db0eb76fb187 (patch) | |
tree | f6806273fedb6cab83c97a5900a63d0730d3aa3a | |
parent | 0c50e841113cc76f9b32534ed2c695c36f07daf4 (diff) |
linux-dpdk: byteorder: implement using dpdk functionsv1.19.0.2_DPDK_17.11
Signed-off-by: Matias Elo <matias.elo@nokia.com>
Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
-rw-r--r--[l---------] | platform/linux-dpdk/include/odp/api/plat/byteorder_inlines.h | 115 |
1 files changed, 114 insertions, 1 deletions
diff --git a/platform/linux-dpdk/include/odp/api/plat/byteorder_inlines.h b/platform/linux-dpdk/include/odp/api/plat/byteorder_inlines.h index 5f3751602..c402189a5 120000..100644 --- a/platform/linux-dpdk/include/odp/api/plat/byteorder_inlines.h +++ b/platform/linux-dpdk/include/odp/api/plat/byteorder_inlines.h @@ -1 +1,114 @@ -../../../../../linux-generic/include/odp/api/plat/byteorder_inlines.h
\ No newline at end of file +/* Copyright (c) 2018, 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 + +#include <rte_config.h> +#include <rte_byteorder.h> + +/** @cond _ODP_HIDE_FROM_DOXYGEN_ */ + +#ifndef __odp_force +#define __odp_force +#endif + +#ifndef _ODP_NO_INLINE + /* Inline functions by default */ + #define _ODP_INLINE static inline + #define odp_be_to_cpu_16 __odp_be_to_cpu_16 + #define odp_be_to_cpu_32 __odp_be_to_cpu_32 + #define odp_be_to_cpu_64 __odp_be_to_cpu_64 + #define odp_cpu_to_be_16 __odp_cpu_to_be_16 + #define odp_cpu_to_be_32 __odp_cpu_to_be_32 + #define odp_cpu_to_be_64 __odp_cpu_to_be_64 + #define odp_le_to_cpu_16 __odp_le_to_cpu_16 + #define odp_le_to_cpu_32 __odp_le_to_cpu_32 + #define odp_le_to_cpu_64 __odp_le_to_cpu_64 + #define odp_cpu_to_le_16 __odp_cpu_to_le_16 + #define odp_cpu_to_le_32 __odp_cpu_to_le_32 + #define odp_cpu_to_le_64 __odp_cpu_to_le_64 +#else + #define _ODP_INLINE +#endif + +_ODP_INLINE uint16_t odp_be_to_cpu_16(odp_u16be_t be16) +{ + return rte_be_to_cpu_16((__odp_force uint16_t)be16); +} + +_ODP_INLINE uint32_t odp_be_to_cpu_32(odp_u32be_t be32) +{ + return rte_be_to_cpu_32((__odp_force uint32_t)be32); +} + +_ODP_INLINE uint64_t odp_be_to_cpu_64(odp_u64be_t be64) +{ + return rte_be_to_cpu_64((__odp_force uint64_t)be64); +} + +_ODP_INLINE odp_u16be_t odp_cpu_to_be_16(uint16_t cpu16) +{ + return (__odp_force odp_u16be_t)rte_cpu_to_be_16(cpu16); +} + +_ODP_INLINE odp_u32be_t odp_cpu_to_be_32(uint32_t cpu32) +{ + return (__odp_force odp_u32be_t)rte_cpu_to_be_32(cpu32); +} + +_ODP_INLINE odp_u64be_t odp_cpu_to_be_64(uint64_t cpu64) +{ + return (__odp_force odp_u64be_t)rte_cpu_to_be_64(cpu64); +} + +_ODP_INLINE uint16_t odp_le_to_cpu_16(odp_u16le_t le16) +{ + return rte_le_to_cpu_16((__odp_force uint16_t)le16); +} + +_ODP_INLINE uint32_t odp_le_to_cpu_32(odp_u32le_t le32) +{ + return rte_le_to_cpu_32((__odp_force uint32_t)le32); +} + +_ODP_INLINE uint64_t odp_le_to_cpu_64(odp_u64le_t le64) +{ + return rte_le_to_cpu_64((__odp_force uint64_t)le64); +} + +_ODP_INLINE odp_u16le_t odp_cpu_to_le_16(uint16_t cpu16) +{ + return (__odp_force odp_u16le_t)rte_cpu_to_le_16(cpu16); +} + +_ODP_INLINE odp_u32le_t odp_cpu_to_le_32(uint32_t cpu32) +{ + return (__odp_force odp_u32le_t)rte_cpu_to_le_32(cpu32); +} + +_ODP_INLINE odp_u64le_t odp_cpu_to_le_64(uint64_t cpu64) +{ + return (__odp_force odp_u64le_t)rte_cpu_to_le_64(cpu64); +} + +/** @endcond */ + +#ifdef __cplusplus +} +#endif + +#endif |