Rename microkernel struct field 'Forw' to 'next'.
Rename field 'Forw' of the structs: - 'k_proc' in the file include/microkernel/base_api.h - 'k_timer' in the file kernel/microkernel/include/micro_private_types.h - 'k_args' in the file kernel/microkernel/include/micro_private_types.h Change-Id: Ie45a71943dca9cb16b53bbc345d1ea16f8d7c50b Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
This commit is contained in:
parent
d4a5054a3f
commit
a896d2f859
16 changed files with 72 additions and 72 deletions
|
@ -106,7 +106,7 @@ struct k_msg {
|
|||
/* Task control block */
|
||||
|
||||
struct k_task {
|
||||
struct k_task *Forw;
|
||||
struct k_task *next;
|
||||
struct k_task *Back;
|
||||
kpriority_t Prio;
|
||||
ktask_t Ident;
|
||||
|
|
|
@ -169,13 +169,13 @@ extern void _k_workload_monitor_idle_end(void);
|
|||
struct k_args *Y = NULL; \
|
||||
while (X && (X->Prio <= (E)->Prio)) { \
|
||||
Y = X; \
|
||||
X = X->Forw; \
|
||||
X = X->next; \
|
||||
} \
|
||||
if (Y) \
|
||||
Y->Forw = (E); \
|
||||
Y->next = (E); \
|
||||
else \
|
||||
(L) = (E); \
|
||||
(E)->Forw = X; \
|
||||
(E)->next = X; \
|
||||
(E)->Head = &(L); \
|
||||
}
|
||||
|
||||
|
@ -186,13 +186,13 @@ extern void _k_workload_monitor_idle_end(void);
|
|||
\
|
||||
while (X && (X != (E))) { \
|
||||
Y = X; \
|
||||
X = X->Forw; \
|
||||
X = X->next; \
|
||||
} \
|
||||
if (X) { \
|
||||
if (Y) \
|
||||
Y->Forw = X->Forw; \
|
||||
Y->next = X->next; \
|
||||
else \
|
||||
*((E)->Head) = X->Forw; \
|
||||
*((E)->Head) = X->next; \
|
||||
} \
|
||||
}
|
||||
|
||||
|
|
|
@ -46,7 +46,7 @@ typedef union k_args_args K_ARGS_ARGS;
|
|||
/* Kernel timer structure */
|
||||
|
||||
struct k_timer {
|
||||
struct k_timer *Forw;
|
||||
struct k_timer *next;
|
||||
struct k_timer *Back;
|
||||
int32_t duration;
|
||||
int32_t period;
|
||||
|
@ -375,7 +375,7 @@ union k_args_args {
|
|||
* thereby violating the previously stated equivalence.
|
||||
*/
|
||||
struct k_args {
|
||||
struct k_args *Forw;
|
||||
struct k_args *next;
|
||||
struct k_args **Head;
|
||||
kpriority_t Prio;
|
||||
|
||||
|
|
|
@ -104,7 +104,7 @@ void _k_fifo_enque_request(struct k_args *A)
|
|||
if (n < Q->Nelms) {
|
||||
W = Q->Waiters;
|
||||
if (W) {
|
||||
Q->Waiters = W->Forw;
|
||||
Q->Waiters = W->next;
|
||||
p = W->Args.q1.data;
|
||||
memcpy(p, q, w);
|
||||
|
||||
|
@ -245,7 +245,7 @@ void _k_fifo_deque_request(struct k_args *A)
|
|||
A->Time.rcode = RC_OK;
|
||||
W = Q->Waiters;
|
||||
if (W) {
|
||||
Q->Waiters = W->Forw;
|
||||
Q->Waiters = W->next;
|
||||
p = Q->Enqp;
|
||||
q = W->Args.q1.data;
|
||||
w = OCTET_TO_SIZEOFUNIT(Q->Esize);
|
||||
|
@ -340,7 +340,7 @@ void _k_fifo_ioctl(struct k_args *A)
|
|||
struct k_args *X;
|
||||
|
||||
while ((X = Q->Waiters)) {
|
||||
Q->Waiters = X->Forw;
|
||||
Q->Waiters = X->next;
|
||||
#ifdef CONFIG_SYS_CLOCK_EXISTS
|
||||
if (likely(X->Time.timer)) {
|
||||
_k_timeout_cancel(X);
|
||||
|
|
|
@ -138,11 +138,11 @@ static bool prepare_transfer(struct k_args *move,
|
|||
* prepare writer and reader cmd packets for 'return':
|
||||
* (this is shared code, irrespective of the value of 'move')
|
||||
*/
|
||||
__ASSERT_NO_MSG(NULL == reader->Forw);
|
||||
__ASSERT_NO_MSG(NULL == reader->next);
|
||||
reader->Comm = _K_SVC_MBOX_RECEIVE_ACK;
|
||||
reader->Time.rcode = RC_OK;
|
||||
|
||||
__ASSERT_NO_MSG(NULL == writer->Forw);
|
||||
__ASSERT_NO_MSG(NULL == writer->next);
|
||||
writer->alloc = true;
|
||||
|
||||
writer->Comm = _K_SVC_MBOX_SEND_ACK;
|
||||
|
@ -349,14 +349,14 @@ void _k_mbox_send_request(struct k_args *Writer)
|
|||
}
|
||||
|
||||
/*
|
||||
* The [Forw] field can be changed later when added to the Writer's
|
||||
* list, but when not listed, [Forw] must be NULL.
|
||||
* The [next] field can be changed later when added to the Writer's
|
||||
* list, but when not listed, [next] must be NULL.
|
||||
*/
|
||||
|
||||
CopyWriter->Forw = NULL;
|
||||
CopyWriter->next = NULL;
|
||||
|
||||
for (CopyReader = MailBox->Readers, temp = NULL; CopyReader != NULL;
|
||||
temp = CopyReader, CopyReader = CopyReader->Forw) {
|
||||
temp = CopyReader, CopyReader = CopyReader->next) {
|
||||
uint32_t u32Size;
|
||||
|
||||
u32Size = match(CopyReader, CopyWriter);
|
||||
|
@ -372,11 +372,11 @@ void _k_mbox_send_request(struct k_args *Writer)
|
|||
*/
|
||||
|
||||
if (temp != NULL) {
|
||||
temp->Forw = CopyReader->Forw;
|
||||
temp->next = CopyReader->next;
|
||||
} else {
|
||||
MailBox->Readers = CopyReader->Forw;
|
||||
MailBox->Readers = CopyReader->next;
|
||||
}
|
||||
CopyReader->Forw = NULL;
|
||||
CopyReader->next = NULL;
|
||||
|
||||
#ifdef CONFIG_SYS_CLOCK_EXISTS
|
||||
if (CopyReader->Time.timer != NULL) {
|
||||
|
@ -570,16 +570,16 @@ void _k_mbox_receive_request(struct k_args *Reader)
|
|||
copy_packet(&CopyReader, Reader);
|
||||
|
||||
/*
|
||||
* The [Forw] field can be changed later when added to the Reader's
|
||||
* list, but when not listed, [Forw] must be NULL.
|
||||
* The [next] field can be changed later when added to the Reader's
|
||||
* list, but when not listed, [next] must be NULL.
|
||||
*/
|
||||
|
||||
CopyReader->Forw = NULL;
|
||||
CopyReader->next = NULL;
|
||||
|
||||
MailBox = (struct _k_mbox_struct *)MailBoxId;
|
||||
|
||||
for (CopyWriter = MailBox->Writers, temp = NULL; CopyWriter != NULL;
|
||||
temp = CopyWriter, CopyWriter = CopyWriter->Forw) {
|
||||
temp = CopyWriter, CopyWriter = CopyWriter->next) {
|
||||
uint32_t u32Size;
|
||||
|
||||
u32Size = match(CopyReader, CopyWriter);
|
||||
|
@ -595,11 +595,11 @@ void _k_mbox_receive_request(struct k_args *Reader)
|
|||
*/
|
||||
|
||||
if (temp != NULL) {
|
||||
temp->Forw = CopyWriter->Forw;
|
||||
temp->next = CopyWriter->next;
|
||||
} else {
|
||||
MailBox->Writers = CopyWriter->Forw;
|
||||
MailBox->Writers = CopyWriter->next;
|
||||
}
|
||||
CopyWriter->Forw = NULL;
|
||||
CopyWriter->next = NULL;
|
||||
|
||||
#ifdef CONFIG_SYS_CLOCK_EXISTS
|
||||
if (CopyWriter->Time.timer != NULL) {
|
||||
|
@ -758,7 +758,7 @@ void _k_mbox_receive_data(struct k_args *Starter)
|
|||
CopyStarter->Time.rcode = RC_OK;
|
||||
|
||||
MoveD->Args.MovedReq.Extra.Setup.ContRcv = CopyStarter;
|
||||
CopyStarter->Forw = NULL;
|
||||
CopyStarter->next = NULL;
|
||||
MoveD->Args.MovedReq.destination = CopyStarter->Args.m1.mess.rx_data;
|
||||
|
||||
MoveD->Args.MovedReq.iTotalSize = CopyStarter->Args.m1.mess.size;
|
||||
|
@ -842,7 +842,7 @@ int _task_mbox_data_block_get(struct k_msg *message,
|
|||
|
||||
Writer = MoveD->Args.MovedReq.Extra.Setup.ContSnd;
|
||||
__ASSERT_NO_MSG(NULL != Writer);
|
||||
__ASSERT_NO_MSG(NULL == Writer->Forw);
|
||||
__ASSERT_NO_MSG(NULL == Writer->next);
|
||||
|
||||
Writer->Args.m1.mess.tx_block.pool_id = (uint32_t)(-1);
|
||||
nano_task_stack_push(&_k_command_stack, (uint32_t)Writer);
|
||||
|
@ -914,7 +914,7 @@ void _k_mbox_send_data(struct k_args *Starter)
|
|||
CopyStarter->Comm = _K_SVC_MBOX_SEND_ACK;
|
||||
|
||||
MoveD->Args.MovedReq.Extra.Setup.ContSnd = CopyStarter;
|
||||
CopyStarter->Forw = NULL;
|
||||
CopyStarter->next = NULL;
|
||||
MoveD->Args.MovedReq.source = CopyStarter->Args.m1.mess.rx_data;
|
||||
|
||||
Reader = MoveD->Args.MovedReq.Extra.Setup.ContRcv;
|
||||
|
|
|
@ -181,7 +181,7 @@ void _k_mem_map_dealloc(struct k_args *A)
|
|||
|
||||
X = M->Waiters;
|
||||
if (X) {
|
||||
M->Waiters = X->Forw;
|
||||
M->Waiters = X->next;
|
||||
*(X->Args.a1.mptr) = M->Free;
|
||||
M->Free = *(char **)(M->Free);
|
||||
|
||||
|
|
|
@ -462,15 +462,15 @@ void _k_block_waiters_get(struct k_args *A)
|
|||
_k_state_bit_reset(curr_task->Ctxt.task, TF_GTBL);
|
||||
|
||||
/* remove from list */
|
||||
prev_task->Forw = curr_task->Forw;
|
||||
prev_task->next = curr_task->next;
|
||||
|
||||
/* and get next task */
|
||||
curr_task = curr_task->Forw;
|
||||
curr_task = curr_task->next;
|
||||
|
||||
} else {
|
||||
/* else just get next task */
|
||||
prev_task = curr_task;
|
||||
curr_task = curr_task->Forw;
|
||||
curr_task = curr_task->next;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -49,7 +49,7 @@ static void mvdreq_docont(struct k_args *Cont)
|
|||
|
||||
while (Cont) {
|
||||
Next = Cont;
|
||||
Cont = Cont->Forw;
|
||||
Cont = Cont->next;
|
||||
SENDARGS(Next);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -360,7 +360,7 @@ void _k_mutex_unlock(struct k_args *A /* pointer to mutex unlock
|
|||
* first in the queue.
|
||||
*/
|
||||
|
||||
Mutex->Waiters = X->Forw;
|
||||
Mutex->Waiters = X->next;
|
||||
Mutex->Owner = X->Args.l1.task;
|
||||
Mutex->Level = 1;
|
||||
Mutex->OwnerCurrentPrio = X->Prio;
|
||||
|
|
|
@ -85,7 +85,7 @@ void _k_pipe_get_request(struct k_args *RequestOrig)
|
|||
RequestProc->Args.pipe_xfer_req.iNbrPendXfers = 0;
|
||||
RequestProc->Args.pipe_xfer_req.iSizeXferred = 0;
|
||||
|
||||
RequestProc->Forw = NULL;
|
||||
RequestProc->next = NULL;
|
||||
RequestProc->Head = NULL;
|
||||
|
||||
switch (RequestProc->Time.ticks) {
|
||||
|
|
|
@ -102,7 +102,7 @@ void _k_pipe_put_request(struct k_args *RequestOrig)
|
|||
RequestProc->Args.pipe_xfer_req.iNbrPendXfers = 0;
|
||||
RequestProc->Args.pipe_xfer_req.iSizeXferred = 0;
|
||||
|
||||
RequestProc->Forw = NULL;
|
||||
RequestProc->next = NULL;
|
||||
RequestProc->Head = NULL;
|
||||
|
||||
switch (RequestProc->Time.ticks) {
|
||||
|
|
|
@ -73,7 +73,7 @@ int CalcFreeReaderSpace(struct k_args *pReaderList)
|
|||
while (pReader != NULL) {
|
||||
iSize += (pReader->Args.pipe_xfer_req.iSizeTotal -
|
||||
pReader->Args.pipe_xfer_req.iSizeXferred);
|
||||
pReader = pReader->Forw;
|
||||
pReader = pReader->next;
|
||||
}
|
||||
}
|
||||
return iSize;
|
||||
|
@ -88,7 +88,7 @@ int CalcAvailWriterData(struct k_args *pWriterList)
|
|||
while (pWriter != NULL) {
|
||||
iSize += (pWriter->Args.pipe_xfer_req.iSizeTotal -
|
||||
pWriter->Args.pipe_xfer_req.iSizeXferred);
|
||||
pWriter = pWriter->Forw;
|
||||
pWriter = pWriter->next;
|
||||
}
|
||||
}
|
||||
return iSize;
|
||||
|
|
|
@ -265,14 +265,14 @@ static void setup_movedata(struct k_args *A,
|
|||
GETARGS(pContSend);
|
||||
GETARGS(pContRecv);
|
||||
|
||||
pContSend->Forw = NULL;
|
||||
pContSend->next = NULL;
|
||||
pContSend->Comm = _K_SVC_PIPE_MOVEDATA_ACK;
|
||||
pContSend->Args.pipe_xfer_ack.pPipe = pPipe;
|
||||
pContSend->Args.pipe_xfer_ack.XferType = XferType;
|
||||
pContSend->Args.pipe_xfer_ack.ID = XferID;
|
||||
pContSend->Args.pipe_xfer_ack.iSize = size;
|
||||
|
||||
pContRecv->Forw = NULL;
|
||||
pContRecv->next = NULL;
|
||||
pContRecv->Comm = _K_SVC_PIPE_MOVEDATA_ACK;
|
||||
pContRecv->Args.pipe_xfer_ack.pPipe = pPipe;
|
||||
pContRecv->Args.pipe_xfer_ack.XferType = XferType;
|
||||
|
|
|
@ -58,7 +58,7 @@ static void signal_semaphore(int n, struct _k_sem_struct *S)
|
|||
A = S->Waiters;
|
||||
Y = NULL;
|
||||
while (A && S->Level) {
|
||||
X = A->Forw;
|
||||
X = A->next;
|
||||
|
||||
#ifdef CONFIG_SYS_CLOCK_EXISTS
|
||||
if (A->Comm == _K_SVC_SEM_WAIT_REQUEST
|
||||
|
@ -69,7 +69,7 @@ static void signal_semaphore(int n, struct _k_sem_struct *S)
|
|||
{
|
||||
S->Level--;
|
||||
if (Y) {
|
||||
Y->Forw = X;
|
||||
Y->next = X;
|
||||
} else {
|
||||
S->Waiters = X;
|
||||
}
|
||||
|
@ -117,9 +117,9 @@ void _k_sem_group_wait_cancel(struct k_args *A)
|
|||
while (X && (X->Prio <= A->Prio)) {
|
||||
if (X->Ctxt.args == A->Ctxt.args) {
|
||||
if (Y) {
|
||||
Y->Forw = X->Forw;
|
||||
Y->next = X->next;
|
||||
} else {
|
||||
S->Waiters = X->Forw;
|
||||
S->Waiters = X->next;
|
||||
}
|
||||
if (X->Comm == _K_SVC_SEM_GROUP_WAIT_REQUEST
|
||||
|| X->Comm == _K_SVC_SEM_GROUP_WAIT_READY) {
|
||||
|
@ -153,12 +153,12 @@ void _k_sem_group_wait_cancel(struct k_args *A)
|
|||
return;
|
||||
} else {
|
||||
Y = X;
|
||||
X = X->Forw;
|
||||
X = X->next;
|
||||
}
|
||||
}
|
||||
A->Forw = X;
|
||||
A->next = X;
|
||||
if (Y) {
|
||||
Y->Forw = A;
|
||||
Y->next = A;
|
||||
} else {
|
||||
S->Waiters = A;
|
||||
}
|
||||
|
@ -173,9 +173,9 @@ void _k_sem_group_wait_accept(struct k_args *A)
|
|||
while (X && (X->Prio <= A->Prio)) {
|
||||
if (X->Ctxt.args == A->Ctxt.args) {
|
||||
if (Y) {
|
||||
Y->Forw = X->Forw;
|
||||
Y->next = X->next;
|
||||
} else {
|
||||
S->Waiters = X->Forw;
|
||||
S->Waiters = X->next;
|
||||
}
|
||||
if (X->Comm == _K_SVC_SEM_GROUP_WAIT_READY) {
|
||||
_k_sem_group_wait(X);
|
||||
|
@ -186,7 +186,7 @@ void _k_sem_group_wait_accept(struct k_args *A)
|
|||
return;
|
||||
} else {
|
||||
Y = X;
|
||||
X = X->Forw;
|
||||
X = X->next;
|
||||
}
|
||||
}
|
||||
/* ERROR */
|
||||
|
@ -263,9 +263,9 @@ void _k_sem_group_wait_request(struct k_args *A)
|
|||
while (X && (X->Prio <= A->Prio)) {
|
||||
if (X->Ctxt.args == A->Ctxt.args) {
|
||||
if (Y) {
|
||||
Y->Forw = X->Forw;
|
||||
Y->next = X->next;
|
||||
} else {
|
||||
S->Waiters = X->Forw;
|
||||
S->Waiters = X->next;
|
||||
}
|
||||
if (X->Comm == _K_SVC_SEM_GROUP_WAIT_CANCEL) {
|
||||
_k_sem_group_wait(X);
|
||||
|
@ -276,12 +276,12 @@ void _k_sem_group_wait_request(struct k_args *A)
|
|||
return;
|
||||
} else {
|
||||
Y = X;
|
||||
X = X->Forw;
|
||||
X = X->next;
|
||||
}
|
||||
}
|
||||
A->Forw = X;
|
||||
A->next = X;
|
||||
if (Y) {
|
||||
Y->Forw = A;
|
||||
Y->next = A;
|
||||
} else {
|
||||
S->Waiters = A;
|
||||
}
|
||||
|
|
|
@ -88,8 +88,8 @@ void _k_state_bit_reset(struct k_task *X, /* ptr to task */
|
|||
|
||||
struct k_tqhd *H = _k_task_priority_list + X->Prio;
|
||||
|
||||
X->Forw = NULL;
|
||||
H->Tail->Forw = X;
|
||||
X->next = NULL;
|
||||
H->Tail->next = X;
|
||||
H->Tail = X;
|
||||
_k_task_priority_bitmap[X->Prio >> 5] |= (1 << (X->Prio & 0x1F));
|
||||
}
|
||||
|
@ -161,11 +161,11 @@ void _k_state_bit_set(
|
|||
* Search in the list for this task priority level,
|
||||
* and remove the task.
|
||||
*/
|
||||
while (cur_task->Forw != task_ptr) {
|
||||
cur_task = cur_task->Forw;
|
||||
while (cur_task->next != task_ptr) {
|
||||
cur_task = cur_task->next;
|
||||
}
|
||||
|
||||
cur_task->Forw = task_ptr->Forw;
|
||||
cur_task->next = task_ptr->next;
|
||||
|
||||
if (task_queue->Tail == task_ptr) {
|
||||
task_queue->Tail = cur_task;
|
||||
|
@ -547,12 +547,12 @@ void task_priority_set(ktask_t task, /* task whose priority is to be set */
|
|||
void _k_task_yield(struct k_args *A)
|
||||
{
|
||||
struct k_tqhd *H = _k_task_priority_list + _k_current_task->Prio;
|
||||
struct k_task *X = _k_current_task->Forw;
|
||||
struct k_task *X = _k_current_task->next;
|
||||
|
||||
ARG_UNUSED(A);
|
||||
if (X && H->Head == _k_current_task) {
|
||||
_k_current_task->Forw = NULL;
|
||||
H->Tail->Forw = _k_current_task;
|
||||
_k_current_task->next = NULL;
|
||||
H->Tail->next = _k_current_task;
|
||||
H->Tail = _k_current_task;
|
||||
H->Head = X;
|
||||
}
|
||||
|
|
|
@ -58,7 +58,7 @@ void _k_timer_enlist(struct k_timer *T)
|
|||
while (P && (T->duration > P->duration)) {
|
||||
T->duration -= P->duration;
|
||||
Q = P;
|
||||
P = P->Forw;
|
||||
P = P->next;
|
||||
}
|
||||
if (P) {
|
||||
P->duration -= T->duration;
|
||||
|
@ -67,11 +67,11 @@ void _k_timer_enlist(struct k_timer *T)
|
|||
_k_timer_list_tail = T;
|
||||
}
|
||||
if (Q) {
|
||||
Q->Forw = T;
|
||||
Q->next = T;
|
||||
} else {
|
||||
_k_timer_list_head = T;
|
||||
}
|
||||
T->Forw = P;
|
||||
T->next = P;
|
||||
T->Back = Q;
|
||||
}
|
||||
|
||||
|
@ -84,7 +84,7 @@ void _k_timer_enlist(struct k_timer *T)
|
|||
|
||||
void _k_timer_delist(struct k_timer *T)
|
||||
{
|
||||
struct k_timer *P = T->Forw;
|
||||
struct k_timer *P = T->next;
|
||||
struct k_timer *Q = T->Back;
|
||||
|
||||
if (P) {
|
||||
|
@ -93,7 +93,7 @@ void _k_timer_delist(struct k_timer *T)
|
|||
} else
|
||||
_k_timer_list_tail = Q;
|
||||
if (Q)
|
||||
Q->Forw = P;
|
||||
Q->next = P;
|
||||
else
|
||||
_k_timer_list_head = P;
|
||||
T->duration = -1;
|
||||
|
@ -194,7 +194,7 @@ void _k_timer_list_update(int ticks)
|
|||
if (T == _k_timer_list_tail) {
|
||||
_k_timer_list_head = _k_timer_list_tail = NULL;
|
||||
} else {
|
||||
_k_timer_list_head = T->Forw;
|
||||
_k_timer_list_head = T->next;
|
||||
_k_timer_list_head->Back = NULL;
|
||||
}
|
||||
if (T->period) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue