This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "".
The branch, master has been updated via 5a2376365df984e160b92463be37740786a10bd6 (commit) via 3f3d7651c7cd7ba3b941904bbcbdabcac9a7dfd0 (commit) via 72a4e9f9bad9dfeaafba4e29a7450ee7edca5d1c (commit) via 7f3624154ff59ab85352c35e1c6df3c9597f9f51 (commit) from bbefeae66a2a6ac6c9386bb8a083022b7f323fc9 (commit)
Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below.
- Log ----------------------------------------------------------------- commit 5a2376365df984e160b92463be37740786a10bd6 Author: Maxim Uvarov maxim.uvarov@linaro.org Date: Tue Oct 3 20:16:05 2017 +0300
linux-gen: timer: drop odp prefix from odp_timer_s
Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org Reviewed-by: Bill Fischofer bill.fischofer@linaro.org
diff --git a/platform/linux-generic/odp_timer.c b/platform/linux-generic/odp_timer.c index 8b816678..70a9c97b 100644 --- a/platform/linux-generic/odp_timer.c +++ b/platform/linux-generic/odp_timer.c @@ -116,15 +116,15 @@ ODP_ALIGNED(16) /* 16-byte atomic operations need properly aligned addresses */ ODP_STATIC_ASSERT(sizeof(tick_buf_t) == 16, "sizeof(tick_buf_t) == 16"); #endif
-typedef struct odp_timer_s { +typedef struct { void *user_ptr; odp_queue_t queue;/* Used for free list when timer is free */ -} odp_timer; +} _odp_timer_t;
-static void timer_init(odp_timer *tim, - tick_buf_t *tb, - odp_queue_t _q, - void *_up) +static void timer_init(_odp_timer_t *tim, + tick_buf_t *tb, + odp_queue_t _q, + void *_up) { tim->queue = _q; tim->user_ptr = _up; @@ -140,7 +140,7 @@ static void timer_init(odp_timer *tim, }
/* Teardown when timer is freed */ -static void timer_fini(odp_timer *tim, tick_buf_t *tb) +static void timer_fini(_odp_timer_t *tim, tick_buf_t *tb) { ODP_ASSERT(tb->exp_tck.v == TMO_UNUSED); ODP_ASSERT(tb->tmo_buf == ODP_BUFFER_INVALID); @@ -148,13 +148,13 @@ static void timer_fini(odp_timer *tim, tick_buf_t *tb) tim->user_ptr = NULL; }
-static inline uint32_t get_next_free(odp_timer *tim) +static inline uint32_t get_next_free(_odp_timer_t *tim) { /* Reusing 'queue' for next free index */ return _odp_typeval(tim->queue); }
-static inline void set_next_free(odp_timer *tim, uint32_t nf) +static inline void set_next_free(_odp_timer_t *tim, uint32_t nf) { ODP_ASSERT(tim->queue == ODP_QUEUE_INVALID); /* Reusing 'queue' for next free index */ @@ -172,7 +172,7 @@ typedef struct timer_pool_s { uint64_t min_rel_tck; uint64_t max_rel_tck; tick_buf_t *tick_buf; /* Expiration tick and timeout buffer */ - odp_timer *timers; /* User pointer and queue handle (and lock) */ + _odp_timer_t *timers; /* User pointer and queue handle (and lock) */ odp_atomic_u32_t high_wm;/* High watermark of allocated timers */ odp_spinlock_t lock; uint32_t num_alloc;/* Current number of allocated timers */ @@ -237,7 +237,8 @@ static odp_timer_pool_t timer_pool_new(const char *name, } size_t sz0 = ROUNDUP_CACHE_LINE(sizeof(timer_pool_t)); size_t sz1 = ROUNDUP_CACHE_LINE(sizeof(tick_buf_t) * param->num_timers); - size_t sz2 = ROUNDUP_CACHE_LINE(sizeof(odp_timer) * param->num_timers); + size_t sz2 = ROUNDUP_CACHE_LINE(sizeof(_odp_timer_t) * + param->num_timers); odp_shm_t shm = odp_shm_reserve(name, sz0 + sz1 + sz2, ODP_CACHE_LINE_SIZE, ODP_SHM_SW_ONLY); if (odp_unlikely(shm == ODP_SHM_INVALID)) @@ -337,7 +338,7 @@ static inline odp_timer_t timer_alloc(timer_pool_t *tp, /* Remove first unused timer from free list */ ODP_ASSERT(tp->first_free != tp->param.num_timers); uint32_t idx = tp->first_free; - odp_timer *tim = &tp->timers[idx]; + _odp_timer_t *tim = &tp->timers[idx]; tp->first_free = get_next_free(tim); /* Initialize timer */ timer_init(tim, &tp->tick_buf[idx], queue, user_ptr); @@ -363,7 +364,7 @@ static odp_buffer_t timer_cancel(timer_pool_t *tp,
static inline odp_buffer_t timer_free(timer_pool_t *tp, uint32_t idx) { - odp_timer *tim = &tp->timers[idx]; + _odp_timer_t *tim = &tp->timers[idx];
/* Free the timer by setting timer state to unused and * grab any timeout buffer */ @@ -563,7 +564,7 @@ static odp_buffer_t timer_cancel(timer_pool_t *tp,
static unsigned timer_expire(timer_pool_t *tp, uint32_t idx, uint64_t tick) { - odp_timer *tim = &tp->timers[idx]; + _odp_timer_t *tim = &tp->timers[idx]; tick_buf_t *tb = &tp->tick_buf[idx]; odp_buffer_t tmo_buf = ODP_BUFFER_INVALID; uint64_t exp_tck; @@ -691,7 +692,7 @@ static void timer_notify(timer_pool_t *tp) } }
- odp_timer *array = &tp->timers[0]; + _odp_timer_t *array = &tp->timers[0]; uint32_t i; /* Prefetch initial cache lines (match 32 above) */ for (i = 0; i < 32; i += ODP_CACHE_LINE_SIZE / sizeof(array[0]))
commit 3f3d7651c7cd7ba3b941904bbcbdabcac9a7dfd0 Author: Maxim Uvarov maxim.uvarov@linaro.org Date: Tue Oct 3 20:06:32 2017 +0300
linux-gen: timer: drop odp prefix from odp_timer_pool_s
internal structure should not be named with odp_. Also make code a little bit more consistent to pass type instead of struct to 2 more functions.
Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org Reviewed-by: Bill Fischofer bill.fischofer@linaro.org
diff --git a/platform/linux-generic/include/odp/api/plat/timer_types.h b/platform/linux-generic/include/odp/api/plat/timer_types.h index a8891f11..9605d584 100644 --- a/platform/linux-generic/include/odp/api/plat/timer_types.h +++ b/platform/linux-generic/include/odp/api/plat/timer_types.h @@ -24,9 +24,9 @@ extern "C" { * @{ **/
-struct odp_timer_pool_s; /**< Forward declaration */ +struct timer_pool_s; /**< Forward declaration */
-typedef struct odp_timer_pool_s *odp_timer_pool_t; +typedef struct timer_pool_s *odp_timer_pool_t;
#define ODP_TIMER_POOL_INVALID NULL
diff --git a/platform/linux-generic/odp_timer.c b/platform/linux-generic/odp_timer.c index 977385a7..8b816678 100644 --- a/platform/linux-generic/odp_timer.c +++ b/platform/linux-generic/odp_timer.c @@ -166,7 +166,7 @@ static inline void set_next_free(odp_timer *tim, uint32_t nf) * Inludes alloc and free timer *****************************************************************************/
-typedef struct odp_timer_pool_s { +typedef struct timer_pool_s { /* Put frequently accessed fields in the first cache line */ odp_atomic_u64_t cur_tick;/* Current tick value */ uint64_t min_rel_tck; @@ -205,7 +205,7 @@ static inline timer_pool_t *handle_to_tp(odp_timer_t hdl) }
static inline uint32_t handle_to_idx(odp_timer_t hdl, - struct odp_timer_pool_s *tp) + timer_pool_t *tp) { uint32_t idx = _odp_typeval(hdl) & ((1U << INDEX_BITS) - 1U); __builtin_prefetch(&tp->tick_buf[idx], 0, 0); @@ -214,8 +214,8 @@ static inline uint32_t handle_to_idx(odp_timer_t hdl, ODP_ABORT("Invalid timer handle %#x\n", hdl); }
-static inline odp_timer_t tp_idx_to_handle(struct odp_timer_pool_s *tp, - uint32_t idx) +static inline odp_timer_t tp_idx_to_handle(timer_pool_t *tp, + uint32_t idx) { ODP_ASSERT(idx < (1U << INDEX_BITS)); return _odp_cast_scalar(odp_timer_t, (tp->tp_idx << INDEX_BITS) | idx);
commit 72a4e9f9bad9dfeaafba4e29a7450ee7edca5d1c Author: Maxim Uvarov maxim.uvarov@linaro.org Date: Tue Oct 3 19:48:41 2017 +0300
linux-gen: timer: drop odp prefix from odp_timer_pool
internal data type should not be named with odp api prefix.
Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org Reviewed-by: Bill Fischofer bill.fischofer@linaro.org
diff --git a/platform/linux-generic/odp_timer.c b/platform/linux-generic/odp_timer.c index 0a4fbb7e..977385a7 100644 --- a/platform/linux-generic/odp_timer.c +++ b/platform/linux-generic/odp_timer.c @@ -162,7 +162,7 @@ static inline void set_next_free(odp_timer *tim, uint32_t nf) }
/****************************************************************************** - * odp_timer_pool abstract datatype + * timer_pool_t abstract datatype * Inludes alloc and free timer *****************************************************************************/
@@ -186,18 +186,18 @@ typedef struct odp_timer_pool_s { pthread_t timer_thread; /* pthread_t of timer thread */ pid_t timer_thread_id; /* gettid() for timer thread */ int timer_thread_exit; /* request to exit for timer thread */ -} odp_timer_pool; +} timer_pool_t;
#define MAX_TIMER_POOLS 255 /* Leave one for ODP_TIMER_INVALID */ #define INDEX_BITS 24 static odp_atomic_u32_t num_timer_pools; -static odp_timer_pool *timer_pool[MAX_TIMER_POOLS]; +static timer_pool_t *timer_pool[MAX_TIMER_POOLS];
-static inline odp_timer_pool *handle_to_tp(odp_timer_t hdl) +static inline timer_pool_t *handle_to_tp(odp_timer_t hdl) { uint32_t tp_idx = _odp_typeval(hdl) >> INDEX_BITS; if (odp_likely(tp_idx < MAX_TIMER_POOLS)) { - odp_timer_pool *tp = timer_pool[tp_idx]; + timer_pool_t *tp = timer_pool[tp_idx]; if (odp_likely(tp != NULL)) return timer_pool[tp_idx]; } @@ -222,8 +222,8 @@ static inline odp_timer_t tp_idx_to_handle(struct odp_timer_pool_s *tp, }
/* Forward declarations */ -static void itimer_init(odp_timer_pool *tp); -static void itimer_fini(odp_timer_pool *tp); +static void itimer_init(timer_pool_t *tp); +static void itimer_fini(timer_pool_t *tp);
static odp_timer_pool_t timer_pool_new(const char *name, const odp_timer_pool_param_t *param) @@ -235,7 +235,7 @@ static odp_timer_pool_t timer_pool_new(const char *name, __odp_errno = ENFILE; /* Table overflow */ return ODP_TIMER_POOL_INVALID; } - size_t sz0 = ROUNDUP_CACHE_LINE(sizeof(odp_timer_pool)); + size_t sz0 = ROUNDUP_CACHE_LINE(sizeof(timer_pool_t)); size_t sz1 = ROUNDUP_CACHE_LINE(sizeof(tick_buf_t) * param->num_timers); size_t sz2 = ROUNDUP_CACHE_LINE(sizeof(odp_timer) * param->num_timers); odp_shm_t shm = odp_shm_reserve(name, sz0 + sz1 + sz2, @@ -243,7 +243,7 @@ static odp_timer_pool_t timer_pool_new(const char *name, if (odp_unlikely(shm == ODP_SHM_INVALID)) ODP_ABORT("%s: timer pool shm-alloc(%zuKB) failed\n", name, (sz0 + sz1 + sz2) / 1024); - odp_timer_pool *tp = (odp_timer_pool *)odp_shm_addr(shm); + timer_pool_t *tp = (timer_pool_t *)odp_shm_addr(shm); odp_atomic_init_u64(&tp->cur_tick, 0);
if (name == NULL) { @@ -292,7 +292,7 @@ static void block_sigalarm(void) sigprocmask(SIG_BLOCK, &sigset, NULL); }
-static void stop_timer_thread(odp_timer_pool *tp) +static void stop_timer_thread(timer_pool_t *tp) { int ret;
@@ -303,7 +303,7 @@ static void stop_timer_thread(odp_timer_pool *tp) ODP_ABORT("unable to join thread, err %d\n", ret); }
-static void odp_timer_pool_del(odp_timer_pool *tp) +static void odp_timer_pool_del(timer_pool_t *tp) { odp_spinlock_lock(&tp->lock); timer_pool[tp->tp_idx] = NULL; @@ -326,7 +326,7 @@ static void odp_timer_pool_del(odp_timer_pool *tp) odp_atomic_sub_u32(&num_timer_pools, 1); }
-static inline odp_timer_t timer_alloc(odp_timer_pool *tp, +static inline odp_timer_t timer_alloc(timer_pool_t *tp, odp_queue_t queue, void *user_ptr) { @@ -357,11 +357,11 @@ static inline odp_timer_t timer_alloc(odp_timer_pool *tp, return hdl; }
-static odp_buffer_t timer_cancel(odp_timer_pool *tp, - uint32_t idx, - uint64_t new_state); +static odp_buffer_t timer_cancel(timer_pool_t *tp, + uint32_t idx, + uint64_t new_state);
-static inline odp_buffer_t timer_free(odp_timer_pool *tp, uint32_t idx) +static inline odp_buffer_t timer_free(timer_pool_t *tp, uint32_t idx) { odp_timer *tim = &tp->timers[idx];
@@ -391,7 +391,7 @@ static inline odp_buffer_t timer_free(odp_timer_pool *tp, uint32_t idx) static bool timer_reset(uint32_t idx, uint64_t abs_tck, odp_buffer_t *tmo_buf, - odp_timer_pool *tp) + timer_pool_t *tp) { bool success = true; tick_buf_t *tb = &tp->tick_buf[idx]; @@ -522,9 +522,9 @@ static bool timer_reset(uint32_t idx, return success; }
-static odp_buffer_t timer_cancel(odp_timer_pool *tp, - uint32_t idx, - uint64_t new_state) +static odp_buffer_t timer_cancel(timer_pool_t *tp, + uint32_t idx, + uint64_t new_state) { tick_buf_t *tb = &tp->tick_buf[idx]; odp_buffer_t old_buf; @@ -561,7 +561,7 @@ static odp_buffer_t timer_cancel(odp_timer_pool *tp, return old_buf; }
-static unsigned timer_expire(odp_timer_pool *tp, uint32_t idx, uint64_t tick) +static unsigned timer_expire(timer_pool_t *tp, uint32_t idx, uint64_t tick) { odp_timer *tim = &tp->timers[idx]; tick_buf_t *tb = &tp->tick_buf[idx]; @@ -677,7 +677,7 @@ static unsigned odp_timer_pool_expire(odp_timer_pool_t tpid, uint64_t tick) * Functions that use Linux/POSIX per-process timers and related facilities *****************************************************************************/
-static void timer_notify(odp_timer_pool *tp) +static void timer_notify(timer_pool_t *tp) { int overrun; int64_t prev_tick; @@ -707,7 +707,7 @@ static void timer_notify(odp_timer_pool *tp)
static void *timer_thread(void *arg) { - odp_timer_pool *tp = (odp_timer_pool *)arg; + timer_pool_t *tp = (timer_pool_t *)arg; sigset_t sigset; int ret; struct timespec tmo; @@ -737,7 +737,7 @@ static void *timer_thread(void *arg) return NULL; }
-static void itimer_init(odp_timer_pool *tp) +static void itimer_init(timer_pool_t *tp) { struct sigevent sigev; struct itimerspec ispec; @@ -782,7 +782,7 @@ static void itimer_init(odp_timer_pool *tp) strerror(errno)); }
-static void itimer_fini(odp_timer_pool *tp) +static void itimer_fini(timer_pool_t *tp) { if (timer_delete(tp->timerid) != 0) ODP_ABORT("timer_delete() returned error %s\n", @@ -868,7 +868,7 @@ odp_timer_t odp_timer_alloc(odp_timer_pool_t tpid,
odp_event_t odp_timer_free(odp_timer_t hdl) { - odp_timer_pool *tp = handle_to_tp(hdl); + timer_pool_t *tp = handle_to_tp(hdl); uint32_t idx = handle_to_idx(hdl, tp); odp_buffer_t old_buf = timer_free(tp, idx); return odp_buffer_to_event(old_buf); @@ -878,9 +878,10 @@ int odp_timer_set_abs(odp_timer_t hdl, uint64_t abs_tck, odp_event_t *tmo_ev) { - odp_timer_pool *tp = handle_to_tp(hdl); + timer_pool_t *tp = handle_to_tp(hdl); uint32_t idx = handle_to_idx(hdl, tp); uint64_t cur_tick = odp_atomic_load_u64(&tp->cur_tick); + if (odp_unlikely(abs_tck < cur_tick + tp->min_rel_tck)) return ODP_TIMER_TOOEARLY; if (odp_unlikely(abs_tck > cur_tick + tp->max_rel_tck)) @@ -895,7 +896,7 @@ int odp_timer_set_rel(odp_timer_t hdl, uint64_t rel_tck, odp_event_t *tmo_ev) { - odp_timer_pool *tp = handle_to_tp(hdl); + timer_pool_t *tp = handle_to_tp(hdl); uint32_t idx = handle_to_idx(hdl, tp); uint64_t abs_tck = odp_atomic_load_u64(&tp->cur_tick) + rel_tck; if (odp_unlikely(rel_tck < tp->min_rel_tck)) @@ -910,7 +911,7 @@ int odp_timer_set_rel(odp_timer_t hdl,
int odp_timer_cancel(odp_timer_t hdl, odp_event_t *tmo_ev) { - odp_timer_pool *tp = handle_to_tp(hdl); + timer_pool_t *tp = handle_to_tp(hdl); uint32_t idx = handle_to_idx(hdl, tp); /* Set the expiration tick of the timer to TMO_INACTIVE */ odp_buffer_t old_buf = timer_cancel(tp, idx, TMO_INACTIVE); @@ -949,7 +950,7 @@ int odp_timeout_fresh(odp_timeout_t tmo) { const odp_timeout_hdr_t *hdr = timeout_hdr(tmo); odp_timer_t hdl = hdr->timer; - odp_timer_pool *tp = handle_to_tp(hdl); + timer_pool_t *tp = handle_to_tp(hdl); uint32_t idx = handle_to_idx(hdl, tp); tick_buf_t *tb = &tp->tick_buf[idx]; #if __GCC_ATOMIC_LLONG_LOCK_FREE < 2
commit 7f3624154ff59ab85352c35e1c6df3c9597f9f51 Author: Maxim Uvarov maxim.uvarov@linaro.org Date: Tue Oct 3 19:38:21 2017 +0300
linux-gen: timer: drop odp prefix from odp_timer_pool_new
Internal static function does not need odp_ prefix.
Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org Reviewed-by: Bill Fischofer bill.fischofer@linaro.org
diff --git a/platform/linux-generic/odp_timer.c b/platform/linux-generic/odp_timer.c index 3a8cfcdd..0a4fbb7e 100644 --- a/platform/linux-generic/odp_timer.c +++ b/platform/linux-generic/odp_timer.c @@ -225,8 +225,8 @@ static inline odp_timer_t tp_idx_to_handle(struct odp_timer_pool_s *tp, static void itimer_init(odp_timer_pool *tp); static void itimer_fini(odp_timer_pool *tp);
-static odp_timer_pool_t odp_timer_pool_new(const char *name, - const odp_timer_pool_param_t *param) +static odp_timer_pool_t timer_pool_new(const char *name, + const odp_timer_pool_param_t *param) { uint32_t tp_idx = odp_atomic_fetch_add_u32(&num_timer_pools, 1); if (odp_unlikely(tp_idx >= MAX_TIMER_POOLS)) { @@ -804,7 +804,7 @@ odp_timer_pool_create(const char *name, __odp_errno = EINVAL; return ODP_TIMER_POOL_INVALID; } - return odp_timer_pool_new(name, param); + return timer_pool_new(name, param); }
void odp_timer_pool_start(void)
-----------------------------------------------------------------------
Summary of changes: .../include/odp/api/plat/timer_types.h | 4 +- platform/linux-generic/odp_timer.c | 106 +++++++++++---------- 2 files changed, 56 insertions(+), 54 deletions(-)
hooks/post-receive