Rename enlist_timeout(), delist_timeout(), and force_timeout() APIs

These private APIs now follow Zephyr OS naming conventions.

Change-Id: If9de2528d740eb4ff16a69649564592a5f047c61
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
This commit is contained in:
Allan Stephens 2015-06-11 15:19:54 -04:00 committed by Anas Nashif
commit ab80db110f
11 changed files with 44 additions and 32 deletions

View file

@ -73,9 +73,11 @@ extern struct nano_lifo _k_timer_free;
extern void _k_timer_enlist(struct k_timer *T);
extern void _k_timer_delist(struct k_timer *T);
extern void enlist_timeout(struct k_args *P);
extern void delist_timeout(struct k_timer *T);
extern void force_timeout(struct k_args *A);
extern void _k_timeout_alloc(struct k_args *P);
extern void _k_timeout_free(struct k_timer *T);
extern void _k_timeout_cancel(struct k_args *A);
extern void _k_timer_list_update(int ticks);
extern void _k_do_event_signal(kevent_t event);

View file

@ -148,7 +148,7 @@ void _k_event_test(struct k_args *A)
A->Time.timer = NULL;
} else {
A->Comm = EVENT_TMO;
enlist_timeout(A);
_k_timeout_alloc(A);
}
#endif
} else {
@ -217,7 +217,7 @@ void _k_do_event_signal(kevent_t event)
if (((A) != NULL) && (E->status != 0)) {
#ifdef CONFIG_SYS_CLOCK_EXISTS
if (A->Time.timer != NULL) {
delist_timeout(A->Time.timer);
_k_timeout_free(A->Time.timer);
A->Comm = NOP;
}
#endif

View file

@ -460,7 +460,7 @@ void _k_mbox_send_request(struct k_args *Writer)
* This is a wait with timeout operation.
* Enlist a new timeout.
*/
enlist_timeout(CopyWriter);
_k_timeout_alloc(CopyWriter);
}
#endif
} else {
@ -676,7 +676,7 @@ void _k_mbox_receive_request(struct k_args *Reader)
* This is a wait with timeout operation.
* Enlist a new timeout.
*/
enlist_timeout(CopyReader);
_k_timeout_alloc(CopyReader);
}
#endif
} else {

View file

@ -79,7 +79,7 @@ void _k_mem_map_init(void)
void _k_mem_map_alloc_timeout(struct k_args *A)
{
delist_timeout(A->Time.timer);
_k_timeout_free(A->Time.timer);
REMOVE_ELM(A);
A->Time.rcode = RC_TIME;
_k_state_bit_reset(A->Ctxt.proc, TF_ALLO);
@ -123,7 +123,7 @@ void _k_mem_map_alloc(struct k_args *A)
A->Time.timer = NULL;
else {
A->Comm = ALLOCTMO;
enlist_timeout(A);
_k_timeout_alloc(A);
}
#endif
} else
@ -178,7 +178,7 @@ void _k_mem_map_dealloc(struct k_args *A)
#ifdef CONFIG_SYS_CLOCK_EXISTS
if (X->Time.timer) {
delist_timeout(X->Time.timer);
_k_timeout_free(X->Time.timer);
X->Comm = NOP;
}
#endif

View file

@ -455,7 +455,7 @@ void _k_block_waiters_get(struct k_args *A)
#ifdef CONFIG_SYS_CLOCK_EXISTS
if (curr_task->Time.timer) {
delist_timeout(curr_task->Time.timer);
_k_timeout_free(curr_task->Time.timer);
}
#endif
curr_task->Time.rcode = RC_OK;
@ -487,7 +487,7 @@ void _k_block_waiters_get(struct k_args *A)
void _k_mem_pool_block_get_timeout_handle(struct k_args *A)
{
delist_timeout(A->Time.timer);
_k_timeout_free(A->Time.timer);
REMOVE_ELM(A);
A->Time.rcode = RC_TIME;
_k_state_bit_reset(A->Ctxt.proc, TF_GTBL);
@ -546,7 +546,7 @@ void _k_mem_pool_block_get(struct k_args *A)
A->Time.timer = NULL;
} else {
A->Comm = GTBLTMO;
enlist_timeout(A);
_k_timeout_alloc(A);
}
#endif
} else {

View file

@ -229,7 +229,7 @@ void _k_mutex_lock_request(struct k_args *A /* pointer to mutex lock
* the request time out.
*/
A->Comm = LOCK_TMO;
enlist_timeout(A);
_k_timeout_alloc(A);
}
#endif
if (A->Prio < Mutex->OwnerCurrentPrio) {
@ -364,7 +364,7 @@ void _k_mutex_unlock(struct k_args *A /* pointer to mutex unlock
* Trigger a call to _k_mutex_lock_reply()--it will
* send a reply with a return code of RC_OK.
*/
force_timeout(X);
_k_timeout_cancel(X);
X->Comm = LOCK_RPL;
} else {
#endif

View file

@ -166,7 +166,7 @@ void K_ChRecvReq(struct k_args *RequestOrig)
} else
#endif
/* enlist a new timer into the timeout chain */
enlist_timeout(RequestProc);
_k_timeout_alloc(RequestProc);
return;
}

View file

@ -184,7 +184,7 @@ void K_ChSendReq(struct k_args *RequestOrig)
} else
#endif
/* enlist a new timer into the timeout chain */
enlist_timeout(RequestProc);
_k_timeout_alloc(RequestProc);
return;
}

