unified: Replace _nano_get_earliest_deadline()
Replaces _nano_get_earlist_deadline() with the more streamlined routine _timeout_get_next_expiry(). Change-Id: Iee7ec727f0500cb28e37a364036fd40a483b40c3 Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
This commit is contained in:
parent
5a92f4b54f
commit
3259d0e3c4
3 changed files with 6 additions and 10 deletions
|
@ -277,15 +277,12 @@ static inline void _nano_timer_timeout_add(struct _timeout *t,
|
|||
}
|
||||
|
||||
/* find the closest deadline in the timeout queue */
|
||||
static inline uint32_t _nano_get_earliest_timeouts_deadline(void)
|
||||
static inline int32_t _timeout_get_next_expiry(void)
|
||||
{
|
||||
sys_dlist_t *q = &_nanokernel.timeout_q;
|
||||
struct _timeout *t =
|
||||
(struct _timeout *)sys_dlist_peek_head(q);
|
||||
struct _timeout *t = (struct _timeout *)
|
||||
sys_dlist_peek_head(&_timeout_q);
|
||||
|
||||
return t ? min((uint32_t)t->delta_ticks_from_prev,
|
||||
(uint32_t)_nanokernel.task_timeout)
|
||||
: (uint32_t)_nanokernel.task_timeout;
|
||||
return t ? t->delta_ticks_from_prev : K_FOREVER;
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
|
@ -111,8 +111,7 @@ static inline void _timeout_remove_tcs_from_wait_q(struct tcs *tcs)
|
|||
#else
|
||||
#define _timeout_tcs_init(tcs) do { } while ((0))
|
||||
#define _timeout_abort(tcs) do { } while ((0))
|
||||
#define _nano_get_earliest_timeouts_deadline() \
|
||||
((uint32_t)TICKS_UNLIMITED)
|
||||
#define _timeout_get_next_expiry() (K_FOREVER)
|
||||
|
||||
#define _TIMEOUT_TICK_GET() 0
|
||||
#define _TIMEOUT_ADD(thread, pq, ticks) do { } while (0)
|
||||
|
|
|
@ -225,5 +225,5 @@ void _nano_sys_clock_tick_announce(int32_t ticks)
|
|||
*/
|
||||
uint32_t _nano_get_earliest_deadline(void)
|
||||
{
|
||||
return _nano_get_earliest_timeouts_deadline();
|
||||
return (uint32_t) _timeout_get_next_expiry();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue