Rename k_args 'Srce' field to 'alloc'
Since multi-node systems are not supported, the 'Srce' field now only serves one purpose--to indicate whether the packet was allocated from the command packet pool. As such, a better name (and type) for it is 'alloc' (of type 'bool') since 'Srce' (of type 'knode_t') suggest multi-node support. Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com> Change-Id: I47a935af13fd55dbca23c879841d68caf895eae4
This commit is contained in:
parent
265448a23d
commit
101d486834
8 changed files with 11 additions and 10 deletions
|
@ -77,7 +77,7 @@ void _TaskAbort(void)
|
|||
cmdpacket.Comm = TSKOP;
|
||||
cmdpacket.Args.g1.task = K_Task->Ident;
|
||||
cmdpacket.Args.g1.opt = taskAbortCode;
|
||||
cmdpacket.Srce = 0;
|
||||
cmdpacket.alloc = false;
|
||||
K_Task->Args = &cmdpacket;
|
||||
nano_isr_stack_push(&K_Args, (uint32_t) &cmdpacket);
|
||||
_ScbPendsvSet();
|
||||
|
|
|
@ -54,7 +54,7 @@ extern "C" {
|
|||
* of command packets.
|
||||
*
|
||||
* INTERNAL
|
||||
* It is critical that the word corresponding to the [Srce] field in the
|
||||
* It is critical that the word corresponding to the [alloc] field in the
|
||||
* equivalent struct k_args command packet be zero so that the system knows that the
|
||||
* command packet is not part of the free list.
|
||||
*/
|
||||
|
|
|
@ -36,6 +36,7 @@
|
|||
#include <microkernel/k_types.h>
|
||||
#include <microkernel/k_chstr.h>
|
||||
#include <nanokernel.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
@ -486,7 +487,7 @@ struct k_args {
|
|||
struct k_args *Forw;
|
||||
struct k_args **Head;
|
||||
kpriority_t Prio;
|
||||
knode_t Srce;
|
||||
bool alloc; /* true if allocated via GETARGS(); else false */
|
||||
K_COMM Comm;
|
||||
K_CREF Ctxt;
|
||||
union {
|
||||
|
|
|
@ -47,7 +47,7 @@
|
|||
|
||||
void K_taskcall(struct k_args *cmdpacket)
|
||||
{
|
||||
cmdpacket->Srce = 0;
|
||||
cmdpacket->alloc = false;
|
||||
K_Task->Args = cmdpacket;
|
||||
nano_task_stack_push(&K_Args, (uint32_t)cmdpacket);
|
||||
}
|
||||
|
|
|
@ -144,7 +144,7 @@ static BOOL prepare_transfer(struct k_args *move,
|
|||
reader->Time.rcode = RC_OK;
|
||||
|
||||
__ASSERT_NO_MSG(NULL == writer->Forw);
|
||||
writer->Srce = K_ThisNode;
|
||||
writer->alloc = true;
|
||||
|
||||
writer->Comm = SEND_ACK;
|
||||
writer->Time.rcode = RC_OK;
|
||||
|
|
|
@ -647,7 +647,7 @@ void K_RelBlock(struct k_args *A)
|
|||
NewGet->Comm = GET_BLOCK_WAIT;
|
||||
TO_ALIST(&K_Args, NewGet); /* push on command stack */
|
||||
}
|
||||
if (A->Srce) {
|
||||
if (A->alloc) {
|
||||
FREEARGS(A);
|
||||
}
|
||||
return;
|
||||
|
|
|
@ -127,7 +127,7 @@ void K_lockrpl(
|
|||
|
||||
if (Mutex->OwnerCurrentPrio != newPriority) {
|
||||
GETARGS(PrioChanger);
|
||||
PrioChanger->Srce = K_ThisNode;
|
||||
PrioChanger->alloc = true;
|
||||
PrioChanger->Comm = SPRIO;
|
||||
PrioChanger->Prio = newPriority;
|
||||
PrioChanger->Args.g1.task = Mutex->Owner;
|
||||
|
@ -245,7 +245,7 @@ void K_lockreq(struct k_args *A /* pointer to mutex lock
|
|||
/* Boost the priority level */
|
||||
GETARGS(PrioBooster);
|
||||
|
||||
PrioBooster->Srce = K_ThisNode;
|
||||
PrioBooster->alloc = true;
|
||||
PrioBooster->Comm = SPRIO;
|
||||
PrioBooster->Prio = BoostedPrio;
|
||||
PrioBooster->Args.g1.task = Mutex->Owner;
|
||||
|
@ -334,7 +334,7 @@ void K_unlock(struct k_args *A /* pointer to mutex unlock
|
|||
*/
|
||||
GETARGS(PrioDowner);
|
||||
|
||||
PrioDowner->Srce = K_ThisNode;
|
||||
PrioDowner->alloc = true;
|
||||
PrioDowner->Comm = SPRIO;
|
||||
PrioDowner->Prio = Mutex->OwnerOriginalPrio;
|
||||
PrioDowner->Args.g1.task = Mutex->Owner;
|
||||
|
|
|
@ -380,7 +380,7 @@ void K_set_prio(struct k_args *A)
|
|||
X->Prio = A->Args.g1.prio;
|
||||
reset_state_bit(X, TF_PRIO);
|
||||
|
||||
if (A->Srce)
|
||||
if (A->alloc)
|
||||
FREEARGS(A);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue