Signed-off-by: Mike Holmes <[email protected]>
---
platform/linux-generic/include/api/odp_debug.h | 7 +++++--
platform/linux-generic/odp_buffer_pool.c | 5 -----
platform/linux-generic/odp_time.c | 1 -
3 files changed, 5 insertions(+), 8 deletions(-)
diff --git a/platform/linux-generic/include/api/odp_debug.h
b/platform/linux-generic/include/api/odp_debug.h
index e8f6003..692a6b2 100644
--- a/platform/linux-generic/include/api/odp_debug.h
+++ b/platform/linux-generic/include/api/odp_debug.h
@@ -13,6 +13,7 @@
#define ODP_DEBUG_H_
#include <stdio.h>
+#include <stdlib.h>
#ifdef __cplusplus
extern "C" {
@@ -76,8 +77,10 @@ extern "C" {
* Print output to stderr (file, line and function).
*/
#define ODP_ERR(fmt, ...) \
- fprintf(stderr, "%s:%d:%s(): " fmt, __FILE__, \
- __LINE__, __func__, ##__VA_ARGS__)
+do { fprintf(stderr, "%s:%d:%s(): " fmt, __FILE__, \
+ __LINE__, __func__, ##__VA_ARGS__); \
+ abort(); \
+} while (0)
#ifdef __cplusplus
}
diff --git a/platform/linux-generic/odp_buffer_pool.c
b/platform/linux-generic/odp_buffer_pool.c
index f54a0c4..b88cf88 100644
--- a/platform/linux-generic/odp_buffer_pool.c
+++ b/platform/linux-generic/odp_buffer_pool.c
@@ -100,7 +100,6 @@ static inline void set_handle(odp_buffer_hdr_t *hdr,
if (pool_id >= ODP_CONFIG_BUFFER_POOLS) {
ODP_ERR("set_handle: Bad pool handle %u\n", pool_hdl);
- exit(0);
}
if (index > ODP_BUFFER_MAX_INDEX)
@@ -220,13 +219,11 @@ static void check_align(pool_entry_t *pool,
odp_buffer_hdr_t *hdr)
if (!ODP_ALIGNED_CHECK_POWER_2(hdr->addr, pool->s.user_align)) {
ODP_ERR("check_align: user data align error %p, align %zu\n",
hdr->addr, pool->s.user_align);
- exit(0);
}
if (!ODP_ALIGNED_CHECK_POWER_2(hdr, ODP_CACHE_LINE_SIZE)) {
ODP_ERR("check_align: hdr align error %p, align %i\n",
hdr, ODP_CACHE_LINE_SIZE);
- exit(0);
}
}
@@ -265,7 +262,6 @@ static void fill_hdr(void *ptr, pool_entry_t *pool,
uint32_t index,
break;
default:
ODP_ERR("Bad buffer type\n");
- exit(0);
}
memset(hdr, 0, size);
@@ -313,7 +309,6 @@ static void link_bufs(pool_entry_t *pool)
hdr_size = sizeof(odp_any_buffer_hdr_t);
} else {
ODP_ERR("odp_buffer_pool_create: Bad type %i\n", buf_type);
- exit(0);
}
/* Chunk must fit into buffer data area.*/
diff --git a/platform/linux-generic/odp_time.c
b/platform/linux-generic/odp_time.c
index 181294a..b4b8650 100644
--- a/platform/linux-generic/odp_time.c
+++ b/platform/linux-generic/odp_time.c
@@ -60,7 +60,6 @@ uint64_t odp_time_get_cycles(void)
if (ret != 0) {
ODP_ERR("clock_gettime failed\n");
- exit(EXIT_FAILURE);
}
hz = odp_sys_cpu_hz();
--
1.9.1
_______________________________________________
lng-odp mailing list
[email protected]
http://lists.linaro.org/mailman/listinfo/lng-odp