feat: publish FreeRTOS C FC02 card

This commit is contained in:
2026-07-19 16:36:02 +02:00
commit e3420748ee
208 changed files with 57240 additions and 0 deletions
+18
View File
@@ -0,0 +1,18 @@
@startuml
!include card-uml-style.iuml
scale 620 width
top to bottom direction
class "01 Application C\ntask01_first_task.c" as Application <<layer>>
class "02 FreeRTOS C API\nTaskFunction_t · xTaskCreate" as CAPI <<boundary>>
class "03 Kernel + RV32I port\nscheduler · tick · heap_4\nHazard3 CPU" as Runtime <<runtime>>
Application --> CAPI : requests tasks
CAPI --> Runtime : owns scheduling
note right of CAPI
Public C contract.
Application does not depend
on TCB internals.
end note
@enduml
+93
View File
@@ -0,0 +1,93 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" contentScriptType="application/ecmascript" contentStyleType="text/css" height="477.3551px" preserveAspectRatio="none" style="width:613px;height:477px;" version="1.1" viewBox="0 0 613 477" width="613.2609px" zoomAndPan="magnify"><defs/><g><!--MD5=[0b4e4b4980470ea387cc45de9bd14b5b]
class Application--><rect fill="#F5F8FA" height="91.7943" id="Application" style="stroke: #607985; stroke-width: 1.6847826086956523;" width="213.4058" x="51.6667" y="9.3899"/><text fill="#526B77" font-family="DejaVu Sans Mono" font-size="12.3551" font-style="italic" lengthAdjust="spacingAndGlyphs" textLength="55.0362" x="130.8514" y="33.2132">«layer»</text><text fill="#1F3039" font-family="DejaVu Sans Mono" font-size="16.8478" lengthAdjust="spacingAndGlyphs" textLength="171.8478" x="72.4457" y="65.2438">01 Application C</text><text fill="#1F3039" font-family="DejaVu Sans Mono" font-size="16.8478" lengthAdjust="spacingAndGlyphs" textLength="192.0652" x="62.337" y="84.8557">task01_first_task.c</text><!--MD5=[f9750b3f2f09b0a9be86a744d1742330]
class CAPI--><rect fill="#F5F8FA" height="91.7943" id="CAPI" style="stroke: #607985; stroke-width: 1.6847826086956523;" width="303.2609" x="6.7391" y="182.0576"/><text fill="#526B77" font-family="DejaVu Sans Mono" font-size="12.3551" font-style="italic" lengthAdjust="spacingAndGlyphs" textLength="78.6232" x="119.058" y="205.8809">«boundary»</text><text fill="#1F3039" font-family="DejaVu Sans Mono" font-size="16.8478" lengthAdjust="spacingAndGlyphs" textLength="181.9565" x="67.3913" y="237.9116">02 FreeRTOS C API</text><text fill="#1F3039" font-family="DejaVu Sans Mono" font-size="16.8478" lengthAdjust="spacingAndGlyphs" textLength="283.0435" x="16.8478" y="257.5235">TaskFunction_t · xTaskCreate</text><!--MD5=[a56a186a64fdd59048237ee22fac1723]
class Runtime--><rect fill="#F5F8FA" height="111.4063" id="Runtime" style="stroke: #607985; stroke-width: 1.6847826086956523;" width="272.9348" x="21.9022" y="354.7141"/><text fill="#526B77" font-family="DejaVu Sans Mono" font-size="12.3551" font-style="italic" lengthAdjust="spacingAndGlyphs" textLength="70.7609" x="122.9891" y="378.5375">«runtime»</text><text fill="#1F3039" font-family="DejaVu Sans Mono" font-size="16.8478" lengthAdjust="spacingAndGlyphs" textLength="232.5" x="42.1196" y="410.5681">03 Kernel + RV32I port</text><text fill="#1F3039" font-family="DejaVu Sans Mono" font-size="16.8478" lengthAdjust="spacingAndGlyphs" textLength="252.7174" x="32.0109" y="430.18">scheduler · tick · heap_4</text><text fill="#1F3039" font-family="DejaVu Sans Mono" font-size="16.8478" lengthAdjust="spacingAndGlyphs" textLength="111.1957" x="102.7717" y="449.7919">Hazard3 CPU</text><path d="M350.4348,192.0652 L350.4348,223.4583 L310.5504,227.9511 L350.4348,232.4438 L350.4348,263.844 A0,0 0 0 0 350.4348,263.844 L599.7826,263.844 A0,0 0 0 0 599.7826,263.844 L599.7826,203.2971 L588.5507,192.0652 L350.4348,192.0652 A0,0 0 0 0 350.4348,192.0652 " fill="#F7F5ED" style="stroke: #8A887C; stroke-width: 1.1231884057971016;"/><path d="M588.5507,192.0652 L588.5507,203.2971 L599.7826,203.2971 L588.5507,192.0652 " fill="#F7F5ED" style="stroke: #8A887C; stroke-width: 1.1231884057971016;"/><text fill="#3E4B50" font-family="DejaVu Sans Mono" font-size="13.4783" lengthAdjust="spacingAndGlyphs" textLength="141.5217" x="363.913" y="216.9311">Public C contract.</text><text fill="#3E4B50" font-family="DejaVu Sans Mono" font-size="13.4783" lengthAdjust="spacingAndGlyphs" textLength="212.2826" x="363.913" y="232.6207">Application does not depend</text><text fill="#3E4B50" font-family="DejaVu Sans Mono" font-size="13.4783" lengthAdjust="spacingAndGlyphs" textLength="133.6594" x="363.913" y="248.3102">on TCB internals.</text><!--MD5=[e3b7ec1ac52dd22be1ed790126c7e198]
link Application to CAPI--><path d="M158.3696,101.6261 C158.3696,124.0562 158.3696,151.271 158.3696,174.5884 " fill="none" id="Application-&gt;CAPI" style="stroke: #607985; stroke-width: 1.4601449275362322;"/><polygon fill="#607985" points="158.3696,179.9909,162.8623,169.8822,158.3696,174.375,153.8768,169.8822,158.3696,179.9909" style="stroke: #607985; stroke-width: 1.4601449275362322;"/><text fill="#425B67" font-family="DejaVu Sans Mono" font-size="15.7246" lengthAdjust="spacingAndGlyphs" textLength="125.7971" x="166.2319" y="147.2333">requests tasks</text><!--MD5=[baa772a5f496014bf0b81eeab2506b5b]
link CAPI to Runtime--><path d="M158.3696,274.0917 C158.3696,296.196 158.3696,323.1862 158.3696,347.2225 " fill="none" id="CAPI-&gt;Runtime" style="stroke: #607985; stroke-width: 1.4601449275362322;"/><polygon fill="#607985" points="158.3696,352.5464,162.8623,342.4377,158.3696,346.9304,153.8768,342.4377,158.3696,352.5464" style="stroke: #607985; stroke-width: 1.4601449275362322;"/><text fill="#425B67" font-family="DejaVu Sans Mono" font-size="15.7246" lengthAdjust="spacingAndGlyphs" textLength="134.7826" x="166.2319" y="319.8898">owns scheduling</text><!--MD5=[8767280e6fafb101c08fb239bf4ae53d]
@startuml
skinparam backgroundColor white
skinparam shadowing false
skinparam monochrome false
skinparam defaultFontName "DejaVu Sans Mono"
skinparam defaultFontSize 14
skinparam defaultFontColor #24343D
skinparam titleFontName "DejaVu Sans Mono"
skinparam titleFontSize 13
skinparam titleFontColor #536B78
skinparam titleFontStyle plain
skinparam ArrowColor #607985
skinparam ArrowFontColor #425B67
skinparam ArrowThickness 1.3
skinparam LineThickness 1.3
skinparam nodesep 36
skinparam ranksep 42
skinparam Padding 6
skinparam classBackgroundColor #F5F8FA
skinparam classBorderColor #607985
skinparam classBorderThickness 1.5
skinparam classFontColor #1F3039
skinparam classFontSize 15
skinparam classAttributeFontColor #2E424D
skinparam classAttributeFontSize 13
skinparam classStereotypeFontColor #526B77
skinparam classStereotypeFontSize 11
skinparam minClassWidth 190
skinparam ClassAttributeIconSize 0
skinparam stateBackgroundColor #F5F8FA
skinparam stateBorderColor #607985
skinparam stateBorderThickness 1.5
skinparam stateFontColor #1F3039
skinparam stateFontSize 14
skinparam stateAttributeFontSize 13
skinparam noteBackgroundColor #F7F5ED
skinparam noteBorderColor #8A887C
skinparam noteFontColor #3E4B50
skinparam noteFontSize 12
skinparam ParticipantBackgroundColor #F5F8FA
skinparam ParticipantBorderColor #607985
skinparam ParticipantBorderThickness 1.5
skinparam ParticipantFontColor #1F3039
skinparam ParticipantFontSize 13
skinparam ActorBorderColor #607985
skinparam ActorFontColor #1F3039
skinparam LifeLineBorderColor #8297A1
skinparam LifeLineBackgroundColor #F9FBFC
skinparam SequenceArrowColor #607985
skinparam SequenceMessageAlign center
skinparam ParticipantPadding 18
skinparam BoxPadding 8
hide circle
hide empty members
scale 620 width
top to bottom direction
class "01 Application C\ntask01_first_task.c" as Application <<layer>>
class "02 FreeRTOS C API\nTaskFunction_t · xTaskCreate" as CAPI <<boundary>>
class "03 Kernel + RV32I port\nscheduler · tick · heap_4\nHazard3 CPU" as Runtime <<runtime>>
Application - -> CAPI : requests tasks
CAPI - -> Runtime : owns scheduling
note right of CAPI
Public C contract.
Application does not depend
on TCB internals.
end note
@enduml
PlantUML version 1.2020.02(Sun Mar 01 11:22:07 CET 2020)
(GPL source distribution)
Java Runtime: OpenJDK Runtime Environment
JVM: OpenJDK 64-Bit Server VM
Java Version: 25.0.4-ea+4-1-Debian
Operating System: Linux
Default Encoding: UTF-8
Language: en
Country: null
--></g></svg>

