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:
Peter Mitsis 2015-04-20 23:20:10 -04:00 committed by Anas Nashif
commit 101d486834
8 changed files with 11 additions and 10 deletions

View file

@ -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();

View file

@ -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.
*/

View file

@ -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 {

View file

@ -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);
}

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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);
}