diff options
author | Venkatesh Vivekanandan <venkatesh.vivekanandan@linaro.org> | 2015-02-27 15:31:59 +0530 |
---|---|---|
committer | Venkatesh Vivekanandan <venkatesh.vivekanandan@linaro.org> | 2015-02-27 15:31:59 +0530 |
commit | cbd0f513c66e69e5d7c8669e4aa823c082a3a40c (patch) | |
tree | 9c0bd14ca5df72b3f423c4ed506f9319fbbb717b | |
parent | 28f444498e5f54a79d4d1b4f7e6094b23f185331 (diff) |
Changes to compile odp-dpdkodp-0.6WIP
Signed-off-by: Venkatesh Vivekanandan <venkatesh.vivekanandan@linaro.org>
-rw-r--r-- | platform/linux-dpdk/include/api/odp_debug.h | 88 | ||||
-rw-r--r-- | platform/linux-dpdk/odp_packet.c | 1 |
2 files changed, 88 insertions, 1 deletions
diff --git a/platform/linux-dpdk/include/api/odp_debug.h b/platform/linux-dpdk/include/api/odp_debug.h new file mode 100644 index 000000000..bded9e1ed --- /dev/null +++ b/platform/linux-dpdk/include/api/odp_debug.h @@ -0,0 +1,88 @@ +/* Copyright (c) 2013, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ +/** + * @file + * + * ODP debug + */ + +#ifndef ODP_DEBUG_H_ +#define ODP_DEBUG_H_ + + +#ifdef __cplusplus +extern "C" { +#endif + +/** @addtogroup odp_ver_abt_log_dbg + * Macros that allows different messages. + * @{ + */ + +#ifdef __GNUC__ + + +#if __GNUC__ < 4 || (__GNUC__ == 4 && (__GNUC_MINOR__ < 6)) + +/** + * _Static_assert was only added in GCC 4.6. Provide a weak replacement + * for previous versions. + */ +#define _Static_assert(e, s) extern int (*static_assert_checker (void)) \ + [sizeof (struct { unsigned int error_if_negative: (e) ? 1 : -1; })] + +#endif + + + +#endif + + +/** + * Compile time assertion-macro - fail compilation if cond is false. + * @note This macro has zero runtime overhead + */ +#define _ODP_STATIC_ASSERT(cond, msg) _Static_assert(1, msg) + +/** + * ODP log level. + */ +typedef enum odp_log_level { + ODP_LOG_DBG, + ODP_LOG_ERR, + ODP_LOG_UNIMPLEMENTED, + ODP_LOG_ABORT, + ODP_LOG_PRINT +} odp_log_level_e; + +/** + * ODP log function + * + * Instead of direct prints to stdout/stderr all logging in ODP implementation + * should be done via this function or its wrappers. + * ODP platform MUST provide a default *weak* implementation of this function. + * Application MAY override the function if needed by providing a strong + * function. + * + * @param[in] level Log level + * @param[in] fmt printf-style message format + * + * @return The number of characters logged if succeeded. Otherwise returns + * a negative number. + */ +extern int odp_override_log(odp_log_level_e level, const char *fmt, ...); + + + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/platform/linux-dpdk/odp_packet.c b/platform/linux-dpdk/odp_packet.c index 8ef0a9f84..895974e02 100644 --- a/platform/linux-dpdk/odp_packet.c +++ b/platform/linux-dpdk/odp_packet.c @@ -148,7 +148,6 @@ uint32_t odp_packet_l2_offset(odp_packet_t pkt) int odp_packet_l2_offset_set(odp_packet_t pkt, uint32_t offset) { - struct rte_mbuf *mb = &(odp_packet_hdr(pkt)->buf_hdr.mb); if (odp_unlikely(offset == ODP_PACKET_OFFSET_INVALID)) return -1; odp_packet_hdr(pkt)->l2_offset = offset; |