After

Width:  |  Height:  |  Size: 7.5 KiB

+62
View File
@@ -0,0 +1,62 @@
@startuml
!include card-uml-style.iuml
scale 900 width
left to right direction
class "01 WorkerContext" as Worker {
+id : uint32_t
+result : volatile uint32_t
+iterations : volatile uint32_t
+trace_state : WorkerTraceState
+02 handle : TaskHandle_t
+created_handle : uintptr_t
+start_tick / end_tick : TickType_t
+tcb_address : uintptr_t
+stack_low / stack_high : uintptr_t
+entry_sp : uintptr_t
}
class "03 static contexts" as Contexts <<data>> {
g_worker_a : WorkerContext
g_worker_b : WorkerContext
lifetime = whole program
}
class "04 C entry functions" as Entries <<C ABI>> {
sum_task_entry(void*)
supervisor_task_entry(void*)
create_worker(WorkerContext*)
}
class "05 SupervisorContext" as Supervisor {
first : WorkerContext*
second : WorkerContext*
handle : TaskHandle_t
pass : volatile uint32_t
}
class "06 common invariants" as Invariants <<contract>> {
result A = result B = 200010000
iterations A = iterations B = 20000
trace contains A -> B -> A
}
class "heap_4" as Heap <<runtime>> {
TCB A / TCB B
stack A / stack B
supervisor TCB + stack
}
Contexts *-- Worker : contains two
Supervisor o-- Worker : observes
Entries --> Worker : typed context
Entries --> Supervisor : typed context
Worker --> Heap : handle value identifies TCB
Supervisor --> Invariants : verifies
note bottom of Worker
Context is application-owned storage.
&handle is a field address; handle is its value.
Neither is the separate task-stack block.
end note
@enduml
+144
View File
@@ -0,0 +1,144 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" contentScriptType="application/ecmascript" contentStyleType="text/css" height="338.9189px" preserveAspectRatio="none" style="width:896px;height:338px;" version="1.1" viewBox="0 0 896 338" width="896.2162px" zoomAndPan="magnify"><defs/><g><!--MD5=[7b5bd88a8a025decccf0c9eac4aaabe9]
class Worker--><rect fill="#F5F8FA" height="172.3184" id="Worker" style="stroke: #607985; stroke-width: 0.8108108108108109;" width="164.3243" x="453.2432" y="4.2"/><text fill="#1F3039" font-family="DejaVu Sans Mono" font-size="8.1081" lengthAdjust="spacingAndGlyphs" textLength="82.7027" x="494.0541" y="17.6721">01 WorkerContext</text><line style="stroke: #607985; stroke-width: 0.8108108108108109;" x1="453.7838" x2="617.027" y1="25.5302" y2="25.5302"/><text fill="#2E424D" font-family="DejaVu Sans Mono" font-size="7.027" lengthAdjust="spacingAndGlyphs" textLength="60.5405" x="459.7297" y="37.4583">+id : uint32_t</text><text fill="#2E424D" font-family="DejaVu Sans Mono" font-size="7.027" lengthAdjust="spacingAndGlyphs" textLength="116.7568" x="459.7297" y="52.1247">+result : volatile uint32_t</text><text fill="#2E424D" font-family="DejaVu Sans Mono" font-size="7.027" lengthAdjust="spacingAndGlyphs" textLength="134.0541" x="459.7297" y="66.7911">+iterations : volatile uint32_t</text><text fill="#2E424D" font-family="DejaVu Sans Mono" font-size="7.027" lengthAdjust="spacingAndGlyphs" textLength="134.0541" x="459.7297" y="81.4574">+trace_state : WorkerTraceState</text><text fill="#2E424D" font-family="DejaVu Sans Mono" font-size="7.027" lengthAdjust="spacingAndGlyphs" textLength="108.1081" x="459.7297" y="96.1238">+02 handle : TaskHandle_t</text><text fill="#2E424D" font-family="DejaVu Sans Mono" font-size="7.027" lengthAdjust="spacingAndGlyphs" textLength="116.7568" x="459.7297" y="110.7902">+created_handle : uintptr_t</text><text fill="#2E424D" font-family="DejaVu Sans Mono" font-size="7.027" lengthAdjust="spacingAndGlyphs" textLength="151.3514" x="459.7297" y="125.4566">+start_tick / end_tick : TickType_t</text><text fill="#2E424D" font-family="DejaVu Sans Mono" font-size="7.027" lengthAdjust="spacingAndGlyphs" textLength="103.7838" x="459.7297" y="140.123">+tcb_address : uintptr_t</text><text fill="#2E424D" font-family="DejaVu Sans Mono" font-size="7.027" lengthAdjust="spacingAndGlyphs" textLength="151.3514" x="459.7297" y="154.7894">+stack_low / stack_high : uintptr_t</text><text fill="#2E424D" font-family="DejaVu Sans Mono" font-size="7.027" lengthAdjust="spacingAndGlyphs" textLength="90.8108" x="459.7297" y="169.4558">+entry_sp : uintptr_t</text><!--MD5=[e0ad55b29637cf127d65177e32583e01]
class Contexts--><rect fill="#F5F8FA" height="83.0617" id="Contexts" style="stroke: #607985; stroke-width: 0.8108108108108109;" width="125.4054" x="228.1081" y="10.4541"/><text fill="#526B77" font-family="DejaVu Sans Mono" font-size="5.9459" font-style="italic" lengthAdjust="spacingAndGlyphs" textLength="22.7027" x="279.4595" y="21.9192">«data»</text><text fill="#1F3039" font-family="DejaVu Sans Mono" font-size="8.1081" lengthAdjust="spacingAndGlyphs" textLength="92.4324" x="244.5946" y="37.3341">03 static contexts</text><line style="stroke: #607985; stroke-width: 0.8108108108108109;" x1="228.6486" x2="352.973" y1="45.1922" y2="45.1922"/><text fill="#2E424D" font-family="DejaVu Sans Mono" font-size="7.027" lengthAdjust="spacingAndGlyphs" textLength="112.4324" x="234.5946" y="57.1203">g_worker_a : WorkerContext</text><text fill="#2E424D" font-family="DejaVu Sans Mono" font-size="7.027" lengthAdjust="spacingAndGlyphs" textLength="112.4324" x="234.5946" y="71.7867">g_worker_b : WorkerContext</text><text fill="#2E424D" font-family="DejaVu Sans Mono" font-size="7.027" lengthAdjust="spacingAndGlyphs" textLength="103.7838" x="234.5946" y="86.4531">lifetime = whole program</text><!--MD5=[d356c8aee395c51644a6e46295a3cd9b]
class Entries--><rect fill="#F5F8FA" height="83.0617" id="Entries" style="stroke: #607985; stroke-width: 0.8108108108108109;" width="138.3784" x="3.2432" y="128.2919"/><text fill="#526B77" font-family="DejaVu Sans Mono" font-size="5.9459" font-style="italic" lengthAdjust="spacingAndGlyphs" textLength="26.4865" x="59.1892" y="139.757">«C ABI»</text><text fill="#1F3039" font-family="DejaVu Sans Mono" font-size="8.1081" lengthAdjust="spacingAndGlyphs" textLength="102.1622" x="21.3514" y="155.1719">04 C entry functions</text><line style="stroke: #607985; stroke-width: 0.8108108108108109;" x1="3.7838" x2="141.0811" y1="163.0301" y2="163.0301"/><text fill="#2E424D" font-family="DejaVu Sans Mono" font-size="7.027" lengthAdjust="spacingAndGlyphs" textLength="90.8108" x="9.7297" y="174.9581">sum_task_entry(void*)</text><text fill="#2E424D" font-family="DejaVu Sans Mono" font-size="7.027" lengthAdjust="spacingAndGlyphs" textLength="121.0811" x="9.7297" y="189.6245">supervisor_task_entry(void*)</text><text fill="#2E424D" font-family="DejaVu Sans Mono" font-size="7.027" lengthAdjust="spacingAndGlyphs" textLength="125.4054" x="9.7297" y="204.2909">create_worker(WorkerContext*)</text><!--MD5=[4f126f465601d391fe0c3c00f8b450b3]
class Supervisor--><rect fill="#F5F8FA" height="84.3201" id="Supervisor" style="stroke: #607985; stroke-width: 0.8108108108108109;" width="116.7568" x="232.4324" y="168.2"/><text fill="#1F3039" font-family="DejaVu Sans Mono" font-size="8.1081" lengthAdjust="spacingAndGlyphs" textLength="102.1622" x="239.7297" y="181.6721">05 SupervisorContext</text><line style="stroke: #607985; stroke-width: 0.8108108108108109;" x1="232.973" x2="348.6486" y1="189.5302" y2="189.5302"/><text fill="#2E424D" font-family="DejaVu Sans Mono" font-size="7.027" lengthAdjust="spacingAndGlyphs" textLength="95.1351" x="238.9189" y="201.4583">first : WorkerContext*</text><text fill="#2E424D" font-family="DejaVu Sans Mono" font-size="7.027" lengthAdjust="spacingAndGlyphs" textLength="99.4595" x="238.9189" y="216.1247">second : WorkerContext*</text><text fill="#2E424D" font-family="DejaVu Sans Mono" font-size="7.027" lengthAdjust="spacingAndGlyphs" textLength="90.8108" x="238.9189" y="230.7911">handle : TaskHandle_t</text><text fill="#2E424D" font-family="DejaVu Sans Mono" font-size="7.027" lengthAdjust="spacingAndGlyphs" textLength="103.7838" x="238.9189" y="245.4574">pass : volatile uint32_t</text><!--MD5=[3c1aae6a6af91a00aebe86d2dd4d752e]
class Invariants--><rect fill="#F5F8FA" height="83.0617" id="Invariants" style="stroke: #607985; stroke-width: 0.8108108108108109;" width="164.3243" x="453.2432" y="249.9135"/><text fill="#526B77" font-family="DejaVu Sans Mono" font-size="5.9459" font-style="italic" lengthAdjust="spacingAndGlyphs" textLength="37.8378" x="516.4865" y="261.3786">«contract»</text><text fill="#1F3039" font-family="DejaVu Sans Mono" font-size="8.1081" lengthAdjust="spacingAndGlyphs" textLength="102.1622" x="484.3243" y="276.7935">06 common invariants</text><line style="stroke: #607985; stroke-width: 0.8108108108108109;" x1="453.7838" x2="617.027" y1="284.6517" y2="284.6517"/><text fill="#2E424D" font-family="DejaVu Sans Mono" font-size="7.027" lengthAdjust="spacingAndGlyphs" textLength="134.0541" x="459.7297" y="296.5797">result A = result B = 200010000</text><text fill="#2E424D" font-family="DejaVu Sans Mono" font-size="7.027" lengthAdjust="spacingAndGlyphs" textLength="151.3514" x="459.7297" y="311.2461">iterations A = iterations B = 20000</text><text fill="#2E424D" font-family="DejaVu Sans Mono" font-size="7.027" lengthAdjust="spacingAndGlyphs" textLength="112.4324" x="459.7297" y="325.9125">trace contains A -&gt; B -&gt; A</text><!--MD5=[e9f17e4922be6079066fa450c8bff6eb]
class Heap--><rect fill="#F5F8FA" height="83.0617" id="Heap" style="stroke: #607985; stroke-width: 0.8108108108108109;" width="108.1081" x="782.1622" y="48.8324"/><text fill="#526B77" font-family="DejaVu Sans Mono" font-size="5.9459" font-style="italic" lengthAdjust="spacingAndGlyphs" textLength="34.0541" x="819.1892" y="60.2975">«runtime»</text><text fill="#1F3039" font-family="DejaVu Sans Mono" font-size="8.1081" lengthAdjust="spacingAndGlyphs" textLength="29.1892" x="821.6216" y="75.7124">heap_4</text><line style="stroke: #607985; stroke-width: 0.8108108108108109;" x1="782.7027" x2="889.7297" y1="83.5706" y2="83.5706"/><text fill="#2E424D" font-family="DejaVu Sans Mono" font-size="7.027" lengthAdjust="spacingAndGlyphs" textLength="56.2162" x="788.6486" y="95.4987">TCB A / TCB B</text><text fill="#2E424D" font-family="DejaVu Sans Mono" font-size="7.027" lengthAdjust="spacingAndGlyphs" textLength="73.5135" x="788.6486" y="110.165">stack A / stack B</text><text fill="#2E424D" font-family="DejaVu Sans Mono" font-size="7.027" lengthAdjust="spacingAndGlyphs" textLength="95.1351" x="788.6486" y="124.8314">supervisor TCB + stack</text><path d="M435.6757,195.7892 L435.6757,230.3331 A0,0 0 0 0 435.6757,230.3331 L635.1351,230.3331 A0,0 0 0 0 635.1351,230.3331 L635.1351,201.1946 L629.7297,195.7892 L537.5676,195.7892 L535.4054,176.6649 L533.2432,195.7892 L435.6757,195.7892 A0,0 0 0 0 435.6757,195.7892 " fill="#F7F5ED" style="stroke: #8A887C; stroke-width: 0.5405405405405406;"/><path d="M629.7297,195.7892 L629.7297,201.1946 L635.1351,201.1946 L629.7297,195.7892 " fill="#F7F5ED" style="stroke: #8A887C; stroke-width: 0.5405405405405406;"/><text fill="#3E4B50" font-family="DejaVu Sans Mono" font-size="6.4865" lengthAdjust="spacingAndGlyphs" textLength="140" x="442.1622" y="207.756">Context is application-owned storage.</text><text fill="#3E4B50" font-family="DejaVu Sans Mono" font-size="6.4865" lengthAdjust="spacingAndGlyphs" textLength="181.6216" x="442.1622" y="215.3067">&amp;handle is a field address; handle is its value.</text><text fill="#3E4B50" font-family="DejaVu Sans Mono" font-size="6.4865" lengthAdjust="spacingAndGlyphs" textLength="155.1351" x="442.1622" y="222.8574">Neither is the separate task-stack block.</text><!--MD5=[77eb6e05bec067ba2b628dcc54dd7b08]
reverse link Contexts to Worker--><path d="M361.4919,63.0378 C390.1027,67.5459 423.3838,72.7892 453.0919,77.4757 " fill="none" id="Contexts&lt;-Worker" style="stroke: #607985; stroke-width: 0.7027027027027027;"/><polygon fill="#607985" points="354.5568,61.9459,357.4254,64.585,360.9647,62.9521,358.0961,60.313,354.5568,61.9459" style="stroke: #607985; stroke-width: 0.7027027027027027;"/><text fill="#425B67" font-family="DejaVu Sans Mono" font-size="7.5676" lengthAdjust="spacingAndGlyphs" textLength="51.8919" x="368.6486" y="58.9865">contains two</text><!--MD5=[0a09065219b8fc4c2741fad6d91ed526]
reverse link Supervisor to Worker--><path d="M356.7297,188.9838 C378.6324,181.0162 402.9189,171.2919 424.3243,160.6324 C433.8432,155.8919 443.5676,150.5405 453.1135,144.9568 " fill="none" id="Supervisor&lt;-Worker" style="stroke: #607985; stroke-width: 0.7027027027027027;"/><polygon fill="#FFFFFF" points="350.173,191.3405,353.9557,192.2809,356.2787,189.1508,352.4959,188.2104,350.173,191.3405" style="stroke: #607985; stroke-width: 0.7027027027027027;"/><text fill="#425B67" font-family="DejaVu Sans Mono" font-size="7.5676" lengthAdjust="spacingAndGlyphs" textLength="34.5946" x="377.2973" y="155.2244">observes</text><!--MD5=[2c6bfd4e3ad4845782e2d985564dafc6]
link Entries to Worker--><path d="M141.8757,157.9676 C223.9351,143.8486 361.0162,120.2703 449.6595,105.0162 " fill="none" id="Entries-&gt;Worker" style="stroke: #607985; stroke-width: 0.7027027027027027;"/><polygon fill="#607985" points="452.2486,104.573,447.0889,103.2618,449.5846,105.0286,447.8179,107.5243,452.2486,104.573" style="stroke: #607985; stroke-width: 0.7027027027027027;"/><text fill="#425B67" font-family="DejaVu Sans Mono" font-size="7.5676" lengthAdjust="spacingAndGlyphs" textLength="56.2162" x="262.7027" y="116.7865">typed context</text><!--MD5=[f79e6be81bdb53c12d9f736eae846aaf]
link Entries to Supervisor--><path d="M141.8757,182.6757 C169.773,187.8811 201.7189,193.8378 228.8108,198.8973 " fill="none" id="Entries-&gt;Supervisor" style="stroke: #607985; stroke-width: 0.7027027027027027;"/><polygon fill="#607985" points="231.4541,199.3892,227.0752,196.3614,228.7983,198.8874,226.2723,200.6105,231.4541,199.3892" style="stroke: #607985; stroke-width: 0.7027027027027027;"/><text fill="#425B67" font-family="DejaVu Sans Mono" font-size="7.5676" lengthAdjust="spacingAndGlyphs" textLength="56.2162" x="156.7568" y="179.8568">typed context</text><!--MD5=[50e4ee6a0204c339eccdd06d48720435]
link Worker to Heap--><path d="M617.6486,90.3622 C668.5838,90.3622 732.8703,90.3622 778.4,90.3622 " fill="none" id="Worker-&gt;Heap" style="stroke: #607985; stroke-width: 0.7027027027027027;"/><polygon fill="#607985" points="781.1027,90.3622,776.2378,88.2,778.4,90.3622,776.2378,92.5243,781.1027,90.3622" style="stroke: #607985; stroke-width: 0.7027027027027027;"/><text fill="#425B67" font-family="DejaVu Sans Mono" font-size="7.5676" lengthAdjust="spacingAndGlyphs" textLength="116.7568" x="650.2703" y="84.9541">handle value identifies TCB</text><!--MD5=[b5aa81ced6422ec50f89e7cce099c4d3]
link Supervisor to Invariants--><path d="M349.3676,229.6811 C379.4216,239.6865 416.6811,252.0919 449.9081,263.1568 " fill="none" id="Supervisor-&gt;Invariants" style="stroke: #607985; stroke-width: 0.7027027027027027;"/><polygon fill="#607985" points="452.3351,263.9622,448.3972,260.3797,449.7696,263.1121,447.0371,264.4845,452.3351,263.9622" style="stroke: #607985; stroke-width: 0.7027027027027027;"/><text fill="#425B67" font-family="DejaVu Sans Mono" font-size="7.5676" lengthAdjust="spacingAndGlyphs" textLength="34.5946" x="377.2973" y="231.1811">verifies</text><!--MD5=[bd196756b6337a178e85cd39afe76fb8]
@startuml
skinparam backgroundColor white
skinparam shadowing false
skinparam monochrome false
skinparam defaultFontName "DejaVu Sans Mono"
skinparam defaultFontSize 14
skinparam defaultFontColor #24343D
skinparam titleFontName "DejaVu Sans Mono"
skinparam titleFontSize 13
skinparam titleFontColor #536B78
skinparam titleFontStyle plain
skinparam ArrowColor #607985
skinparam ArrowFontColor #425B67
skinparam ArrowThickness 1.3
skinparam LineThickness 1.3
skinparam nodesep 36
skinparam ranksep 42
skinparam Padding 6
skinparam classBackgroundColor #F5F8FA
skinparam classBorderColor #607985
skinparam classBorderThickness 1.5
skinparam classFontColor #1F3039
skinparam classFontSize 15
skinparam classAttributeFontColor #2E424D
skinparam classAttributeFontSize 13
skinparam classStereotypeFontColor #526B77
skinparam classStereotypeFontSize 11
skinparam minClassWidth 190
skinparam ClassAttributeIconSize 0
skinparam stateBackgroundColor #F5F8FA
skinparam stateBorderColor #607985
skinparam stateBorderThickness 1.5
skinparam stateFontColor #1F3039
skinparam stateFontSize 14
skinparam stateAttributeFontSize 13
skinparam noteBackgroundColor #F7F5ED
skinparam noteBorderColor #8A887C
skinparam noteFontColor #3E4B50
skinparam noteFontSize 12
skinparam ParticipantBackgroundColor #F5F8FA
skinparam ParticipantBorderColor #607985
skinparam ParticipantBorderThickness 1.5
skinparam ParticipantFontColor #1F3039
skinparam ParticipantFontSize 13
skinparam ActorBorderColor #607985
skinparam ActorFontColor #1F3039
skinparam LifeLineBorderColor #8297A1
skinparam LifeLineBackgroundColor #F9FBFC
skinparam SequenceArrowColor #607985
skinparam SequenceMessageAlign center
skinparam ParticipantPadding 18
skinparam BoxPadding 8
hide circle
hide empty members
scale 900 width
left to right direction
class "01 WorkerContext" as Worker {
+id : uint32_t
+result : volatile uint32_t
+iterations : volatile uint32_t
+trace_state : WorkerTraceState
+02 handle : TaskHandle_t
+created_handle : uintptr_t
+start_tick / end_tick : TickType_t
+tcb_address : uintptr_t
+stack_low / stack_high : uintptr_t
+entry_sp : uintptr_t
}
class "03 static contexts" as Contexts <<data>> {
g_worker_a : WorkerContext
g_worker_b : WorkerContext
lifetime = whole program
}
class "04 C entry functions" as Entries <<C ABI>> {
sum_task_entry(void*)
supervisor_task_entry(void*)
create_worker(WorkerContext*)
}
class "05 SupervisorContext" as Supervisor {
first : WorkerContext*
second : WorkerContext*
handle : TaskHandle_t
pass : volatile uint32_t
}
class "06 common invariants" as Invariants <<contract>> {
result A = result B = 200010000
iterations A = iterations B = 20000
trace contains A -> B -> A
}
class "heap_4" as Heap <<runtime>> {
TCB A / TCB B
stack A / stack B
supervisor TCB + stack
}
Contexts *- - Worker : contains two
Supervisor o- - Worker : observes
Entries - -> Worker : typed context
Entries - -> Supervisor : typed context
Worker - -> Heap : handle value identifies TCB
Supervisor - -> Invariants : verifies
note bottom of Worker
Context is application-owned storage.
&handle is a field address; handle is its value.
Neither is the separate task-stack block.
end note
@enduml
PlantUML version 1.2020.02(Sun Mar 01 11:22:07 CET 2020)
(GPL source distribution)
Java Runtime: OpenJDK Runtime Environment
JVM: OpenJDK 64-Bit Server VM
Java Version: 25.0.4-ea+4-1-Debian
Operating System: Linux
Default Encoding: UTF-8
Language: en
Country: null
--></g></svg>

