Skip to content

Commit 47b94d0

Browse files
committed
FreeRTOS Component View: corrected linked list processing
1 parent c173123 commit 47b94d0

1 file changed

Lines changed: 94 additions & 13 deletions

File tree

CMSIS/RTOS2/FreeRTOS/FreeRTOS.scvd

Lines changed: 94 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -202,13 +202,22 @@
202202

203203
<!-- Ready Tasks -->
204204
<readlist name="pxReadyTasksLists" type="List_t" symbol="tasks.c/pxReadyTasksLists" count="__size_of(&quot;tasks.c/pxReadyTasksLists&quot;)" init="1"/>
205-
205+
206+
<!-- Read ready lists for each priority -->
206207
<list name="i" start="0" limit="pxReadyTasksLists._count">
207-
<readlist cond="pxReadyTasksLists[i].uxNumberOfItems" name="pxReadyTasks" type="ListItem_t" offset="pxReadyTasksLists[i].pxIndex" next="pxNext"/>
208+
<!-- Determine address of first item in list, read current item and determine address of next item in list -->
209+
<calc> n = pxReadyTasksLists[i].xListEnd_pxNext; </calc>
210+
211+
<list name="j" start="0" limit="pxReadyTasksLists[i].uxNumberOfItems">
212+
<readlist name="pxReadyTasks" type="ListItem_t" offset="n" count="1"/>
213+
214+
<calc> n = pxReadyTasks[pxReadyTasks._count-1].pxNext; </calc>
215+
</list>
208216
</list>
209217

218+
<!-- Read control blocks -->
210219
<list name="i" start="0" limit="pxReadyTasks._count">
211-
<readlist cond="pxReadyTasks[i].pvOwner &amp;&amp; !(xSchedulerRunning==1 &amp;&amp; (pxReadyTasks[i].pvOwner == pxCurrentTCB))" name="Ready_TCB" type="TCB_t" offset="pxReadyTasks[i].pvOwner"/>
220+
<readlist name="Ready_TCB" type="TCB_t" offset="pxReadyTasks[i].pvOwner" cond="!(xSchedulerRunning==1 &amp;&amp; (pxReadyTasks[i].pvOwner == pxCurrentTCB))"/>
212221
</list>
213222

214223
<!-- Process control blocks -->
@@ -221,11 +230,20 @@
221230
</calc>
222231
</list>
223232

233+
224234
<!-- Pending Ready Tasks -->
225235
<read name="xPendingReadyList" type="List_t" symbol="tasks.c/xPendingReadyList"/>
236+
237+
<!-- Determine address of first item in list, read current item and determine address of next item in list -->
238+
<calc> n = xPendingReadyList.xListEnd_pxNext; </calc>
226239

227-
<readlist cond="uxCurrentNumberOfTasks &amp;&amp; xPendingReadyList.uxNumberOfItems" name="pxPendingReadyTasks" type="ListItem_t" offset="xPendingReadyList.xListEnd_pxNext" next="pxNext"/>
240+
<list name="j" start="0" limit="xPendingReadyList.uxNumberOfItems">
241+
<readlist name="pxPendingReadyTasks" type="ListItem_t" offset="n" count="1"/>
228242

243+
<calc> n = pxPendingReadyTasks[pxPendingReadyTasks._count-1].pxNext; </calc>
244+
</list>
245+
246+
<!-- Read control blocks -->
229247
<list name="i" start="0" limit="xPendingReadyList.uxNumberOfItems">
230248
<readlist name="PendingReady_TCB" type="TCB_t" offset="pxPendingReadyTasks[i].pvOwner"/>
231249
</list>
@@ -240,12 +258,23 @@
240258
</calc>
241259
</list>
242260

261+
243262
<!-- Delayed Tasks -->
244263
<read name="DelayListAddr" type="uint32_t" symbol="tasks.c/pxDelayedTaskList"/>
264+
<read name="pxDelayedTaskList" type="List_t" offset="DelayListAddr" cond="DelayListAddr"/>
265+
266+
<!-- Determine address of first item in list, read current item and determine address of next item in list -->
267+
<calc cond="DelayListAddr">
268+
n = pxDelayedTaskList.xListEnd_pxNext;
269+
</calc>
245270

246-
<read cond="DelayListAddr" name="pxDelayedTaskList" type="List_t" offset="DelayListAddr"/>
247-
<readlist cond="DelayListAddr" name="pxDelayedTasks" type="ListItem_t" offset="pxDelayedTaskList.xListEnd_pxNext" next="pxNext"/>
271+
<list name="j" start="0" limit="pxDelayedTaskList.uxNumberOfItems" cond="DelayListAddr">
272+
<readlist name="pxDelayedTasks" type="ListItem_t" offset="n" count="1"/>
248273

274+
<calc> n = pxDelayedTasks[pxDelayedTasks._count-1].pxNext; </calc>
275+
</list>
276+
277+
<!-- Read control blocks -->
249278
<list name="i" start="0" limit="pxDelayedTaskList.uxNumberOfItems" cond="DelayListAddr">
250279
<readlist name="Delayed_TCB" type="TCB_t" offset="pxDelayedTasks[i].pvOwner"/>
251280
</list>
@@ -260,12 +289,23 @@
260289
</calc>
261290
</list>
262291

292+
263293
<!-- Overflow Delayed Tasks -->
264294
<read name="OverflowDelayListAddr" type="uint32_t" symbol="tasks.c/pxOverflowDelayedTaskList"/>
295+
<read name="pxOverflowDelayedTaskList" type="List_t" offset="OverflowDelayListAddr" cond="OverflowDelayListAddr"/>
265296

266-
<read cond="OverflowDelayListAddr" name="pxOverflowDelayedTaskList" type="List_t" offset="OverflowDelayListAddr"/>
267-
<readlist cond="OverflowDelayListAddr" name="pxOverflowDelayedTasks" type="ListItem_t" offset="pxOverflowDelayedTaskList.xListEnd_pxNext" next="pxNext"/>
297+
<!-- Determine address of first item in list, read current item and determine address of next item in list -->
298+
<calc cond="OverflowDelayListAddr">
299+
n = pxOverflowDelayedTaskList.xListEnd_pxNext;
300+
</calc>
301+
302+
<list name="j" start="0" limit="pxOverflowDelayedTaskList.uxNumberOfItems" cond="OverflowDelayListAddr">
303+
<readlist name="pxOverflowDelayedTasks" type="ListItem_t" offset="n" count="1"/>
268304

305+
<calc> n = pxOverflowDelayedTasks[pxOverflowDelayedTasks._count-1].pxNext; </calc>
306+
</list>
307+
308+
<!-- Read control blocks -->
269309
<list name="i" start="0" limit="pxOverflowDelayedTaskList.uxNumberOfItems" cond="OverflowDelayListAddr" >
270310
<readlist name="OverflowDelayed_TCB" type="TCB_t" offset="pxOverflowDelayedTasks[i].pvOwner"/>
271311
</list>
@@ -280,11 +320,20 @@
280320
</calc>
281321
</list>
282322

