Tool/software: TI-RTOS
Hi,
I am working on detecting high level races in interrupt driven programs. I selected TIRTOS for our experiments.
Our tool has detected some races in TIRTOS v2.21.01.08. For example, the accesses to swi->priority in Swi_getPri and Swi_setAttrs are in race.
(Please find the APIs below for reference.)
May I know your thoughts on this finding? Like for example, do you consider this a problem, and so on.
UInt Swi_getPri(Swi_Object *swi)
{
return (swi->priority); <<==
}
Void Swi_setAttrs(Swi_Object *swi, Swi_FuncPtr fxn, Swi_Params *params)
{
UInt hwiKey;
Swi_Params swiParams;
if (params == NULL) {
Swi_Params_init(&swiParams);
params = &swiParams;
}
hwiKey = Hwi_disable();
/* defensively remove swi from its readyQ */
Queue_remove((Queue_Elem *)swi);
if (fxn != NULL) {
swi->fxn = fxn;
}
swi->posted = FALSE;
swi->arg0 = params->arg0;
swi->arg1 = params->arg1;
if (params->priority == ~0) {
swi->priority = Swi_numPriorities - 1; <<==
}
else {
swi->priority = params->priority; <<==
}
Assert_isTrue((swi->priority < Swi_numPriorities),
Swi_A_badPriority);
swi->mask = 1 << swi->priority;
swi->initTrigger = swi->trigger = params->trigger;
swi->readyQ = Queue_Object_get(Swi_module->readyQ, swi->priority);
Hwi_restore(hwiKey);
}
Thanks
Rekha