After

Width:  |  Height:  |  Size: 17 KiB

+23
View File
@@ -0,0 +1,23 @@
@startuml
!include card-uml-style.iuml
scale 900 width
top to bottom direction
class "01 TaskFunction_t\nvoid (*)(void*)" as Callback <<C ABI>>
class "02 xTaskCreate\nentry + &workerA" as Create <<boundary>>
class "03 callback entry\na0 = pvParameters" as Entry <<runtime>>
class "04 typed pointer\nWorkerContext *worker =\n(WorkerContext *)pvParameters" as Cast <<C>>
class "05 typed calculation\nworker->result = sum" as Work <<application>>
class "06 wrong-cast exhibit\nC cannot verify context type" as Hazard <<compile-time check>>
Callback -right-> Create : accepted signature
Create -right-> Entry : scheduler dispatch
Entry -down-> Cast : same address
Cast -left-> Work : typed fields
Work -left-> Hazard : contrast: unchecked cast
note bottom of Entry
RV32 ILP32 ABI carries the first callback argument in a0.
The explicit C cast documents intent; it performs no type check.
end note
@enduml
+104
View File
@@ -0,0 +1,104 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" contentScriptType="application/ecmascript" contentStyleType="text/css" height="144.7478px" preserveAspectRatio="none" style="width:896px;height:144px;" version="1.1" viewBox="0 0 896 144" width="896.2611px" zoomAndPan="magnify"><defs/><g><!--MD5=[687e0e93109a4e3b835e34cee365dc7c]
class Callback--><rect fill="#F5F8FA" height="43.6522" id="Callback" style="stroke: #607985; stroke-width: 0.8011869436201781;" width="101.4837" x="227.5371" y="4.3211"/><text fill="#526B77" font-family="DejaVu Sans Mono" font-size="5.8754" font-style="italic" lengthAdjust="spacingAndGlyphs" textLength="26.1721" x="265.1929" y="15.6501">«C ABI»</text><text fill="#1F3039" font-family="DejaVu Sans Mono" font-size="8.0119" lengthAdjust="spacingAndGlyphs" textLength="86.5282" x="235.0148" y="30.882">01 TaskFunction_t</text><text fill="#1F3039" font-family="DejaVu Sans Mono" font-size="8.0119" lengthAdjust="spacingAndGlyphs" textLength="72.1068" x="242.2255" y="40.2083">void (*)(void*)</text><!--MD5=[af7d543b6251b12f84b8a2da20750b1a]
class Create--><rect fill="#F5F8FA" height="43.6522" id="Create" style="stroke: #607985; stroke-width: 0.8011869436201781;" width="101.4837" x="432.6409" y="4.3211"/><text fill="#526B77" font-family="DejaVu Sans Mono" font-size="5.8754" font-style="italic" lengthAdjust="spacingAndGlyphs" textLength="37.3887" x="464.6884" y="15.6501">«boundary»</text><text fill="#1F3039" font-family="DejaVu Sans Mono" font-size="8.0119" lengthAdjust="spacingAndGlyphs" textLength="72.1068" x="447.3294" y="30.882">02 xTaskCreate</text><text fill="#1F3039" font-family="DejaVu Sans Mono" font-size="8.0119" lengthAdjust="spacingAndGlyphs" textLength="76.9139" x="444.9258" y="40.2083">entry + &amp;workerA</text><!--MD5=[96293e8b231702a792e4ba32419ac2da]
class Entry--><rect fill="#F5F8FA" height="43.6522" id="Entry" style="stroke: #607985; stroke-width: 0.8011869436201781;" width="101.4837" x="637.7448" y="4.3211"/><text fill="#526B77" font-family="DejaVu Sans Mono" font-size="5.8754" font-style="italic" lengthAdjust="spacingAndGlyphs" textLength="33.6499" x="671.6617" y="15.6501">«runtime»</text><text fill="#1F3039" font-family="DejaVu Sans Mono" font-size="8.0119" lengthAdjust="spacingAndGlyphs" textLength="86.5282" x="645.2226" y="30.882">03 callback entry</text><text fill="#1F3039" font-family="DejaVu Sans Mono" font-size="8.0119" lengthAdjust="spacingAndGlyphs" textLength="81.7211" x="647.6261" y="40.2083">a0 = pvParameters</text><!--MD5=[b8828fe7ac3f9c4eb842b546e8e5efdc]
class Cast--><rect fill="#F5F8FA" height="52.9785" id="Cast" style="stroke: #607985; stroke-width: 0.8011869436201781;" width="149.0208" x="464.9555" y="86.4267"/><text fill="#526B77" font-family="DejaVu Sans Mono" font-size="5.8754" font-style="italic" lengthAdjust="spacingAndGlyphs" textLength="11.2166" x="533.8576" y="97.7557">«C»</text><text fill="#1F3039" font-family="DejaVu Sans Mono" font-size="8.0119" lengthAdjust="spacingAndGlyphs" textLength="81.7211" x="498.6053" y="112.9877">04 typed pointer</text><text fill="#1F3039" font-family="DejaVu Sans Mono" font-size="8.0119" lengthAdjust="spacingAndGlyphs" textLength="110.5638" x="484.184" y="122.314">WorkerContext *worker =</text><text fill="#1F3039" font-family="DejaVu Sans Mono" font-size="8.0119" lengthAdjust="spacingAndGlyphs" textLength="139.4065" x="469.7626" y="131.6403">(WorkerContext *)pvParameters</text><!--MD5=[482411d91ae66d861cdea1bfa312d1e2]
class Work--><rect fill="#F5F8FA" height="43.6522" id="Work" style="stroke: #607985; stroke-width: 0.8011869436201781;" width="110.5638" x="276.4095" y="91.0896"/><text fill="#526B77" font-family="DejaVu Sans Mono" font-size="5.8754" font-style="italic" lengthAdjust="spacingAndGlyphs" textLength="48.6053" x="307.3887" y="102.4186">«application»</text><text fill="#1F3039" font-family="DejaVu Sans Mono" font-size="8.0119" lengthAdjust="spacingAndGlyphs" textLength="100.9496" x="281.2166" y="117.6506">05 typed calculation</text><text fill="#1F3039" font-family="DejaVu Sans Mono" font-size="8.0119" lengthAdjust="spacingAndGlyphs" textLength="96.1424" x="283.6202" y="126.9769">worker-&gt;result = sum</text><!--MD5=[955ec29e801e64f81c420d0efefda74f]
class Hazard--><rect fill="#F5F8FA" height="43.6522" id="Hazard" style="stroke: #607985; stroke-width: 0.8011869436201781;" width="144.2136" x="3.2047" y="91.0896"/><text fill="#526B77" font-family="DejaVu Sans Mono" font-size="5.8754" font-style="italic" lengthAdjust="spacingAndGlyphs" textLength="74.7774" x="37.9228" y="102.4186">«compile-time check»</text><text fill="#1F3039" font-family="DejaVu Sans Mono" font-size="8.0119" lengthAdjust="spacingAndGlyphs" textLength="105.7567" x="22.4332" y="117.6506">06 wrong-cast exhibit</text><text fill="#1F3039" font-family="DejaVu Sans Mono" font-size="8.0119" lengthAdjust="spacingAndGlyphs" textLength="134.5994" x="8.0119" y="126.9769">C cannot verify context type</text><path d="M633.2047,99.5822 L633.2047,126.255 A0,0 0 0 0 633.2047,126.255 L890.1187,126.255 A0,0 0 0 0 890.1187,126.255 L890.1187,104.9234 L884.7774,99.5822 L752.7899,99.5822 L706.7644,48.0872 L748.5169,99.5822 L633.2047,99.5822 A0,0 0 0 0 633.2047,99.5822 " fill="#F7F5ED" style="stroke: #8A887C; stroke-width: 0.5341246290801187;"/><path d="M884.7774,99.5822 L884.7774,104.9234 L890.1187,104.9234 L884.7774,99.5822 " fill="#F7F5ED" style="stroke: #8A887C; stroke-width: 0.5341246290801187;"/><text fill="#3E4B50" font-family="DejaVu Sans Mono" font-size="6.4095" lengthAdjust="spacingAndGlyphs" textLength="213.1157" x="639.6142" y="111.407">RV32 ILP32 ABI carries the first callback argument in a0.</text><text fill="#3E4B50" font-family="DejaVu Sans Mono" font-size="6.4095" lengthAdjust="spacingAndGlyphs" textLength="239.2878" x="639.6142" y="118.8681">The explicit C cast documents intent; it performs no type check.</text><!--MD5=[1ff83926f444d43e448833f6dd9e777f]
link Callback to Create--><path d="M329.2398,26.1454 C359.6315,26.1454 398.2006,26.1454 429.1531,26.1454 " fill="none" id="Callback-&gt;Create" style="stroke: #607985; stroke-width: 0.6943620178041543;"/><polygon fill="#607985" points="431.6955,26.1454,426.8884,24.0089,429.0249,26.1454,426.8884,28.2819,431.6955,26.1454" style="stroke: #607985; stroke-width: 0.6943620178041543;"/><text fill="#425B67" font-family="DejaVu Sans Mono" font-size="7.4777" lengthAdjust="spacingAndGlyphs" textLength="76.9139" x="342.3739" y="19.1992">accepted signature</text><!--MD5=[5e35778d1735aeaf64c16000162b8682]
link Create to Entry--><path d="M534.3436,26.1454 C564.7353,26.1454 603.3045,26.1454 634.257,26.1454 " fill="none" id="Create-&gt;Entry" style="stroke: #607985; stroke-width: 0.6943620178041543;"/><polygon fill="#607985" points="636.7994,26.1454,631.9923,24.0089,634.1288,26.1454,631.9923,28.2819,636.7994,26.1454" style="stroke: #607985; stroke-width: 0.6943620178041543;"/><text fill="#425B67" font-family="DejaVu Sans Mono" font-size="7.4777" lengthAdjust="spacingAndGlyphs" textLength="76.9139" x="547.4777" y="19.1992">scheduler dispatch</text><!--MD5=[2cdb4dcf98f84b2f0f14899bf23cd292]
link Entry to Cast--><path d="M651.0766,48.1941 C631.9709,59.181 608.4961,72.6837 588.0125,84.4665 " fill="none" id="Entry-&gt;Cast" style="stroke: #607985; stroke-width: 0.6943620178041543;"/><polygon fill="#607985" points="585.7104,85.7858,590.943,85.2446,588.0263,84.4558,588.8151,81.5391,585.7104,85.7858" style="stroke: #607985; stroke-width: 0.6943620178041543;"/><text fill="#425B67" font-family="DejaVu Sans Mono" font-size="7.4777" lengthAdjust="spacingAndGlyphs" textLength="51.276" x="635.4427" y="69.8662">same address</text><!--MD5=[f4bbda2f015eec5ec20e2f975cf0eb90]
reverse link Work to Cast--><path d="M390.6107,112.9193 C413.6688,112.9193 440.3964,112.9193 464.7792,112.9193 " fill="none" id="Work&lt;-Cast" style="stroke: #607985; stroke-width: 0.6943620178041543;"/><polygon fill="#607985" points="388.0415,112.9193,392.8487,115.0558,390.7122,112.9193,392.8487,110.7828,388.0415,112.9193" style="stroke: #607985; stroke-width: 0.6943620178041543;"/><text fill="#425B67" font-family="DejaVu Sans Mono" font-size="7.4777" lengthAdjust="spacingAndGlyphs" textLength="51.276" x="400.3264" y="105.9731">typed fields</text><!--MD5=[31435e59aed6adc8ad2d95d53c329eb2]
reverse link Hazard to Work--><path d="M150.949,112.9193 C191.1151,112.9193 239.6083,112.9193 276.2493,112.9193 " fill="none" id="Hazard&lt;-Work" style="stroke: #607985; stroke-width: 0.6943620178041543;"/><polygon fill="#607985" points="148.3905,112.9193,153.1976,115.0558,151.0611,112.9193,153.1976,110.7828,148.3905,112.9193" style="stroke: #607985; stroke-width: 0.6943620178041543;"/><text fill="#425B67" font-family="DejaVu Sans Mono" font-size="7.4777" lengthAdjust="spacingAndGlyphs" textLength="102.5519" x="160.638" y="105.9731">contrast: unchecked cast</text><!--MD5=[aa23e53a9e1b193daf13397cfcbb102c]
@startuml
skinparam backgroundColor white
skinparam shadowing false
skinparam monochrome false
skinparam defaultFontName "DejaVu Sans Mono"
skinparam defaultFontSize 14
skinparam defaultFontColor #24343D
skinparam titleFontName "DejaVu Sans Mono"
skinparam titleFontSize 13
skinparam titleFontColor #536B78
skinparam titleFontStyle plain
skinparam ArrowColor #607985
skinparam ArrowFontColor #425B67
skinparam ArrowThickness 1.3
skinparam LineThickness 1.3
skinparam nodesep 36
skinparam ranksep 42
skinparam Padding 6
skinparam classBackgroundColor #F5F8FA
skinparam classBorderColor #607985
skinparam classBorderThickness 1.5
skinparam classFontColor #1F3039
skinparam classFontSize 15
skinparam classAttributeFontColor #2E424D
skinparam classAttributeFontSize 13
skinparam classStereotypeFontColor #526B77
skinparam classStereotypeFontSize 11
skinparam minClassWidth 190
skinparam ClassAttributeIconSize 0
skinparam stateBackgroundColor #F5F8FA
skinparam stateBorderColor #607985
skinparam stateBorderThickness 1.5
skinparam stateFontColor #1F3039
skinparam stateFontSize 14
skinparam stateAttributeFontSize 13
skinparam noteBackgroundColor #F7F5ED
skinparam noteBorderColor #8A887C
skinparam noteFontColor #3E4B50
skinparam noteFontSize 12
skinparam ParticipantBackgroundColor #F5F8FA
skinparam ParticipantBorderColor #607985
skinparam ParticipantBorderThickness 1.5
skinparam ParticipantFontColor #1F3039
skinparam ParticipantFontSize 13
skinparam ActorBorderColor #607985
skinparam ActorFontColor #1F3039
skinparam LifeLineBorderColor #8297A1
skinparam LifeLineBackgroundColor #F9FBFC
skinparam SequenceArrowColor #607985
skinparam SequenceMessageAlign center
skinparam ParticipantPadding 18
skinparam BoxPadding 8
hide circle
hide empty members
scale 900 width
top to bottom direction
class "01 TaskFunction_t\nvoid (*)(void*)" as Callback <<C ABI>>
class "02 xTaskCreate\nentry + &workerA" as Create <<boundary>>
class "03 callback entry\na0 = pvParameters" as Entry <<runtime>>
class "04 typed pointer\nWorkerContext *worker =\n(WorkerContext *)pvParameters" as Cast <<C>>
class "05 typed calculation\nworker->result = sum" as Work <<application>>
class "06 wrong-cast exhibit\nC cannot verify context type" as Hazard <<compile-time check>>
Callback -right-> Create : accepted signature
Create -right-> Entry : scheduler dispatch
Entry -down-> Cast : same address
Cast -left-> Work : typed fields
Work -left-> Hazard : contrast: unchecked cast
note bottom of Entry
RV32 ILP32 ABI carries the first callback argument in a0.
The explicit C cast documents intent; it performs no type check.
end note
@enduml
PlantUML version 1.2020.02(Sun Mar 01 11:22:07 CET 2020)
(GPL source distribution)
Java Runtime: OpenJDK Runtime Environment
JVM: OpenJDK 64-Bit Server VM
Java Version: 25.0.4-ea+4-1-Debian
Operating System: Linux
Default Encoding: UTF-8
Language: en
Country: null
--></g></svg>