323+
283324
<!-- Suspended Tasks (Note: #if (INCLUDE_vTaskSuspend == 1)) -->
284325
<read name="xSuspendedTaskList" type="List_t" symbol="tasks.c/xSuspendedTaskList"/>
285326

286-
<readlist cond="uxCurrentNumberOfTasks &amp;&amp; xSuspendedTaskList.uxNumberOfItems" name="pxSuspendedTasks" type="ListItem_t" offset="xSuspendedTaskList.xListEnd_pxNext" next="pxNext"/>
327+
<!-- Determine address of first item in list, read current item and determine address of next item in list -->
328+
<calc> n = xSuspendedTaskList.xListEnd_pxNext; </calc>
287329

330+
<list name="j" start="0" limit="xSuspendedTaskList.uxNumberOfItems">
331+
<readlist name="pxSuspendedTasks" type="ListItem_t" offset="n" count="1"/>
332+
333+
<calc> n = pxSuspendedTasks[pxSuspendedTasks._count-1].pxNext; </calc>
334+
</list>
335+
336+
<!-- Read control blocks -->
288337
<list name="i" start="0" limit="xSuspendedTaskList.uxNumberOfItems">
289338
<readlist name="Suspended_TCB" type="TCB_t" offset="pxSuspendedTasks[i].pvOwner"/>
290339
</list>
@@ -299,11 +348,20 @@
299348
</calc>
300349
</list>
301350

351+
302352
<!-- Tasks Waiting Termination (Note: #if(INCLUDE_vTaskDelete == 1)) -->
303353
<read name="xTasksWaitingTermination" type="List_t" symbol="tasks.c/xTasksWaitingTermination"/>
304354

305-
<readlist cond="uxCurrentNumberOfTasks &amp;&amp; xTasksWaitingTermination.uxNumberOfItems" name="pxTasksWaitingTermination" type="ListItem_t" offset="xTasksWaitingTermination.xListEnd_pxNext" next="pxNext"/>
355+
<!-- Determine address of first item in list, read current item and determine address of next item in list -->
356+
<calc> n = xTasksWaitingTermination.xListEnd_pxNext; </calc>
357+
358+
<list name="j" start="0" limit="xTasksWaitingTermination.uxNumberOfItems">
359+
<readlist name="pxTasksWaitingTermination" type="ListItem_t" offset="n" count="1"/>
306360

361+
<calc> n = pxTasksWaitingTermination[pxTasksWaitingTermination._count-1].pxNext; </calc>
362+
</list>
363+
364+
<!-- Read control blocks -->
307365
<list name="i" start="0" limit="xTasksWaitingTermination.uxNumberOfItems">
308366
<readlist name="WaitTermination_TCB" type="TCB_t" offset="pxTasksWaitingTermination[i].pvOwner"/>
309367
</list>
@@ -318,12 +376,23 @@
318376
</calc>
319377
</list>
320378

379+
321380
<!-- Timers -->
322381
<read name="TimerListAddr" type="uint32_t" symbol="timers.c/pxCurrentTimerList"/>
323382
<read name="pxCurrentTimerList" type="List_t" offset="TimerListAddr" />
383+
384+
<!-- Determine address of first item in list, read current item and determine address of next item in list -->
385+
<calc cond="TimerListAddr">
386+
n = pxCurrentTimerList.xListEnd_pxNext;
387+
</calc>
324388

325-
<readlist cond="TimerListAddr &amp;&amp; pxCurrentTimerList.uxNumberOfItems" name="pxCurrentTimers" type="ListItem_t" offset="pxCurrentTimerList.pxIndex" next="pxNext"/>
389+
<list name="j" start="0" limit="pxCurrentTimerList.uxNumberOfItems" cond="TimerListAddr">
390+
<readlist name="pxCurrentTimers" type="ListItem_t" offset="n" count="1"/>
326391

392+
<calc> n = pxCurrentTimers[pxCurrentTimers._count-1].pxNext; </calc>
393+
</list>
394+
395+
<!-- Read control blocks -->
327396
<list name="i" start="0" limit="pxCurrentTimers._count">
328397
<readlist cond="pxCurrentTimers[i].pvOwner" name="Timer_CB" type="Timer_t" offset="pxCurrentTimers[i].pvOwner"/>
329398
</list>
@@ -344,12 +413,23 @@
344413
</list>
345414
</list>
346415

416+
347417
<!-- Overflow Timers -->
348418
<read name="OverflowTimerListAddr" type="uint32_t" symbol="timers.c/pxOverflowTimerList"/>
349419
<read name="pxOverflowTimerList" type="List_t" offset="OverflowTimerListAddr" />
350420

351-
<readlist cond="OverflowTimerListAddr &amp;&amp; pxOverflowTimerList.uxNumberOfItems" name="pxOverflowTimers" type="ListItem_t" offset="pxOverflowTimerList.pxIndex" next="pxNext"/>
421+
<!-- Determine address of first item in list, read current item and determine address of next item in list -->
422+
<calc cond="OverflowTimerListAddr">
423+
n = pxOverflowTimerList.xListEnd_pxNext;
424+
</calc>
425+
426+
<list name="j" start="0" limit="pxOverflowTimerList.uxNumberOfItems" cond="OverflowTimerListAddr">
427+
<readlist name="pxOverflowTimers" type="ListItem_t" offset="n" count="1"/>
352428

429+
<calc> n = pxOverflowTimers[pxOverflowTimers._count-1].pxNext; </calc>
430+
</list>
431+
432+
<!-- Read control blocks -->
353433
<list name="i" start="0" limit="pxOverflowTimers._count">
354434
<readlist cond="pxOverflowTimers[i].pvOwner" name="OverflowTimer_CB" type="Timer_t" offset="pxOverflowTimers[i].pvOwner"/>
355435
</list>
@@ -369,7 +449,8 @@
369449
</calc>
370450
</list>
371451
</list>
372-
452+
453+
373454
<!-- Read Queue Registry (Queues, Semaphores, Mutexes) -->
374455
<calc cond="__Symbol_exists (&quot;queue.c/xQueueRegistry&quot;)">
375456
Queue_REG_Size = __size_of (&quot;queue.c/xQueueRegistry&quot;);

0 commit comments

Comments
 (0)