diff options
author | Petri Savolainen <petri.savolainen@linaro.org> | 2014-06-24 17:05:47 +0300 |
---|---|---|
committer | Maxim Uvarov <maxim.uvarov@linaro.org> | 2014-06-26 21:41:29 +0400 |
commit | 0e683f99047f78f78202b2bc54326c4a500e86ab (patch) | |
tree | 8b6fa196a244883e38f30e1e7b3c0a102646816a /test | |
parent | 9b8a4bbc3b230857a0d782fa25acf74f6b4e967d (diff) |
Timer test uses timeout buffer
Timer test modified to use the timeout buffer type.
Signed-off-by: Petri Savolainen <petri.savolainen@linaro.org>
Diffstat (limited to 'test')
-rw-r--r-- | test/timer/odp_timer_test.c | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/test/timer/odp_timer_test.c b/test/timer/odp_timer_test.c index 341265de..b4ef9888 100644 --- a/test/timer/odp_timer_test.c +++ b/test/timer/odp_timer_test.c @@ -26,15 +26,6 @@ #define MAX_WORKERS 32 /**< Max worker threads */ #define MSG_POOL_SIZE (4*1024*1024) /**< Message pool size */ -/** Dummy message */ -typedef struct { - int msg_id; /**< Message ID */ - int seq; /**< Sequence number */ -} test_message_t; - -#define MSG_HELLO 1 /**< Hello */ -#define MSG_ACK 2 /**< Ack */ - /** Test arguments */ typedef struct { int core_count; /**< Core count*/ @@ -70,10 +61,12 @@ static void test_timeouts(int thr) ODP_DBG(" [%i] current tick %"PRIu64"\n", thr, tick); while (1) { + odp_timeout_t tmo; + buf = odp_schedule_one(&queue, ODP_SCHED_WAIT); - /* TODO: read tick from tmo metadata */ - tick = odp_timer_current_tick(test_timer); + tmo = odp_timeout_from_buffer(buf); + tick = odp_timeout_tick(tmo); ODP_DBG(" [%i] timeout, tick %"PRIu64"\n", thr, tick); @@ -270,8 +263,9 @@ int main(int argc, char *argv[]) MSG_POOL_SIZE, ODP_CACHE_LINE_SIZE); pool = odp_buffer_pool_create("msg_pool", pool_base, MSG_POOL_SIZE, - sizeof(test_message_t), - ODP_CACHE_LINE_SIZE, ODP_BUFFER_TYPE_RAW); + 0, + ODP_CACHE_LINE_SIZE, + ODP_BUFFER_TYPE_TIMEOUT); if (pool == ODP_BUFFER_POOL_INVALID) { ODP_ERR("Pool create failed.\n"); |