View file

@ -88,7 +88,7 @@ void _k_fifo_enque_request(struct k_args *A)
#ifdef CONFIG_SYS_CLOCK_EXISTS
if (W->Time.timer) {
force_timeout(W);
_k_timeout_cancel(W);
W->Comm = DEQ_RPL;
} else {
#endif
@ -128,7 +128,7 @@ void _k_fifo_enque_request(struct k_args *A)
A->Time.timer = NULL;
else {
A->Comm = ENQ_TMO;
enlist_timeout(A);
_k_timeout_alloc(A);
}
#endif
} else {
@ -231,7 +231,7 @@ void _k_fifo_deque_request(struct k_args *A)
#ifdef CONFIG_SYS_CLOCK_EXISTS
if (W->Time.timer) {
force_timeout(W);
_k_timeout_cancel(W);
W->Comm = ENQ_RPL;
} else {
#endif
@ -257,7 +257,7 @@ void _k_fifo_deque_request(struct k_args *A)
A->Time.timer = NULL;
else {
A->Comm = DEQ_TMO;
enlist_timeout(A);
_k_timeout_alloc(A);
}
#endif
} else {
@ -317,7 +317,7 @@ void _k_fifo_ioctl(struct k_args *A)
Q->Waiters = X->Forw;
#ifdef CONFIG_SYS_CLOCK_EXISTS
if (likely(X->Time.timer)) {
force_timeout(X);
_k_timeout_cancel(X);
X->Comm = ENQ_RPL;
} else {
#endif

View file

@ -71,7 +71,7 @@ static void signal_semaphore(int n, struct sem_struct *S)
}
#ifdef CONFIG_SYS_CLOCK_EXISTS
if (A->Time.timer) {
force_timeout(A);
_k_timeout_cancel(A);
A->Comm = WAITSRPL;
} else {
#endif
@ -267,7 +267,7 @@ void _k_sem_group_ready(struct k_args *R)
A->Comm = WAITMTMO;
#ifdef CONFIG_SYS_CLOCK_EXISTS
if (A->Time.timer) {
force_timeout(A);
_k_timeout_cancel(A);
} else
#endif
_k_sem_group_wait_timeout(A);
@ -382,7 +382,7 @@ void _k_sem_group_wait_any(struct k_args *A)
A->Time.timer = NULL;
} else {
A->Comm = WAITMTMO;
enlist_timeout(A);
_k_timeout_alloc(A);
}
}
#endif
@ -416,7 +416,7 @@ void _k_sem_wait_request(struct k_args *A)
A->Time.timer = NULL;
} else {
A->Comm = WAITSTMO;
enlist_timeout(A);
_k_timeout_alloc(A);
}
#endif
return;

View file

@ -136,12 +136,14 @@ void _k_timer_delist(struct k_timer *T)
/*******************************************************************************
*
* enlist_timeout - allocate and insert a timer into the timer queue
* _k_timeout_alloc - allocate timer used for command packet timeout
*
* Allocates timer for command packet and inserts it into the timer queue.
*
* RETURNS: N/A
*/
void enlist_timeout(struct k_args *P)
void _k_timeout_alloc(struct k_args *P)
{
struct k_timer *T;
@ -155,12 +157,18 @@ void enlist_timeout(struct k_args *P)
/*******************************************************************************
*
* force_timeout - remove a non-expired timer from the timer queue
* _k_timeout_cancel - cancel timer used for command packet timeout
*
* Cancels timer (if not already expired), then reschedules the command packet
* for further processing.
*
* The command that is processed following cancellation is typically NOT the
* command that would have occurred had the timeout expired on its own.
*
* RETURNS: N/A
*/
void force_timeout(struct k_args *A)
void _k_timeout_cancel(struct k_args *A)
{
struct k_timer *T = A->Time.timer;
@ -172,12 +180,14 @@ void force_timeout(struct k_args *A)
/*******************************************************************************
*
* delist_timeout - remove a non-expired timer from the timer queue and free it
* _k_timeout_free - free timer used for command packet timeout
*
* Cancels timer (if not already expired), then frees it.
*
* RETURNS: N/A
*/
void delist_timeout(struct k_timer *T)
void _k_timeout_free(struct k_timer *T)
{
if (T->duration != -1)
_k_timer_delist(T);