After

Width:  |  Height:  |  Size: 12 KiB

+30
View File
@@ -0,0 +1,30 @@
@startuml
!include card-uml-style.iuml
scale 900 width
hide footbox
skinparam ParticipantPadding 18
participant "main" as Main
participant "workerA ctx" as A
participant "workerB ctx" as B
participant "sum_task_entry" as Entry
participant "FreeRTOS" as Kernel
participant "supervisor" as Supervisor
Main -> A : <b>01</b> static context prepared
||34||
Main -> A : <b>02</b> create_worker(&workerA)
||34||
Main -> Kernel : <b>03</b> xTaskCreate(entry, &workerA)
activate Kernel
||34||
Kernel --> A : <b>04</b> handle != NULL; READY
deactivate Kernel
||34||
Main -> Kernel : <b>05</b> vTaskStartScheduler()
activate Kernel
note over Main,Supervisor
Continue on part 2/2 with the same participants and the same contexts.
end note
@enduml
File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 9.3 KiB

+35
View File
@@ -0,0 +1,35 @@
@startuml
!include card-uml-style.iuml
scale 900 width
hide footbox
skinparam ParticipantPadding 18
participant "main" as Main
participant "workerA ctx" as A
participant "workerB ctx" as B
participant "sum_task_entry" as Entry
participant "FreeRTOS" as Kernel
participant "supervisor" as Supervisor
activate Kernel
Kernel -> Entry : <b>06</b> entry(&workerA)
activate Entry
||30||
Entry -> A : <b>07</b> typed context; RUNNING
||30||
Kernel -> B : <b>08</b> tick: A -> B -> A
||30||
Entry -> A : <b>09</b> result = 200010000
||30||
Entry -> A : <b>10</b> COMPLETED; handle = NULL
||30||
Entry -> Kernel : <b>11</b> vTaskDelete(NULL)
deactivate Entry
||30||
Kernel -> Supervisor : <b>12</b> verify both contexts -> PASS
activate Supervisor
note over A,Supervisor
Static contexts survive self-delete. Idle cleanup of TCB/stack is later.
end note
@enduml
File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 12 KiB

+37
View File
@@ -0,0 +1,37 @@
@startuml
!include card-uml-style.iuml
scale 620 width
top to bottom direction
state "01 WorkerContext lifetime\nstatic initialization → program end" as ObjectLifetime
state "PREPARED" as Constructed
state "02 STARTING" as Starting
state "READY" as ReadyWrapper
state "03 RUNNING" as RunningWrapper
state "COMPLETED" as CompletedWrapper
state "Ready" as ReadyKernel
state "04 Running" as RunningKernel
state "05 time sliced\nA ↔ B" as TimeSlice
state "06 Deleted\ncontext remains static" as DeletedKernel
Constructed --> Starting : create_worker()
Starting --> ReadyWrapper : xTaskCreate = pdPASS
ReadyWrapper --> RunningWrapper : callback entry
RunningWrapper --> CompletedWrapper : result published
ReadyKernel --> RunningKernel : scheduler
RunningKernel --> ReadyKernel : preemption
RunningKernel --> TimeSlice : equal priority
TimeSlice --> RunningKernel : resume
RunningKernel --> DeletedKernel : vTaskDelete(NULL)
ObjectLifetime -[hidden]down-> Constructed
CompletedWrapper -[hidden]down-> DeletedKernel
note right of RunningWrapper
trace_state is diagnostic application data.
It is not eTaskState.
end note
@enduml
File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 15 KiB

+29
View File
@@ -0,0 +1,29 @@
@startuml
!include card-uml-style.iuml
scale 900 width
top to bottom direction
class "01 workerA context\n.data / .bss" as Context <<application storage>>
class "02 &handle / handle\nfield address / opaque value" as Handle <<public API>>
class "03 TCB\nheap_4" as TCB <<kernel internal>>
class "task stack\nheap_4" as Stack <<runtime>>
class "04 callback ABI\na0 = &workerA" as ABI <<CPU>>
class "05 scheduling evidence\nPC · tick · A/B/A trace" as Schedule <<Hazard3>>
class "06 final evidence\nresult + source + E12" as Evidence <<verified>>
Context -right-> Handle : field value
Handle -right-> TCB : identifies
TCB -right-> Stack : points to separate block
ABI -right-> Schedule : PC / tick
Schedule -right-> Evidence : verified E12
Context -[hidden]down-> ABI
ABI --> Context : exact address
ABI --> Stack : SP inside range
Stack --> Schedule : restored execution
note bottom of TCB
Debugger may inspect the TCB address.
Application assertions use public APIs only.
Saved addresses are forensic after self-delete.
end note
@enduml
+115
View File
@@ -0,0 +1,115 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" contentScriptType="application/ecmascript" contentStyleType="text/css" height="491.1479px" preserveAspectRatio="none" style="width:894px;height:491px;" version="1.1" viewBox="0 0 894 491" width="894.7471px" zoomAndPan="magnify"><defs/><g><!--MD5=[6754354365917abf8f1a56af1b7e344c]
class Context--><rect fill="#F5F8FA" height="71.5505" id="Context" style="stroke: #607985; stroke-width: 1.3132295719844358;" width="166.3424" x="5.2529" y="7.0827"/><text fill="#526B77" font-family="DejaVu Sans Mono" font-size="9.6304" font-style="italic" lengthAdjust="spacingAndGlyphs" textLength="128.6965" x="24.0759" y="25.6521">«application storage»</text><text fill="#1F3039" font-family="DejaVu Sans Mono" font-size="13.1323" lengthAdjust="spacingAndGlyphs" textLength="149.7082" x="13.57" y="50.6189">01 workerA context</text><text fill="#1F3039" font-family="DejaVu Sans Mono" font-size="13.1323" lengthAdjust="spacingAndGlyphs" textLength="94.5525" x="41.1479" y="65.9057">.data / .bss</text><!--MD5=[036c1653d048e8122c132b15802304de]
class Handle--><rect fill="#F5F8FA" height="71.5505" id="Handle" style="stroke: #607985; stroke-width: 1.3132295719844358;" width="236.3813" x="292.4125" y="7.0827"/><text fill="#526B77" font-family="DejaVu Sans Mono" font-size="9.6304" font-style="italic" lengthAdjust="spacingAndGlyphs" textLength="73.5409" x="373.8327" y="25.6521">«public API»</text><text fill="#1F3039" font-family="DejaVu Sans Mono" font-size="13.1323" lengthAdjust="spacingAndGlyphs" textLength="157.5875" x="331.8093" y="50.6189">02 &amp;handle / handle</text><text fill="#1F3039" font-family="DejaVu Sans Mono" font-size="13.1323" lengthAdjust="spacingAndGlyphs" textLength="220.6226" x="300.2918" y="65.9057">field address / opaque value</text><!--MD5=[55dfe95f9324421dd4dc987285821f78]
class TCB--><rect fill="#F5F8FA" height="71.5505" id="TCB" style="stroke: #607985; stroke-width: 1.3132295719844358;" width="166.3424" x="642.607" y="7.0827"/><text fill="#526B77" font-family="DejaVu Sans Mono" font-size="9.6304" font-style="italic" lengthAdjust="spacingAndGlyphs" textLength="104.1829" x="673.6868" y="25.6521">«kernel internal»</text><text fill="#1F3039" font-family="DejaVu Sans Mono" font-size="13.1323" lengthAdjust="spacingAndGlyphs" textLength="55.1556" x="698.2004" y="50.6189">03 TCB</text><text fill="#1F3039" font-family="DejaVu Sans Mono" font-size="13.1323" lengthAdjust="spacingAndGlyphs" textLength="47.2763" x="702.1401" y="65.9057">heap_4</text><!--MD5=[1a47157467d69c83c0a10e9152875283]
class Stack--><rect fill="#F5F8FA" height="71.5505" id="Stack" style="stroke: #607985; stroke-width: 1.3132295719844358;" width="166.3424" x="247.7626" y="276.2597"/><text fill="#526B77" font-family="DejaVu Sans Mono" font-size="9.6304" font-style="italic" lengthAdjust="spacingAndGlyphs" textLength="55.1556" x="303.356" y="294.8292">«runtime»</text><text fill="#1F3039" font-family="DejaVu Sans Mono" font-size="13.1323" lengthAdjust="spacingAndGlyphs" textLength="78.7938" x="291.537" y="319.7959">task stack</text><text fill="#1F3039" font-family="DejaVu Sans Mono" font-size="13.1323" lengthAdjust="spacingAndGlyphs" textLength="47.2763" x="307.2957" y="335.0828">heap_4</text><!--MD5=[ca6cab28393b6e810e6fecd613e1e410]
class ABI--><rect fill="#F5F8FA" height="71.5505" id="ABI" style="stroke: #607985; stroke-width: 1.3132295719844358;" width="166.3424" x="57.7821" y="141.6712"/><text fill="#526B77" font-family="DejaVu Sans Mono" font-size="9.6304" font-style="italic" lengthAdjust="spacingAndGlyphs" textLength="30.642" x="125.6323" y="160.2407">«CPU»</text><text fill="#1F3039" font-family="DejaVu Sans Mono" font-size="13.1323" lengthAdjust="spacingAndGlyphs" textLength="126.07" x="77.9183" y="185.2074">04 callback ABI</text><text fill="#1F3039" font-family="DejaVu Sans Mono" font-size="13.1323" lengthAdjust="spacingAndGlyphs" textLength="102.4319" x="89.7374" y="200.4942">a0 = &amp;workerA</text><!--MD5=[c680266cf9e454ca06c2d1bb8b683e6b]
class Schedule--><rect fill="#F5F8FA" height="71.5505" id="Schedule" style="stroke: #607985; stroke-width: 1.3132295719844358;" width="196.9844" x="68.7257" y="410.8395"/><text fill="#526B77" font-family="DejaVu Sans Mono" font-size="9.6304" font-style="italic" lengthAdjust="spacingAndGlyphs" textLength="55.1556" x="139.6401" y="429.409">«Hazard3»</text><text fill="#1F3039" font-family="DejaVu Sans Mono" font-size="13.1323" lengthAdjust="spacingAndGlyphs" textLength="181.2257" x="76.6051" y="454.3757">05 scheduling evidence</text><text fill="#1F3039" font-family="DejaVu Sans Mono" font-size="13.1323" lengthAdjust="spacingAndGlyphs" textLength="181.2257" x="76.6051" y="469.6625">PC · tick · A/B/A trace</text><!--MD5=[13f56afd7aace6dccdfaaac41cf97a6a]
class Evidence--><rect fill="#F5F8FA" height="71.5505" id="Evidence" style="stroke: #607985; stroke-width: 1.3132295719844358;" width="181.2257" x="393.5311" y="410.8395"/><text fill="#526B77" font-family="DejaVu Sans Mono" font-size="9.6304" font-style="italic" lengthAdjust="spacingAndGlyphs" textLength="61.284" x="453.5019" y="429.409">«verified»</text><text fill="#1F3039" font-family="DejaVu Sans Mono" font-size="13.1323" lengthAdjust="spacingAndGlyphs" textLength="141.8288" x="413.2296" y="454.3757">06 final evidence</text><text fill="#1F3039" font-family="DejaVu Sans Mono" font-size="13.1323" lengthAdjust="spacingAndGlyphs" textLength="165.4669" x="401.4105" y="469.6625">result + source + E12</text><path d="M567.3152,149.4718 L567.3152,205.4208 A0,0 0 0 0 567.3152,205.4208 L884.2412,205.4208 A0,0 0 0 0 884.2412,205.4208 L884.2412,158.2267 L875.4864,149.4718 L729.2802,149.4718 L725.7782,78.9864 L722.2763,149.4718 L567.3152,149.4718 A0,0 0 0 0 567.3152,149.4718 " fill="#F7F5ED" style="stroke: #8A887C; stroke-width: 0.8754863813229572;"/><path d="M875.4864,149.4718 L875.4864,158.2267 L884.2412,158.2267 L875.4864,149.4718 " fill="#F7F5ED" style="stroke: #8A887C; stroke-width: 0.8754863813229572;"/><text fill="#3E4B50" font-family="DejaVu Sans Mono" font-size="10.5058" lengthAdjust="spacingAndGlyphs" textLength="226.751" x="577.821" y="168.8539">Debugger may inspect the TCB address.</text><text fill="#3E4B50" font-family="DejaVu Sans Mono" font-size="10.5058" lengthAdjust="spacingAndGlyphs" textLength="269.6498" x="577.821" y="181.0833">Application assertions use public APIs only.</text><text fill="#3E4B50" font-family="DejaVu Sans Mono" font-size="10.5058" lengthAdjust="spacingAndGlyphs" textLength="288.035" x="577.821" y="193.3128">Saved addresses are forensic after self-delete.</text><!--MD5=[f2b95524c1e28a7910e8f2eb818d98c7]
link Context to Handle--><path d="M171.8142,42.8638 C206.7286,42.8638 248.0603,42.8638 286.4241,42.8638 " fill="none" id="Context-&gt;Handle" style="stroke: #607985; stroke-width: 1.1381322957198443;"/><polygon fill="#607985" points="290.7403,42.8638,282.8609,39.3619,286.3628,42.8638,282.8609,46.3658,290.7403,42.8638" style="stroke: #607985; stroke-width: 1.1381322957198443;"/><text fill="#425B67" font-family="DejaVu Sans Mono" font-size="12.2568" lengthAdjust="spacingAndGlyphs" textLength="77.0428" x="193.4825" y="31.4782">field value</text><!--MD5=[6b24788f218641d713329a2ae991a93f]
link Handle to TCB--><path d="M529.0827,42.8638 C564.8813,42.8638 603.5516,42.8638 637.0477,42.8638 " fill="none" id="Handle-&gt;TCB" style="stroke: #607985; stroke-width: 1.1381322957198443;"/><polygon fill="#607985" points="641.0574,42.8638,633.178,39.3619,636.68,42.8638,633.178,46.3658,641.0574,42.8638" style="stroke: #607985; stroke-width: 1.1381322957198443;"/><text fill="#425B67" font-family="DejaVu Sans Mono" font-size="12.2568" lengthAdjust="spacingAndGlyphs" textLength="70.0389" x="550.6809" y="31.4782">identifies</text><!--MD5=[260ca96e0608034bbe20e6455096b2ea]
link TCB to Stack--><path d="M642.4582,62.0632 C543.7733,84.4932 390.2656,121.9027 371.2062,141.6712 C338.0866,176.0078 330.4961,232.3804 329.5418,270.5953 " fill="none" id="TCB-&gt;Stack" style="stroke: #607985; stroke-width: 1.1381322957198443;"/><polygon fill="#607985" points="329.4718,274.7714,333.1083,266.9532,329.5468,270.3946,326.1054,266.8332,329.4718,274.7714" style="stroke: #607985; stroke-width: 1.1381322957198443;"/><text fill="#425B67" font-family="DejaVu Sans Mono" font-size="12.2568" lengthAdjust="spacingAndGlyphs" textLength="168.0934" x="377.3346" y="181.8167">points to separate block</text><!--MD5=[6db3f3df7074aeb50763e28cae90ff59]
link ABI to Schedule--><path d="M144.07,213.3911 C147.1518,247.6751 152.0632,301.3512 156.7121,347.8045 C158.5944,366.6187 160.8093,387.4377 162.7179,405.035 " fill="none" id="ABI-&gt;Schedule" style="stroke: #607985; stroke-width: 1.1381322957198443;"/><polygon fill="#607985" points="163.1819,409.3074,165.8079,401.0944,162.7067,404.9558,158.8453,401.8547,163.1819,409.3074" style="stroke: #607985; stroke-width: 1.1381322957198443;"/><text fill="#425B67" font-family="DejaVu Sans Mono" font-size="12.2568" lengthAdjust="spacingAndGlyphs" textLength="63.035" x="162.8405" y="316.4053">PC / tick</text><!--MD5=[207925ab6ff16cd1f486f6b03ab44a05]
link Schedule to Evidence--><path d="M265.7539,446.6206 C304.5554,446.6206 348.9689,446.6206 387.5691,446.6206 " fill="none" id="Schedule-&gt;Evidence" style="stroke: #607985; stroke-width: 1.1381322957198443;"/><polygon fill="#607985" points="391.894,446.6206,384.0146,443.1187,387.5165,446.6206,384.0146,450.1226,391.894,446.6206" style="stroke: #607985; stroke-width: 1.1381322957198443;"/><text fill="#425B67" font-family="DejaVu Sans Mono" font-size="12.2568" lengthAdjust="spacingAndGlyphs" textLength="84.0467" x="287.5973" y="435.235">verified E12</text><!--MD5=[0692a1c747d599fb65721a3192b7148d]
link Context to ABI--><!--MD5=[0b636485966694c3572d595f72d87511]
link ABI to Context--><path d="M127.0418,141.3911 C120.073,123.7675 111.5982,102.3356 104.3667,84.0554 " fill="none" id="ABI-&gt;Context" style="stroke: #607985; stroke-width: 1.1381322957198443;"/><polygon fill="#607985" points="102.8521,80.2208,102.5041,88.8363,104.4671,84.2895,109.0139,86.2524,102.8521,80.2208" style="stroke: #607985; stroke-width: 1.1381322957198443;"/><text fill="#425B67" font-family="DejaVu Sans Mono" font-size="12.2568" lengthAdjust="spacingAndGlyphs" textLength="91.0506" x="125.5185" y="114.5269">exact address</text><!--MD5=[ba05e5e05147408eaf79428044b1e317]
link ABI to Stack--><path d="M164.4689,213.2685 C176.0428,228.4844 191.0399,245.6002 207.4903,257.8745 C218.2237,265.8765 230.3492,272.9767 242.7023,279.1663 " fill="none" id="ABI-&gt;Stack" style="stroke: #607985; stroke-width: 1.1381322957198443;"/><polygon fill="#607985" points="246.4407,280.9961,240.9253,274.3682,242.5154,279.0585,237.8251,280.6486,246.4407,280.9961" style="stroke: #607985; stroke-width: 1.1381322957198443;"/><text fill="#425B67" font-family="DejaVu Sans Mono" font-size="12.2568" lengthAdjust="spacingAndGlyphs" textLength="105.0584" x="213.6187" y="249.1154">SP inside range</text><!--MD5=[40ef621f4b5ca7ebafeb4f5c63cfc119]
link Stack to Schedule--><path d="M287.4922,348.1547 C265.106,366.321 237.7646,388.4971 214.8093,407.1274 " fill="none" id="Stack-&gt;Schedule" style="stroke: #607985; stroke-width: 1.1381322957198443;"/><polygon fill="#607985" points="211.6051,409.7276,219.9287,407.4769,215.0024,406.9673,215.5121,402.041,211.6051,409.7276" style="stroke: #607985; stroke-width: 1.1381322957198443;"/><text fill="#425B67" font-family="DejaVu Sans Mono" font-size="12.2568" lengthAdjust="spacingAndGlyphs" textLength="126.07" x="269.8687" y="383.6951">restored execution</text><!--MD5=[3e332d5c043ea547ae867251869e07bc]
@startuml
skinparam backgroundColor white
skinparam shadowing false
skinparam monochrome false
skinparam defaultFontName "DejaVu Sans Mono"
skinparam defaultFontSize 14
skinparam defaultFontColor #24343D
skinparam titleFontName "DejaVu Sans Mono"
skinparam titleFontSize 13
skinparam titleFontColor #536B78
skinparam titleFontStyle plain
skinparam ArrowColor #607985
skinparam ArrowFontColor #425B67
skinparam ArrowThickness 1.3
skinparam LineThickness 1.3
skinparam nodesep 36
skinparam ranksep 42
skinparam Padding 6
skinparam classBackgroundColor #F5F8FA
skinparam classBorderColor #607985
skinparam classBorderThickness 1.5
skinparam classFontColor #1F3039
skinparam classFontSize 15
skinparam classAttributeFontColor #2E424D
skinparam classAttributeFontSize 13
skinparam classStereotypeFontColor #526B77
skinparam classStereotypeFontSize 11
skinparam minClassWidth 190
skinparam ClassAttributeIconSize 0
skinparam stateBackgroundColor #F5F8FA
skinparam stateBorderColor #607985
skinparam stateBorderThickness 1.5
skinparam stateFontColor #1F3039
skinparam stateFontSize 14
skinparam stateAttributeFontSize 13
skinparam noteBackgroundColor #F7F5ED
skinparam noteBorderColor #8A887C
skinparam noteFontColor #3E4B50
skinparam noteFontSize 12
skinparam ParticipantBackgroundColor #F5F8FA
skinparam ParticipantBorderColor #607985
skinparam ParticipantBorderThickness 1.5
skinparam ParticipantFontColor #1F3039
skinparam ParticipantFontSize 13
skinparam ActorBorderColor #607985
skinparam ActorFontColor #1F3039
skinparam LifeLineBorderColor #8297A1
skinparam LifeLineBackgroundColor #F9FBFC
skinparam SequenceArrowColor #607985
skinparam SequenceMessageAlign center
skinparam ParticipantPadding 18
skinparam BoxPadding 8
hide circle
hide empty members
scale 900 width
top to bottom direction
class "01 workerA context\n.data / .bss" as Context <<application storage>>
class "02 &handle / handle\nfield address / opaque value" as Handle <<public API>>
class "03 TCB\nheap_4" as TCB <<kernel internal>>
class "task stack\nheap_4" as Stack <<runtime>>
class "04 callback ABI\na0 = &workerA" as ABI <<CPU>>
class "05 scheduling evidence\nPC · tick · A/B/A trace" as Schedule <<Hazard3>>
class "06 final evidence\nresult + source + E12" as Evidence <<verified>>
Context -right-> Handle : field value
Handle -right-> TCB : identifies
TCB -right-> Stack : points to separate block
ABI -right-> Schedule : PC / tick
Schedule -right-> Evidence : verified E12
Context -[hidden]down-> ABI
ABI - -> Context : exact address
ABI - -> Stack : SP inside range
Stack - -> Schedule : restored execution
note bottom of TCB
Debugger may inspect the TCB address.
Application assertions use public APIs only.
Saved addresses are forensic after self-delete.
end note
@enduml
PlantUML version 1.2020.02(Sun Mar 01 11:22:07 CET 2020)
(GPL source distribution)
Java Runtime: OpenJDK Runtime Environment
JVM: OpenJDK 64-Bit Server VM
Java Version: 25.0.4-ea+4-1-Debian
Operating System: Linux
Default Encoding: UTF-8
Language: en
Country: null
--></g></svg>

After

Width:  |  Height:  |  Size: 14 KiB