From e2bbf0c7da984020ae3a54e42d18c22cef620eea Mon Sep 17 00:00:00 2001 From: Jeff Hill Date: Wed, 26 Feb 1992 15:51:45 +0000 Subject: [PATCH] Initial revision --- src/ca/V5_vxWorks_patch.c | 65 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 src/ca/V5_vxWorks_patch.c diff --git a/src/ca/V5_vxWorks_patch.c b/src/ca/V5_vxWorks_patch.c new file mode 100644 index 000000000..b94d248bc --- /dev/null +++ b/src/ca/V5_vxWorks_patch.c @@ -0,0 +1,65 @@ +#ifdef V5_vxWorks + +#include +#include + +/******************************************************************************* +* +* joh 2-3-92 +* this a modified version of the WRS orig which +* allows tasks variables to be fetched from a +* task delete hook. +* +* +* +* +* taskVarGetPatch - get the value of a task variable +* +* This routine returns the private value of the task variable for a +* specific task. The specified task is usually not the calling task, +* which can get its private value by directly accessing the variable. +* This routine is provided primarily for debugging purposes. +* +* RETURNS: +* The private value of the task variable, or +* ERROR if the specified task is not found or it +* does not own the task variable. +* +* SEE ALSO: taskVarAdd(2), taskVarDelete(2), taskVarSet(2) +*/ + +int taskVarGetPatch (tid, pVar) + int tid; /* task id whose task variable is to be retrieved */ + int *pVar; /* pointer to task variable */ + + { + FAST TASK_VAR *pTaskVar; /* ptr to next node */ + WIND_TCB *pTcb; +/* + * joh 020392 + * dont call taskTcb() here and bypass error check + * which keeps this from working in a task delete hook + */ + pTcb = (WIND_TCB *) tid; + + if (pTcb == NULL) + return (ERROR); + + /* find descriptor for specified task variable */ + + for (pTaskVar = pTcb->pTaskVar; + pTaskVar != NULL; + pTaskVar = pTaskVar->next) + { + if (pTaskVar->address == pVar) + return (taskIdCurrent == pTcb ? *pVar : pTaskVar->value); + } + + + /* specified address is not a task variable for specified task */ + + errnoSet(S_taskLib_TASK_VAR_NOT_FOUND); + return (ERROR); + } + +#endif