Rename set_state_bit() and reset_state_bit() private APIs
APIs now follow Zephyr OS naming conventions. Change-Id: I154536d2c40784ae83a936c55cf748173343c681 Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
This commit is contained in:
parent
9e675cf581
commit
a7e20d2b0a
12 changed files with 54 additions and 54 deletions
|
@ -80,8 +80,8 @@ extern void _k_timer_list_update(int ticks);
|
|||
|
||||
extern void _k_do_event_signal(kevent_t event);
|
||||
|
||||
extern void set_state_bit(struct k_proc *, uint32_t);
|
||||
extern void reset_state_bit(struct k_proc *, uint32_t);
|
||||
extern void _k_state_bit_set(struct k_proc *, uint32_t);
|
||||
extern void _k_state_bit_reset(struct k_proc *, uint32_t);
|
||||
extern void _k_task_call(struct k_args *);
|
||||
|
||||
/*
|
||||
|
|
|
@ -116,7 +116,7 @@ void _k_event_test_timeout(struct k_args *A)
|
|||
FREETIMER(A->Time.timer);
|
||||
A->Time.rcode = RC_TIME;
|
||||
E->waiter = NULL;
|
||||
reset_state_bit(A->Ctxt.proc, TF_EVNT);
|
||||
_k_state_bit_reset(A->Ctxt.proc, TF_EVNT);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
|
@ -142,7 +142,7 @@ void _k_event_test(struct k_args *A)
|
|||
if (likely(E->waiter == NULL)) {
|
||||
A->Ctxt.proc = _k_current_task;
|
||||
E->waiter = A;
|
||||
set_state_bit(_k_current_task, TF_EVNT);
|
||||
_k_state_bit_set(_k_current_task, TF_EVNT);
|
||||
#ifdef CONFIG_SYS_CLOCK_EXISTS
|
||||
if (A->Time.ticks == TICKS_UNLIMITED) {
|
||||
A->Time.timer = NULL;
|
||||
|
@ -223,7 +223,7 @@ void _k_do_event_signal(kevent_t event)
|
|||
#endif
|
||||
A->Time.rcode = RC_OK;
|
||||
|
||||
reset_state_bit(A->Ctxt.proc, TF_EVNT);
|
||||
_k_state_bit_reset(A->Ctxt.proc, TF_EVNT);
|
||||
E->waiter = NULL;
|
||||
E->status = 0;
|
||||
}
|
||||
|
|
|
@ -292,7 +292,7 @@ void _k_mbox_send_ack(struct k_args *pCopyWriter)
|
|||
Starter = pCopyWriter->Ctxt.args;
|
||||
Starter->Time.rcode = pCopyWriter->Time.rcode;
|
||||
Starter->Args.m1.mess = pCopyWriter->Args.m1.mess;
|
||||
reset_state_bit(Starter->Ctxt.proc, TF_SEND | TF_SENDDATA);
|
||||
_k_state_bit_reset(Starter->Ctxt.proc, TF_SEND | TF_SENDDATA);
|
||||
|
||||
FREEARGS(pCopyWriter);
|
||||
}
|
||||
|
@ -341,7 +341,7 @@ void _k_mbox_send_request(struct k_args *Writer)
|
|||
|
||||
if (!bAsync) {
|
||||
sender = _k_current_task;
|
||||
set_state_bit(sender, TF_SEND);
|
||||
_k_state_bit_set(sender, TF_SEND);
|
||||
}
|
||||
|
||||
Writer->Ctxt.proc = sender;
|
||||
|
@ -540,7 +540,7 @@ void _k_mbox_receive_ack(struct k_args *pCopyReader)
|
|||
Starter->Args.m1.mess = pCopyReader->Args.m1.mess;
|
||||
|
||||
/* Reschedule the sender task */
|
||||
reset_state_bit(Starter->Ctxt.proc, TF_RECV | TF_RECVDATA);
|
||||
_k_state_bit_reset(Starter->Ctxt.proc, TF_RECV | TF_RECVDATA);
|
||||
|
||||
FREEARGS(pCopyReader);
|
||||
}
|
||||
|
@ -579,7 +579,7 @@ void _k_mbox_receive_request(struct k_args *Reader)
|
|||
struct k_args *CopyReader;
|
||||
|
||||
Reader->Ctxt.proc = _k_current_task;
|
||||
set_state_bit(Reader->Ctxt.proc, TF_RECV);
|
||||
_k_state_bit_set(Reader->Ctxt.proc, TF_RECV);
|
||||
|
||||
copy_packet(&CopyReader, Reader);
|
||||
|
||||
|
@ -781,7 +781,7 @@ void _k_mbox_receive_data(struct k_args *Starter)
|
|||
struct k_args *Writer;
|
||||
|
||||
Starter->Ctxt.proc = _k_current_task;
|
||||
set_state_bit(_k_current_task, TF_RECVDATA);
|
||||
_k_state_bit_set(_k_current_task, TF_RECVDATA);
|
||||
|
||||
GETARGS(CopyStarter);
|
||||
memcpy(CopyStarter, Starter, sizeof(struct k_args));
|
||||
|
@ -958,7 +958,7 @@ void _k_mbox_send_data(struct k_args *Starter)
|
|||
struct k_args *Reader;
|
||||
|
||||
Starter->Ctxt.proc = _k_current_task;
|
||||
set_state_bit(_k_current_task, TF_SENDDATA);
|
||||
_k_state_bit_set(_k_current_task, TF_SENDDATA);
|
||||
|
||||
GETARGS(CopyStarter);
|
||||
memcpy(CopyStarter, Starter, sizeof(struct k_args));
|
||||
|
|
|
@ -82,7 +82,7 @@ void _k_mem_map_alloc_timeout(struct k_args *A)
|
|||
delist_timeout(A->Time.timer);
|
||||
REMOVE_ELM(A);
|
||||
A->Time.rcode = RC_TIME;
|
||||
reset_state_bit(A->Ctxt.proc, TF_ALLO);
|
||||
_k_state_bit_reset(A->Ctxt.proc, TF_ALLO);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
|
@ -116,7 +116,7 @@ void _k_mem_map_alloc(struct k_args *A)
|
|||
if (likely(A->Time.ticks != TICKS_NONE)) {
|
||||
A->Prio = _k_current_task->Prio;
|
||||
A->Ctxt.proc = _k_current_task;
|
||||
set_state_bit(_k_current_task, TF_ALLO);
|
||||
_k_state_bit_set(_k_current_task, TF_ALLO);
|
||||
INSERT_ELM(M->Waiters, A);
|
||||
#ifdef CONFIG_SYS_CLOCK_EXISTS
|
||||
if (A->Time.ticks == TICKS_UNLIMITED)
|
||||
|
@ -183,7 +183,7 @@ void _k_mem_map_dealloc(struct k_args *A)
|
|||
}
|
||||
#endif
|
||||
X->Time.rcode = RC_OK;
|
||||
reset_state_bit(X->Ctxt.proc, TF_ALLO);
|
||||
_k_state_bit_reset(X->Ctxt.proc, TF_ALLO);
|
||||
|
||||
#ifdef CONFIG_OBJECT_MONITOR
|
||||
M->Count++;
|
||||
|
|
|
@ -459,7 +459,7 @@ void _k_block_waiters_get(struct k_args *A)
|
|||
}
|
||||
#endif
|
||||
curr_task->Time.rcode = RC_OK;
|
||||
reset_state_bit(curr_task->Ctxt.proc, TF_GTBL);
|
||||
_k_state_bit_reset(curr_task->Ctxt.proc, TF_GTBL);
|
||||
|
||||
/* remove from list */
|
||||
prev_task->Forw = curr_task->Forw;
|
||||
|
@ -490,7 +490,7 @@ void _k_mem_pool_block_get_timeout_handle(struct k_args *A)
|
|||
delist_timeout(A->Time.timer);
|
||||
REMOVE_ELM(A);
|
||||
A->Time.rcode = RC_TIME;
|
||||
reset_state_bit(A->Ctxt.proc, TF_GTBL);
|
||||
_k_state_bit_reset(A->Ctxt.proc, TF_GTBL);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
|
@ -536,7 +536,7 @@ void _k_mem_pool_block_get(struct k_args *A)
|
|||
P->maxblock_size))) {/* timeout? but not block to large */
|
||||
A->Prio = _k_current_task->Prio;
|
||||
A->Ctxt.proc = _k_current_task;
|
||||
set_state_bit(_k_current_task, TF_GTBL); /* extra new statebit */
|
||||
_k_state_bit_set(_k_current_task, TF_GTBL); /* extra new statebit */
|
||||
|
||||
/* INSERT_ELM (P->frag_tab[offset].Waiters, A); */
|
||||
INSERT_ELM(P->Waiters, A);
|
||||
|
|
|
@ -141,7 +141,7 @@ void _k_mutex_lock_reply(
|
|||
A->Time.rcode = RC_OK;
|
||||
#endif
|
||||
|
||||
reset_state_bit(A->Ctxt.proc, TF_LOCK);
|
||||
_k_state_bit_reset(A->Ctxt.proc, TF_LOCK);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
|
@ -216,7 +216,7 @@ void _k_mutex_lock_request(struct k_args *A /* pointer to mutex lock
|
|||
*/
|
||||
A->Ctxt.proc = _k_current_task;
|
||||
A->Prio = _k_current_task->Prio;
|
||||
set_state_bit(_k_current_task, TF_LOCK);
|
||||
_k_state_bit_set(_k_current_task, TF_LOCK);
|
||||
/* Note: Mutex->Waiters is a priority sorted list */
|
||||
INSERT_ELM(Mutex->Waiters, A);
|
||||
#ifdef CONFIG_SYS_CLOCK_EXISTS
|
||||
|
@ -373,7 +373,7 @@ void _k_mutex_unlock(struct k_args *A /* pointer to mutex unlock
|
|||
* Set the return code.
|
||||
*/
|
||||
X->Time.rcode = RC_OK;
|
||||
reset_state_bit(X->Ctxt.proc, TF_LOCK);
|
||||
_k_state_bit_reset(X->Ctxt.proc, TF_LOCK);
|
||||
#ifdef CONFIG_SYS_CLOCK_EXISTS
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -54,7 +54,7 @@ void K_ChRecvReq(struct k_args *RequestOrig)
|
|||
|
||||
/* First we save the pointer to the task's TCB for rescheduling later */
|
||||
RequestOrig->Ctxt.proc = _k_current_task;
|
||||
set_state_bit(_k_current_task, TF_RECV);
|
||||
_k_state_bit_set(_k_current_task, TF_RECV);
|
||||
|
||||
mycopypacket(&Request, RequestOrig);
|
||||
|
||||
|
@ -278,7 +278,7 @@ void K_ChRecvAck(struct k_args *Request)
|
|||
|
||||
/* Reschedule the sender task */
|
||||
|
||||
reset_state_bit(LocalReq->Ctxt.proc, TF_RECV | TF_RECVDATA);
|
||||
_k_state_bit_reset(LocalReq->Ctxt.proc, TF_RECV | TF_RECVDATA);
|
||||
|
||||
FREEARGS(Request);
|
||||
}
|
||||
|
|
|
@ -62,7 +62,7 @@ void K_ChSendReq(struct k_args *RequestOrig)
|
|||
if (!bAsync) {
|
||||
/* First save the pointer to the task's TCB for rescheduling later */
|
||||
RequestOrig->Ctxt.proc = _k_current_task;
|
||||
set_state_bit(_k_current_task, TF_SEND);
|
||||
_k_state_bit_set(_k_current_task, TF_SEND);
|
||||
} else {
|
||||
/* No need to put in data about sender, since it's a poster */
|
||||
RequestOrig->Ctxt.proc = NULL;
|
||||
|
@ -320,7 +320,7 @@ void K_ChSendAck(struct k_args *Request)
|
|||
LocalReq->Time.rcode = Request->Time.rcode;
|
||||
LocalReq->Args.ChAck = Request->Args.ChAck;
|
||||
|
||||
reset_state_bit(LocalReq->Ctxt.proc, TF_SEND | TF_SENDDATA);
|
||||
_k_state_bit_reset(LocalReq->Ctxt.proc, TF_SEND | TF_SENDDATA);
|
||||
}
|
||||
|
||||
FREEARGS(Request);
|
||||
|
|
|
@ -57,7 +57,7 @@ void _k_fifo_enque_reply(struct k_args *A)
|
|||
A->Time.rcode = RC_OK;
|
||||
#endif
|
||||
|
||||
reset_state_bit(A->Ctxt.proc, TF_ENQU);
|
||||
_k_state_bit_reset(A->Ctxt.proc, TF_ENQU);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
|
@ -93,7 +93,7 @@ void _k_fifo_enque_request(struct k_args *A)
|
|||
} else {
|
||||
#endif
|
||||
W->Time.rcode = RC_OK;
|
||||
reset_state_bit(W->Ctxt.proc, TF_DEQU);
|
||||
_k_state_bit_reset(W->Ctxt.proc, TF_DEQU);
|
||||
}
|
||||
#ifdef CONFIG_SYS_CLOCK_EXISTS
|
||||
}
|
||||
|
@ -121,7 +121,7 @@ void _k_fifo_enque_request(struct k_args *A)
|
|||
if (likely(A->Time.ticks != TICKS_NONE)) {
|
||||
A->Ctxt.proc = _k_current_task;
|
||||
A->Prio = _k_current_task->Prio;
|
||||
set_state_bit(_k_current_task, TF_ENQU);
|
||||
_k_state_bit_set(_k_current_task, TF_ENQU);
|
||||
INSERT_ELM(Q->Waiters, A);
|
||||
#ifdef CONFIG_SYS_CLOCK_EXISTS
|
||||
if (A->Time.ticks == TICKS_UNLIMITED)
|
||||
|
@ -184,7 +184,7 @@ void _k_fifo_deque_reply(struct k_args *A)
|
|||
A->Time.rcode = RC_OK;
|
||||
#endif
|
||||
|
||||
reset_state_bit(A->Ctxt.proc, TF_DEQU);
|
||||
_k_state_bit_reset(A->Ctxt.proc, TF_DEQU);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
|
@ -236,7 +236,7 @@ void _k_fifo_deque_request(struct k_args *A)
|
|||
} else {
|
||||
#endif
|
||||
W->Time.rcode = RC_OK;
|
||||
reset_state_bit(W->Ctxt.proc, TF_ENQU);
|
||||
_k_state_bit_reset(W->Ctxt.proc, TF_ENQU);
|
||||
#ifdef CONFIG_SYS_CLOCK_EXISTS
|
||||
}
|
||||
#endif
|
||||
|
@ -249,7 +249,7 @@ void _k_fifo_deque_request(struct k_args *A)
|
|||
if (likely(A->Time.ticks != TICKS_NONE)) {
|
||||
A->Ctxt.proc = _k_current_task;
|
||||
A->Prio = _k_current_task->Prio;
|
||||
set_state_bit(_k_current_task, TF_DEQU);
|
||||
_k_state_bit_set(_k_current_task, TF_DEQU);
|
||||
|
||||
INSERT_ELM(Q->Waiters, A);
|
||||
#ifdef CONFIG_SYS_CLOCK_EXISTS
|
||||
|
@ -322,7 +322,7 @@ void _k_fifo_ioctl(struct k_args *A)
|
|||
} else {
|
||||
#endif
|
||||
X->Time.rcode = RC_FAIL;
|
||||
reset_state_bit(X->Ctxt.proc, TF_ENQU);
|
||||
_k_state_bit_reset(X->Ctxt.proc, TF_ENQU);
|
||||
#ifdef CONFIG_SYS_CLOCK_EXISTS
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -76,7 +76,7 @@ static void signal_semaphore(int n, struct sem_struct *S)
|
|||
} else {
|
||||
#endif
|
||||
A->Time.rcode = RC_OK;
|
||||
reset_state_bit(A->Ctxt.proc, TF_SEMA);
|
||||
_k_state_bit_reset(A->Ctxt.proc, TF_SEMA);
|
||||
#ifdef CONFIG_SYS_CLOCK_EXISTS
|
||||
}
|
||||
#endif
|
||||
|
@ -107,7 +107,7 @@ void _k_sem_group_wait(struct k_args *R)
|
|||
|
||||
FREEARGS(R);
|
||||
if (--(A->Args.s1.nsem) == 0) {
|
||||
reset_state_bit(A->Ctxt.proc, TF_LIST);
|
||||
_k_state_bit_reset(A->Ctxt.proc, TF_LIST);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -294,7 +294,7 @@ void _k_sem_wait_reply(struct k_args *A)
|
|||
} else
|
||||
#endif
|
||||
A->Time.rcode = RC_OK;
|
||||
reset_state_bit(A->Ctxt.proc, TF_SEMA);
|
||||
_k_state_bit_reset(A->Ctxt.proc, TF_SEMA);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
|
@ -374,7 +374,7 @@ void _k_sem_group_wait_any(struct k_args *A)
|
|||
}
|
||||
|
||||
A->Ctxt.proc = _k_current_task;
|
||||
set_state_bit(_k_current_task, TF_LIST);
|
||||
_k_state_bit_set(_k_current_task, TF_LIST);
|
||||
|
||||
#ifdef CONFIG_SYS_CLOCK_EXISTS
|
||||
if (A->Time.ticks != TICKS_NONE) {
|
||||
|
@ -409,7 +409,7 @@ void _k_sem_wait_request(struct k_args *A)
|
|||
} else if (A->Time.ticks != TICKS_NONE) {
|
||||
A->Ctxt.proc = _k_current_task;
|
||||
A->Prio = _k_current_task->Prio;
|
||||
set_state_bit(_k_current_task, TF_SEMA);
|
||||
_k_state_bit_set(_k_current_task, TF_SEMA);
|
||||
INSERT_ELM(S->Waiters, A);
|
||||
#ifdef CONFIG_SYS_CLOCK_EXISTS
|
||||
if (A->Time.ticks == TICKS_UNLIMITED) {
|
||||
|
|
|
@ -57,7 +57,7 @@ ktask_t task_id_get(void)
|
|||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* reset_state_bit - reset the specified task state bits
|
||||
* _k_state_bit_reset - reset the specified task state bits
|
||||
*
|
||||
* This routine resets the specified task state bits. When a task's state bits
|
||||
* are zero, the task may be scheduled to run. The tasks's state bits are a
|
||||
|
@ -67,7 +67,7 @@ ktask_t task_id_get(void)
|
|||
* RETURNS: N/A
|
||||
*/
|
||||
|
||||
void reset_state_bit(struct k_proc *X, /* ptr to task */
|
||||
void _k_state_bit_reset(struct k_proc *X, /* ptr to task */
|
||||
uint32_t bits /* bitmask of TF_xxx
|
||||
bits to reset */
|
||||
)
|
||||
|
@ -109,7 +109,7 @@ void reset_state_bit(struct k_proc *X, /* ptr to task */
|
|||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* set_state_bit - set specified task state bits
|
||||
* _k_state_bit_set - set specified task state bits
|
||||
*
|
||||
* This routine sets the specified task state bits. When a task's state bits
|
||||
* are non-zero, the task will not be scheduled to run. The task's state bits
|
||||
|
@ -119,7 +119,7 @@ void reset_state_bit(struct k_proc *X, /* ptr to task */
|
|||
* RETURNS: N/A
|
||||
*/
|
||||
|
||||
void set_state_bit(
|
||||
void _k_state_bit_set(
|
||||
struct k_proc *task_ptr,
|
||||
uint32_t bits /* bitmask of TF_xxx bits to set */
|
||||
)
|
||||
|
@ -232,7 +232,7 @@ static void start_task(struct k_proc *X, /* ptr to task control block */
|
|||
|
||||
X->fabort = NULL;
|
||||
|
||||
reset_state_bit(X, TF_STOP | TF_TERM);
|
||||
_k_state_bit_reset(X, TF_STOP | TF_TERM);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
|
@ -253,7 +253,7 @@ static void abort_task(struct k_proc *X)
|
|||
|
||||
/* Set TF_TERM and TF_STOP state flags */
|
||||
|
||||
set_state_bit(X, TF_STOP | TF_TERM);
|
||||
_k_state_bit_set(X, TF_STOP | TF_TERM);
|
||||
|
||||
/* Invoke abort function, if there is one */
|
||||
|
||||
|
@ -337,16 +337,16 @@ void _k_task_op(struct k_args *A)
|
|||
abort_task(X);
|
||||
break;
|
||||
case TASK_SUSPEND:
|
||||
set_state_bit(X, TF_SUSP);
|
||||
_k_state_bit_set(X, TF_SUSP);
|
||||
break;
|
||||
case TASK_RESUME:
|
||||
reset_state_bit(X, TF_SUSP);
|
||||
_k_state_bit_reset(X, TF_SUSP);
|
||||
break;
|
||||
case TASK_BLOCK:
|
||||
set_state_bit(X, TF_BLCK);
|
||||
_k_state_bit_set(X, TF_BLCK);
|
||||
break;
|
||||
case TASK_UNBLOCK:
|
||||
reset_state_bit(X, TF_BLCK);
|
||||
_k_state_bit_reset(X, TF_BLCK);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -405,16 +405,16 @@ void _k_task_group_op(struct k_args *A)
|
|||
abort_task(X);
|
||||
break;
|
||||
case TASK_GROUP_SUSPEND:
|
||||
set_state_bit(X, TF_SUSP);
|
||||
_k_state_bit_set(X, TF_SUSP);
|
||||
break;
|
||||
case TASK_GROUP_RESUME:
|
||||
reset_state_bit(X, TF_SUSP);
|
||||
_k_state_bit_reset(X, TF_SUSP);
|
||||
break;
|
||||
case TASK_GROUP_BLOCK:
|
||||
set_state_bit(X, TF_BLCK);
|
||||
_k_state_bit_set(X, TF_BLCK);
|
||||
break;
|
||||
case TASK_GROUP_UNBLOCK:
|
||||
reset_state_bit(X, TF_BLCK);
|
||||
_k_state_bit_reset(X, TF_BLCK);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -501,9 +501,9 @@ void _k_task_priority_set(struct k_args *A)
|
|||
ktask_t Tid = A->Args.g1.task;
|
||||
struct k_proc *X = _k_task_list + OBJ_INDEX(Tid);
|
||||
|
||||
set_state_bit(X, TF_PRIO);
|
||||
_k_state_bit_set(X, TF_PRIO);
|
||||
X->Prio = A->Args.g1.prio;
|
||||
reset_state_bit(X, TF_PRIO);
|
||||
_k_state_bit_reset(X, TF_PRIO);
|
||||
|
||||
if (A->alloc)
|
||||
FREEARGS(A);
|
||||
|
|
|
@ -489,7 +489,7 @@ void _k_task_wakeup(struct k_args *P)
|
|||
T = P->Time.timer;
|
||||
|
||||
FREETIMER(T);
|
||||
reset_state_bit(X, TF_TIME);
|
||||
_k_state_bit_reset(X, TF_TIME);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
|
@ -520,7 +520,7 @@ void _k_task_sleep(struct k_args *P)
|
|||
P->Time.timer = T;
|
||||
|
||||
enlist_timer(T);
|
||||
set_state_bit(_k_current_task, TF_TIME);
|
||||
_k_state_bit_set(_k_current_task, TF_TIME);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue