feat: publish FreeRTOS C FC07 card

This commit is contained in:
2026-07-19 16:36:03 +02:00
commit 9fad4f4ccc
196 changed files with 59368 additions and 0 deletions
Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

+21
View File
@@ -0,0 +1,21 @@
@startuml
scale max 900*520
skinparam backgroundColor transparent
skinparam shadowing false
skinparam defaultFontName "DejaVu Sans Mono"
skinparam defaultFontSize 13
skinparam rectangleBorderColor #2b6f8e
skinparam rectangleBackgroundColor #edf6fa
skinparam ArrowColor #8295a0
top to bottom direction
title A1 CONTEXT — real Hazard3 external interrupt to FreeRTOS task
rectangle "01 Testbench IRQ source\nIO_SET_IRQ bit 5" as Source
rectangle "02 Hazard3 IRQ controller\nMEIEA · priority · mcause=MEI" as H3
rectangle "03 FreeRTOS trap port\nfull context → xISRStack" as Port
rectangle "04 Application ISR\nclear · GiveFromISR · yield" as ISR
rectangle "05 High-priority waiter\nbinary semaphore" as Waiter
Source --> H3
H3 --> Port
Port --> ISR
ISR --> Waiter
@enduml
+42
View File
@@ -0,0 +1,42 @@
<?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="520.8603px" preserveAspectRatio="none" style="width:498px;height:520px;" version="1.1" viewBox="0 0 498 520" width="498.0417px" zoomAndPan="magnify"><defs/><g><text fill="#000000" font-family="DejaVu Sans Mono" font-size="12.8975" lengthAdjust="spacingAndGlyphs" textLength="484.1521" x="1.9842" y="11.9717">A1 CONTEXT — real Hazard3 external interrupt to FreeRTOS task</text><!--MD5=[c8da82a3e4fd5c54db14ac48b9861466]
entity Source--><rect fill="#EDF6FA" height="49.8693" style="stroke: #2B6F8E; stroke-width: 1.488172427670706;" width="202.3915" x="136.9119" y="22.623"/><text fill="#000000" font-family="DejaVu Sans Mono" font-size="12.8975" lengthAdjust="spacingAndGlyphs" textLength="182.5492" x="146.833" y="44.5159">01 Testbench IRQ source</text><text fill="#000000" font-family="DejaVu Sans Mono" font-size="12.8975" lengthAdjust="spacingAndGlyphs" textLength="126.9907" x="146.833" y="59.5294">IO_SET_IRQ bit 5</text><!--MD5=[6075f46e3e6c82b53df9f2400a94965b]
entity H3--><rect fill="#EDF6FA" height="49.8693" style="stroke: #2B6F8E; stroke-width: 1.488172427670706;" width="250.013" x="113.1011" y="132.0235"/><text fill="#000000" font-family="DejaVu Sans Mono" font-size="12.8975" lengthAdjust="spacingAndGlyphs" textLength="198.423" x="123.0223" y="153.9164">02 Hazard3 IRQ controller</text><text fill="#000000" font-family="DejaVu Sans Mono" font-size="12.8975" lengthAdjust="spacingAndGlyphs" textLength="230.1707" x="123.0223" y="168.9299">MEIEA · priority · mcause=MEI</text><!--MD5=[551215425a7de5316c648a342d6ec73b]
entity Port--><rect fill="#EDF6FA" height="49.8693" style="stroke: #2B6F8E; stroke-width: 1.488172427670706;" width="210.3284" x="132.9434" y="241.4141"/><text fill="#000000" font-family="DejaVu Sans Mono" font-size="12.8975" lengthAdjust="spacingAndGlyphs" textLength="166.6753" x="142.8646" y="263.307">03 FreeRTOS trap port</text><text fill="#000000" font-family="DejaVu Sans Mono" font-size="12.8975" lengthAdjust="spacingAndGlyphs" textLength="190.4861" x="142.8646" y="278.3205">full context → xISRStack</text><!--MD5=[463c99212ccdf2a9aa2a23645c423e5c]
entity ISR--><rect fill="#EDF6FA" height="49.8693" style="stroke: #2B6F8E; stroke-width: 1.488172427670706;" width="234.1391" x="121.038" y="350.8146"/><text fill="#000000" font-family="DejaVu Sans Mono" font-size="12.8975" lengthAdjust="spacingAndGlyphs" textLength="142.8646" x="130.9592" y="372.7075">04 Application ISR</text><text fill="#000000" font-family="DejaVu Sans Mono" font-size="12.8975" lengthAdjust="spacingAndGlyphs" textLength="214.2968" x="130.9592" y="387.721">clear · GiveFromISR · yield</text><!--MD5=[323c25cdec349f5ea5907cb1b91ccd49]
entity Waiter--><rect fill="#EDF6FA" height="49.8693" style="stroke: #2B6F8E; stroke-width: 1.488172427670706;" width="202.3915" x="136.9119" y="460.2052"/><text fill="#000000" font-family="DejaVu Sans Mono" font-size="12.8975" lengthAdjust="spacingAndGlyphs" textLength="182.5492" x="146.833" y="482.0981">05 High-priority waiter</text><text fill="#000000" font-family="DejaVu Sans Mono" font-size="12.8975" lengthAdjust="spacingAndGlyphs" textLength="126.9907" x="146.833" y="497.1116">binary semaphore</text><!--MD5=[4fc73c884cfe531f1547a3d4074fe1a7]
link Source to H3--><path d="M238.1076,72.9232 C238.1076,88.4399 238.1076,108.6791 238.1076,125.2871 " fill="none" id="Source-&gt;H3" style="stroke: #8295A0; stroke-width: 0.9921149517804707;"/><polygon fill="#8295A0" points="238.1076,130.1881,242.076,121.2591,238.1076,125.2275,234.1391,121.2591,238.1076,130.1881" style="stroke: #8295A0; stroke-width: 0.9921149517804707;"/><!--MD5=[397ca8f0de5b8fef912417d592dc57e9]
link H3 to Port--><path d="M238.1076,182.3238 C238.1076,197.8404 238.1076,218.0697 238.1076,234.6777 " fill="none" id="H3-&gt;Port" style="stroke: #8295A0; stroke-width: 0.9921149517804707;"/><polygon fill="#8295A0" points="238.1076,239.5787,242.076,230.6497,238.1076,234.6181,234.1391,230.6497,238.1076,239.5787" style="stroke: #8295A0; stroke-width: 0.9921149517804707;"/><!--MD5=[0a408f81ebbcac93bd520e188d4e2be1]
link Port to ISR--><path d="M238.1076,291.7143 C238.1076,307.231 238.1076,327.4702 238.1076,344.0782 " fill="none" id="Port-&gt;ISR" style="stroke: #8295A0; stroke-width: 0.9921149517804707;"/><polygon fill="#8295A0" points="238.1076,348.9792,242.076,340.0502,238.1076,344.0186,234.1391,340.0502,238.1076,348.9792" style="stroke: #8295A0; stroke-width: 0.9921149517804707;"/><!--MD5=[4d2bc5b9e47152e661298c7abd7751c2]
link ISR to Waiter--><path d="M238.1076,401.1149 C238.1076,416.6315 238.1076,436.8608 238.1076,453.4688 " fill="none" id="ISR-&gt;Waiter" style="stroke: #8295A0; stroke-width: 0.9921149517804707;"/><polygon fill="#8295A0" points="238.1076,458.3698,242.076,449.4408,238.1076,453.4092,234.1391,449.4408,238.1076,458.3698" style="stroke: #8295A0; stroke-width: 0.9921149517804707;"/><!--MD5=[c45f4dcd47a45ccf047c3a5a75637cb5]
@startuml
scale max 900*520
skinparam backgroundColor transparent
skinparam shadowing false
skinparam defaultFontName "DejaVu Sans Mono"
skinparam defaultFontSize 13
skinparam rectangleBorderColor #2b6f8e
skinparam rectangleBackgroundColor #edf6fa
skinparam ArrowColor #8295a0
top to bottom direction
title A1 CONTEXT — real Hazard3 external interrupt to FreeRTOS task
rectangle "01 Testbench IRQ source\nIO_SET_IRQ bit 5" as Source
rectangle "02 Hazard3 IRQ controller\nMEIEA · priority · mcause=MEI" as H3
rectangle "03 FreeRTOS trap port\nfull context → xISRStack" as Port
rectangle "04 Application ISR\nclear · GiveFromISR · yield" as ISR
rectangle "05 High-priority waiter\nbinary semaphore" as Waiter
Source - -> H3
H3 - -> Port
Port - -> ISR
ISR - -> Waiter
@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: 6.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

+25
View File
@@ -0,0 +1,25 @@
@startuml
scale max 900*520
skinparam backgroundColor transparent
skinparam shadowing false
skinparam defaultFontName "DejaVu Sans Mono"
skinparam defaultFontSize 12
skinparam rectangleBorderColor #2b6f8e
skinparam rectangleBackgroundColor #edf6fa
skinparam ArrowColor #8295a0
top to bottom direction
title A3 DISPATCH — external vector, saved context and FromISR switch
rectangle "01 isr_external_irq" as Vector
rectangle "02 freertos_risc_v_trap_handler\nsave full task context" as Trap
rectangle "03 xISRStack\nmcause = 0x8000000b" as Stack
rectangle "04 application_interrupt_handler" as App
rectangle "05 xSemaphoreGiveFromISR\nxHPW = pdTRUE" as Give
rectangle "06 portYIELD_FROM_ISR\nvTaskSwitchContext" as Yield
rectangle "07 restore selected task context" as Restore
Vector --> Trap
Trap --> Stack
Stack --> App
App --> Give
Give --> Yield
Yield --> Restore
@enduml
+50
View File
@@ -0,0 +1,50 @@
<?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="520.0237px" preserveAspectRatio="none" style="width:344px;height:520px;" version="1.1" viewBox="0 0 344 520" width="344.9137px" zoomAndPan="magnify"><defs/><g><text fill="#000000" font-family="DejaVu Sans Mono" font-size="9.0966" lengthAdjust="spacingAndGlyphs" textLength="334.3009" x="1.5161" y="8.4437">A3 DISPATCH — external vector, saved context and FromISR switch</text><!--MD5=[aabf3b499c2cf719265b7c3ac778f6cd]
entity Vector--><rect fill="#EDF6FA" height="25.7501" style="stroke: #2B6F8E; stroke-width: 1.137078037447041;" width="115.982" x="106.1273" y="16.9112"/><text fill="#000000" font-family="DejaVu Sans Mono" font-size="9.0966" lengthAdjust="spacingAndGlyphs" textLength="100.8209" x="113.7078" y="32.9354">01 isr_external_irq</text><!--MD5=[8fb8d31695e54a435865fdf9a8b62965]
entity Trap--><rect fill="#EDF6FA" height="36.3391" style="stroke: #2B6F8E; stroke-width: 1.137078037447041;" width="179.6583" x="74.2891" y="88.1453"/><text fill="#000000" font-family="DejaVu Sans Mono" font-size="9.0966" lengthAdjust="spacingAndGlyphs" textLength="164.4973" x="81.8696" y="104.1696">02 freertos_risc_v_trap_handler</text><text fill="#000000" font-family="DejaVu Sans Mono" font-size="9.0966" lengthAdjust="spacingAndGlyphs" textLength="116.74" x="81.8696" y="114.7586">save full task context</text><!--MD5=[ec069bc136e2ed19ea7849b563e95cbb]
entity Stack--><rect fill="#EDF6FA" height="36.3391" style="stroke: #2B6F8E; stroke-width: 1.137078037447041;" width="115.982" x="106.1273" y="169.9695"/><text fill="#000000" font-family="DejaVu Sans Mono" font-size="9.0966" lengthAdjust="spacingAndGlyphs" textLength="63.6764" x="113.7078" y="185.9937">03 xISRStack</text><text fill="#000000" font-family="DejaVu Sans Mono" font-size="9.0966" lengthAdjust="spacingAndGlyphs" textLength="100.8209" x="113.7078" y="196.5827">mcause = 0x8000000b</text><!--MD5=[6e8f311b0aa23032184ffba0ef926f91]
entity App--><rect fill="#EDF6FA" height="25.7501" style="stroke: #2B6F8E; stroke-width: 1.137078037447041;" width="184.9647" x="71.6359" y="251.7936"/><text fill="#000000" font-family="DejaVu Sans Mono" font-size="9.0966" lengthAdjust="spacingAndGlyphs" textLength="169.8037" x="79.2164" y="267.8178">04 application_interrupt_handler</text><!--MD5=[5b1bd6a7e81d56a128126ca894b4dea0]
entity Give--><rect fill="#EDF6FA" height="36.3391" style="stroke: #2B6F8E; stroke-width: 1.137078037447041;" width="142.5138" x="92.8614" y="323.0278"/><text fill="#000000" font-family="DejaVu Sans Mono" font-size="9.0966" lengthAdjust="spacingAndGlyphs" textLength="127.3527" x="100.4419" y="339.052">05 xSemaphoreGiveFromISR</text><text fill="#000000" font-family="DejaVu Sans Mono" font-size="9.0966" lengthAdjust="spacingAndGlyphs" textLength="68.9827" x="100.4419" y="349.641">xHPW = pdTRUE</text><!--MD5=[89b6b9f582cb55b01c677c38f03b5a6e]
entity Yield--><rect fill="#EDF6FA" height="36.3391" style="stroke: #2B6F8E; stroke-width: 1.137078037447041;" width="126.5947" x="100.8209" y="404.8443"/><text fill="#000000" font-family="DejaVu Sans Mono" font-size="9.0966" lengthAdjust="spacingAndGlyphs" textLength="111.4336" x="108.4014" y="420.8685">06 portYIELD_FROM_ISR</text><text fill="#000000" font-family="DejaVu Sans Mono" font-size="9.0966" lengthAdjust="spacingAndGlyphs" textLength="95.5146" x="108.4014" y="431.4576">vTaskSwitchContext</text><!--MD5=[2999f9717112c470f2aa05529e02a51b]
entity Restore--><rect fill="#EDF6FA" height="25.7501" style="stroke: #2B6F8E; stroke-width: 1.137078037447041;" width="184.9647" x="71.6359" y="486.6685"/><text fill="#000000" font-family="DejaVu Sans Mono" font-size="9.0966" lengthAdjust="spacingAndGlyphs" textLength="169.8037" x="79.2164" y="502.6927">07 restore selected task context</text><!--MD5=[6cbf32367f714346f3b133b410d79dad]
link Vector to Trap--><path d="M164.1183,42.9351 C164.1183,53.8283 164.1183,69.9597 164.1183,83.1195 " fill="none" id="Vector-&gt;Trap" style="stroke: #8295A0; stroke-width: 0.758052024964694;"/><polygon fill="#8295A0" points="164.1183,86.6747,167.1505,79.8523,164.1183,82.8845,161.0861,79.8523,164.1183,86.6747" style="stroke: #8295A0; stroke-width: 0.758052024964694;"/><!--MD5=[b0767bc8531d10a9b766350c06937c90]
link Trap to Stack--><path d="M164.1183,124.6986 C164.1183,136.5166 164.1183,152.1932 164.1183,164.9057 " fill="none" id="Trap-&gt;Stack" style="stroke: #8295A0; stroke-width: 0.758052024964694;"/><polygon fill="#8295A0" points="164.1183,168.6505,167.1505,161.828,164.1183,164.8602,161.0861,161.828,164.1183,168.6505" style="stroke: #8295A0; stroke-width: 0.758052024964694;"/><!--MD5=[e4dab99c883f7bd47772c670c9868b5c]
link Stack to App--><path d="M164.1183,206.6744 C164.1183,218.7274 164.1183,234.5858 164.1183,246.5479 " fill="none" id="Stack-&gt;App" style="stroke: #8295A0; stroke-width: 0.758052024964694;"/><polygon fill="#8295A0" points="164.1183,250.2699,167.1505,243.4475,164.1183,246.4797,161.0861,243.4475,164.1183,250.2699" style="stroke: #8295A0; stroke-width: 0.758052024964694;"/><!--MD5=[1be6bdf4fccaffb580315b926a55fdeb]
link App to Give--><path d="M164.1183,277.81 C164.1183,288.7107 164.1183,304.8345 164.1183,318.0019 " fill="none" id="App-&gt;Give" style="stroke: #8295A0; stroke-width: 0.758052024964694;"/><polygon fill="#8295A0" points="164.1183,321.5496,167.1505,314.7271,164.1183,317.7593,161.0861,314.7271,164.1183,321.5496" style="stroke: #8295A0; stroke-width: 0.758052024964694;"/><!--MD5=[26e107217348d7820e3534419db97115]
link Give to Yield--><path d="M164.1183,359.5734 C164.1183,371.3991 164.1183,387.068 164.1183,399.7881 " fill="none" id="Give-&gt;Yield" style="stroke: #8295A0; stroke-width: 0.758052024964694;"/><polygon fill="#8295A0" points="164.1183,403.5253,167.1505,396.7028,164.1183,399.735,161.0861,396.7028,164.1183,403.5253" style="stroke: #8295A0; stroke-width: 0.758052024964694;"/><!--MD5=[3fcff4eda15420d09f3f572de4dd84c6]
link Yield to Restore--><path d="M164.1183,441.5492 C164.1183,453.6098 164.1183,469.4607 164.1183,481.4303 " fill="none" id="Yield-&gt;Restore" style="stroke: #8295A0; stroke-width: 0.758052024964694;"/><polygon fill="#8295A0" points="164.1183,485.1448,167.1505,478.3223,164.1183,481.3545,161.0861,478.3223,164.1183,485.1448" style="stroke: #8295A0; stroke-width: 0.758052024964694;"/><!--MD5=[d2de30118125ffc21081098f887fa52b]
@startuml
scale max 900*520
skinparam backgroundColor transparent
skinparam shadowing false
skinparam defaultFontName "DejaVu Sans Mono"
skinparam defaultFontSize 12
skinparam rectangleBorderColor #2b6f8e
skinparam rectangleBackgroundColor #edf6fa
skinparam ArrowColor #8295a0
top to bottom direction
title A3 DISPATCH — external vector, saved context and FromISR switch
rectangle "01 isr_external_irq" as Vector
rectangle "02 freertos_risc_v_trap_handler\nsave full task context" as Trap
rectangle "03 xISRStack\nmcause = 0x8000000b" as Stack
rectangle "04 application_interrupt_handler" as App
rectangle "05 xSemaphoreGiveFromISR\nxHPW = pdTRUE" as Give
rectangle "06 portYIELD_FROM_ISR\nvTaskSwitchContext" as Yield
rectangle "07 restore selected task context" as Restore
Vector - -> Trap
Trap - -> Stack
Stack - -> App
App - -> Give
Give - -> Yield
Yield - -> Restore
@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

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

+28
View File
@@ -0,0 +1,28 @@
@startuml
scale max 900*520
skinparam backgroundColor transparent
skinparam shadowing false
skinparam defaultFontName "DejaVu Sans Mono"
skinparam defaultFontSize 12
skinparam sequenceParticipantBorderColor #2b6f8e
skinparam sequenceParticipantBackgroundColor #edf6fa
skinparam sequenceArrowColor #8295a0
title A5 FLOW — ISR wakes waiter before interrupted stimulus continues
participant waiter
participant semaphore
participant stimulus
participant Hazard3
participant ISR
participant verifier
waiter -> semaphore : 02 take / Blocked
stimulus -> stimulus : 03 before trigger
stimulus -> Hazard3 : IO_SET_IRQ bit 5
Hazard3 -> ISR : 04 MEI / xISRStack
ISR -> Hazard3 : 05 clear source
ISR -> semaphore : 06 give / xHPW=pdTRUE
ISR -> waiter : portYIELD_FROM_ISR
waiter -> waiter : 07 runs; stimulus_after=0
waiter -> waiter : self-delete
stimulus -> stimulus : 08 resumes after trigger; waiter_ran=1
verifier -> verifier : 09 order + stacks + mcause = PASS
@enduml
File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

+25
View File
@@ -0,0 +1,25 @@
@startuml
scale max 900*520
skinparam backgroundColor transparent
skinparam shadowing false
skinparam defaultFontName "DejaVu Sans Mono"
skinparam defaultFontSize 13
skinparam stateBorderColor #2b6f8e
skinparam stateBackgroundColor #edf6fa
skinparam ArrowColor #8295a0
top to bottom direction
title A6 STATE — binary semaphore and task readiness across ISR
state "01 EMPTY\nwaiter Blocked" as Empty
state "02 IRQ PENDING\nstimulus interrupted" as Pending
state "03 GIVEN FROM ISR\nwaiter Ready" as Given
state "04 SWITCH REQUESTED\nxHPW=true" as Switch
state "05 TAKEN\nwaiter Running" as Taken
state "06 STIMULUS RESUMED" as Resumed
[*] --> Empty
Empty --> Pending : SET_IRQ
Pending --> Given : GiveFromISR
Given --> Switch : portYIELD_FROM_ISR
Switch --> Taken : restore waiter context
Taken --> Resumed : waiter completes
Resumed --> [*]
@enduml
+44
View File
@@ -0,0 +1,44 @@
<?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="520.5118px" preserveAspectRatio="none" style="width:277px;height:520px;" version="1.1" viewBox="0 0 277 520" width="277.3702px" zoomAndPan="magnify"><defs/><g><text fill="#000000" font-family="DejaVu Sans Mono" font-size="7.6719" lengthAdjust="spacingAndGlyphs" textLength="269.1081" x="1.1803" y="7.1213">A6 STATE — binary semaphore and task readiness across ISR</text><rect fill="#EDF6FA" height="29.6642" rx="7.3769" ry="7.3769" style="stroke: #2B6F8E; stroke-width: 0.8852240989493283;" width="77.8997" x="67.277" y="61.2592"/><line style="stroke: #2B6F8E; stroke-width: 0.8852240989493283;" x1="67.277" x2="145.1768" y1="85.0219" y2="85.0219"/><text fill="#000000" font-family="DejaVu Sans Mono" font-size="7.6719" lengthAdjust="spacingAndGlyphs" textLength="37.7696" x="87.3421" y="71.3312">01 EMPTY</text><text fill="#000000" font-family="DejaVu Sans Mono" font-size="7.6719" lengthAdjust="spacingAndGlyphs" textLength="66.0967" x="73.1785" y="80.2618">waiter Blocked</text><rect fill="#EDF6FA" height="29.6642" rx="7.3769" ry="7.3769" style="stroke: #2B6F8E; stroke-width: 0.8852240989493283;" width="106.2269" x="53.1134" y="136.3675"/><line style="stroke: #2B6F8E; stroke-width: 0.8852240989493283;" x1="53.1134" x2="159.3403" y1="160.1302" y2="160.1302"/><text fill="#000000" font-family="DejaVu Sans Mono" font-size="7.6719" lengthAdjust="spacingAndGlyphs" textLength="66.0967" x="73.1785" y="146.4395">02 IRQ PENDING</text><text fill="#000000" font-family="DejaVu Sans Mono" font-size="7.6719" lengthAdjust="spacingAndGlyphs" textLength="94.4239" x="59.0149" y="155.3701">stimulus interrupted</text><rect fill="#EDF6FA" height="29.6642" rx="7.3769" ry="7.3769" style="stroke: #2B6F8E; stroke-width: 0.8852240989493283;" width="92.0633" x="60.1952" y="211.4699"/><line style="stroke: #2B6F8E; stroke-width: 0.8852240989493283;" x1="60.1952" x2="152.2585" y1="235.2326" y2="235.2326"/><text fill="#000000" font-family="DejaVu Sans Mono" font-size="7.6719" lengthAdjust="spacingAndGlyphs" textLength="80.2603" x="66.0967" y="221.5419">03 GIVEN FROM ISR</text><text fill="#000000" font-family="DejaVu Sans Mono" font-size="7.6719" lengthAdjust="spacingAndGlyphs" textLength="56.6543" x="77.8997" y="230.4725">waiter Ready</text><rect fill="#EDF6FA" height="29.6642" rx="7.3769" ry="7.3769" style="stroke: #2B6F8E; stroke-width: 0.8852240989493283;" width="101.5057" x="55.474" y="286.5782"/><line style="stroke: #2B6F8E; stroke-width: 0.8852240989493283;" x1="55.474" x2="156.9797" y1="310.3409" y2="310.3409"/><text fill="#000000" font-family="DejaVu Sans Mono" font-size="7.6719" lengthAdjust="spacingAndGlyphs" textLength="89.7027" x="61.3755" y="296.6502">04 SWITCH REQUESTED</text><text fill="#000000" font-family="DejaVu Sans Mono" font-size="7.6719" lengthAdjust="spacingAndGlyphs" textLength="42.4908" x="84.9815" y="305.5808">xHPW=true</text><rect fill="#EDF6FA" height="29.6642" rx="7.3769" ry="7.3769" style="stroke: #2B6F8E; stroke-width: 0.8852240989493283;" width="77.8997" x="67.277" y="361.6806"/><line style="stroke: #2B6F8E; stroke-width: 0.8852240989493283;" x1="67.277" x2="145.1768" y1="385.4434" y2="385.4434"/><text fill="#000000" font-family="DejaVu Sans Mono" font-size="7.6719" lengthAdjust="spacingAndGlyphs" textLength="37.7696" x="87.3421" y="371.7526">05 TAKEN</text><text fill="#000000" font-family="DejaVu Sans Mono" font-size="7.6719" lengthAdjust="spacingAndGlyphs" textLength="66.0967" x="73.1785" y="380.6833">waiter Running</text><rect fill="#EDF6FA" height="29.5075" rx="7.3769" ry="7.3769" style="stroke: #2B6F8E; stroke-width: 0.8852240989493283;" width="101.5057" x="55.474" y="436.7889"/><line style="stroke: #2B6F8E; stroke-width: 0.8852240989493283;" x1="55.474" x2="156.9797" y1="451.621" y2="451.621"/><text fill="#000000" font-family="DejaVu Sans Mono" font-size="7.6719" lengthAdjust="spacingAndGlyphs" textLength="89.7027" x="61.3755" y="446.861">06 STIMULUS RESUMED</text><ellipse cx="106.2269" cy="19.3586" fill="#000000" rx="5.9015" ry="5.9015" style="stroke: none; stroke-width: 0.5901493992995522;"/><ellipse cx="106.2269" cy="508.197" fill="none" rx="5.9015" ry="5.9015" style="stroke: #000000; stroke-width: 0.5901493992995522;"/><ellipse cx="106.522" cy="508.4921" fill="#000000" rx="3.5409" ry="3.5409" style="stroke: none; stroke-width: 0.5901493992995522;"/><!--MD5=[1b6c22f718d70b2acdc4891e2995ec55]
link *start to Empty--><path d="M106.2269,25.4784 C106.2269,32.8789 106.2269,46.3461 106.2269,57.4468 " fill="none" id="*start-&gt;Empty" style="stroke: #8295A0; stroke-width: 0.5901493992995522;"/><polygon fill="#8295A0" points="106.2269,60.2146,108.5875,54.9033,106.2269,57.2639,103.8663,54.9033,106.2269,60.2146" style="stroke: #8295A0; stroke-width: 0.5901493992995522;"/><!--MD5=[a4880e26ac2cdc0de7f354aa96112041]
link Empty to Pending--><path d="M106.2269,91.1089 C106.2269,102.9178 106.2269,119.6781 106.2269,132.4076 " fill="none" id="Empty-&gt;Pending" style="stroke: #8295A0; stroke-width: 0.5901493992995522;"/><polygon fill="#8295A0" points="106.2269,135.3229,108.5875,130.0116,106.2269,132.3722,103.8663,130.0116,106.2269,135.3229" style="stroke: #8295A0; stroke-width: 0.5901493992995522;"/><text fill="#000000" font-family="DejaVu Sans Mono" font-size="7.6719" lengthAdjust="spacingAndGlyphs" textLength="33.0484" x="106.817" y="116.3419">SET_IRQ</text><!--MD5=[5616f7cb50bde399db1f2ae7efa7296c]
link Pending to Given--><path d="M106.2269,166.2172 C106.2269,178.0202 106.2269,194.7864 106.2269,207.51 " fill="none" id="Pending-&gt;Given" style="stroke: #8295A0; stroke-width: 0.5901493992995522;"/><polygon fill="#8295A0" points="106.2269,210.4253,108.5875,205.114,106.2269,207.4746,103.8663,205.114,106.2269,210.4253" style="stroke: #8295A0; stroke-width: 0.5901493992995522;"/><text fill="#000000" font-family="DejaVu Sans Mono" font-size="7.6719" lengthAdjust="spacingAndGlyphs" textLength="51.9331" x="106.817" y="191.4443">GiveFromISR</text><!--MD5=[1c2dd5d84ba08954ba58943cc4492326]
link Given to Switch--><path d="M106.2269,241.3256 C106.2269,253.1285 106.2269,269.8888 106.2269,282.6183 " fill="none" id="Given-&gt;Switch" style="stroke: #8295A0; stroke-width: 0.5901493992995522;"/><polygon fill="#8295A0" points="106.2269,285.5336,108.5875,280.2223,106.2269,282.5829,103.8663,280.2223,106.2269,285.5336" style="stroke: #8295A0; stroke-width: 0.5901493992995522;"/><text fill="#000000" font-family="DejaVu Sans Mono" font-size="7.6719" lengthAdjust="spacingAndGlyphs" textLength="84.9815" x="106.817" y="266.5526">portYIELD_FROM_ISR</text><!--MD5=[b7d08ae4f9d76760ec8e02a899807a57]
link Switch to Taken--><path d="M106.2269,316.428 C106.2269,328.231 106.2269,344.9971 106.2269,357.7207 " fill="none" id="Switch-&gt;Taken" style="stroke: #8295A0; stroke-width: 0.5901493992995522;"/><polygon fill="#8295A0" points="106.2269,360.642,108.5875,355.3306,106.2269,357.6912,103.8663,355.3306,106.2269,360.642" style="stroke: #8295A0; stroke-width: 0.5901493992995522;"/><text fill="#000000" font-family="DejaVu Sans Mono" font-size="7.6719" lengthAdjust="spacingAndGlyphs" textLength="103.8663" x="106.817" y="341.655">restore waiter context</text><!--MD5=[667f95f273f4398779e2224fc978fb4f]
link Taken to Resumed--><path d="M106.2269,391.5186 C106.2269,403.3098 106.2269,420.0582 106.2269,432.77 " fill="none" id="Taken-&gt;Resumed" style="stroke: #8295A0; stroke-width: 0.5901493992995522;"/><polygon fill="#8295A0" points="106.2269,435.6795,108.5875,430.3681,106.2269,432.7287,103.8663,430.3681,106.2269,435.6795" style="stroke: #8295A0; stroke-width: 0.5901493992995522;"/><text fill="#000000" font-family="DejaVu Sans Mono" font-size="7.6719" lengthAdjust="spacingAndGlyphs" textLength="75.5391" x="106.817" y="416.7633">waiter completes</text><!--MD5=[c6ccdde97f90e7952aef870c82e2f1d1]
link Resumed to *end--><path d="M106.2269,466.4203 C106.2269,476.5532 106.2269,489.8434 106.2269,498.554 " fill="none" id="Resumed-&gt;*end" style="stroke: #8295A0; stroke-width: 0.5901493992995522;"/><polygon fill="#8295A0" points="106.2269,501.31,108.5875,495.9986,106.2269,498.3592,103.8663,495.9986,106.2269,501.31" style="stroke: #8295A0; stroke-width: 0.5901493992995522;"/><!--MD5=[b5a5f540820077c6d0ff1a37c770258d]
@startuml
scale max 900*520
skinparam backgroundColor transparent
skinparam shadowing false
skinparam defaultFontName "DejaVu Sans Mono"
skinparam defaultFontSize 13
skinparam stateBorderColor #2b6f8e
skinparam stateBackgroundColor #edf6fa
skinparam ArrowColor #8295a0
top to bottom direction
title A6 STATE — binary semaphore and task readiness across ISR
state "01 EMPTY\nwaiter Blocked" as Empty
state "02 IRQ PENDING\nstimulus interrupted" as Pending
state "03 GIVEN FROM ISR\nwaiter Ready" as Given
state "04 SWITCH REQUESTED\nxHPW=true" as Switch
state "05 TAKEN\nwaiter Running" as Taken
state "06 STIMULUS RESUMED" as Resumed
[*] - -> Empty
Empty - -> Pending : SET_IRQ
Pending - -> Given : GiveFromISR
Given - -> Switch : portYIELD_FROM_ISR
Switch - -> Taken : restore waiter context
Taken - -> Resumed : waiter completes
Resumed - -> [*]
@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: 9.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

+37
View File
@@ -0,0 +1,37 @@
@startuml
scale max 900*520
skinparam backgroundColor transparent
skinparam shadowing false
skinparam defaultFontName "DejaVu Sans Mono"
skinparam defaultFontSize 13
skinparam objectBorderColor #2b6f8e
skinparam objectBackgroundColor #edf6fa
skinparam ArrowColor #8295a0
top to bottom direction
title A7 RUNTIME — three stacks and context-selected return
object "01 waiter TCB" as Waiter {
priority = 3
waiter_sp
state: Blocked → Running
}
object "02 stimulus TCB" as Stimulus {
priority = 2
stimulus_sp
interrupted after SET_IRQ
}
object "03 xISRStack" as ISR {
isr_sp
mcause = 0x8000000b
source_after_clear = 0
}
object "04 binary semaphore" as Sem
object "05 evidence[9]" as Evidence {
E07 waiter before E08 stimulus
}
Stimulus --> ISR : interrupt
ISR --> Sem : GiveFromISR
Sem --> Waiter : unblock
ISR --> Waiter : restore selected context
Waiter --> Evidence
Stimulus --> Evidence
@enduml
+55
View File
@@ -0,0 +1,55 @@
<?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="520.7272px" preserveAspectRatio="none" style="width:427px;height:520px;" version="1.1" viewBox="0 0 427 520" width="427.6503px" zoomAndPan="magnify"><defs/><g><text fill="#000000" font-family="DejaVu Sans Mono" font-size="10.9009" lengthAdjust="spacingAndGlyphs" textLength="355.5367" x="39.4109" y="10.1185">A7 RUNTIME — three stacks and context-selected return</text><rect fill="#EDF6FA" height="60.8196" style="stroke: #2B6F8E; stroke-width: 1.2577950791791073;" width="171.0601" x="163.136" y="364.2011"/><text fill="#000000" font-family="DejaVu Sans Mono" font-size="10.9009" lengthAdjust="spacingAndGlyphs" textLength="87.2071" x="205.0625" y="375.9966">01 waiter TCB</text><line style="stroke: #2B6F8E; stroke-width: 1.2577950791791073;" x1="163.9746" x2="333.3576" y1="380.2446" y2="380.2446"/><text fill="#000000" font-family="DejaVu Sans Mono" font-size="10.9009" lengthAdjust="spacingAndGlyphs" textLength="80.4989" x="168.1672" y="393.7171">priority = 3</text><text fill="#000000" font-family="DejaVu Sans Mono" font-size="10.9009" lengthAdjust="spacingAndGlyphs" textLength="60.3742" x="168.1672" y="406.4064">waiter_sp</text><text fill="#000000" font-family="DejaVu Sans Mono" font-size="10.9009" lengthAdjust="spacingAndGlyphs" textLength="160.9978" x="168.1672" y="419.0958">state: Blocked → Running</text><rect fill="#EDF6FA" height="60.8196" style="stroke: #2B6F8E; stroke-width: 1.2577950791791073;" width="177.7684" x="227.7028" y="19.4059"/><text fill="#000000" font-family="DejaVu Sans Mono" font-size="10.9009" lengthAdjust="spacingAndGlyphs" textLength="100.6236" x="266.2752" y="31.2015">02 stimulus TCB</text><line style="stroke: #2B6F8E; stroke-width: 1.2577950791791073;" x1="228.5414" x2="404.6327" y1="35.4494" y2="35.4494"/><text fill="#000000" font-family="DejaVu Sans Mono" font-size="10.9009" lengthAdjust="spacingAndGlyphs" textLength="80.4989" x="232.734" y="48.922">priority = 2</text><text fill="#000000" font-family="DejaVu Sans Mono" font-size="10.9009" lengthAdjust="spacingAndGlyphs" textLength="73.7906" x="232.734" y="61.6113">stimulus_sp</text><text fill="#000000" font-family="DejaVu Sans Mono" font-size="10.9009" lengthAdjust="spacingAndGlyphs" textLength="167.706" x="232.734" y="74.3006">interrupted after SET_IRQ</text><rect fill="#EDF6FA" height="60.8196" style="stroke: #2B6F8E; stroke-width: 1.2577950791791073;" width="157.6436" x="176.5525" y="144.7913"/><text fill="#000000" font-family="DejaVu Sans Mono" font-size="10.9009" lengthAdjust="spacingAndGlyphs" textLength="80.4989" x="215.1249" y="156.5869">03 xISRStack</text><line style="stroke: #2B6F8E; stroke-width: 1.2577950791791073;" x1="177.391" x2="333.3576" y1="160.8348" y2="160.8348"/><text fill="#000000" font-family="DejaVu Sans Mono" font-size="10.9009" lengthAdjust="spacingAndGlyphs" textLength="40.2494" x="181.5837" y="174.3074">isr_sp</text><text fill="#000000" font-family="DejaVu Sans Mono" font-size="10.9009" lengthAdjust="spacingAndGlyphs" textLength="127.4566" x="181.5837" y="186.9967">mcause = 0x8000000b</text><text fill="#000000" font-family="DejaVu Sans Mono" font-size="10.9009" lengthAdjust="spacingAndGlyphs" textLength="147.5813" x="181.5837" y="199.686">source_after_clear = 0</text><rect fill="#EDF6FA" height="29.4599" style="stroke: #2B6F8E; stroke-width: 1.2577950791791073;" width="139.196" x="192.4846" y="270.1767"/><text fill="#000000" font-family="DejaVu Sans Mono" font-size="10.9009" lengthAdjust="spacingAndGlyphs" textLength="127.4566" x="198.3543" y="281.9723">04 binary semaphore</text><line style="stroke: #2B6F8E; stroke-width: 1.2577950791791073;" x1="193.3231" x2="330.842" y1="286.2202" y2="286.2202"/><rect fill="#EDF6FA" height="35.441" style="stroke: #2B6F8E; stroke-width: 1.2577950791791073;" width="211.3096" x="207.5781" y="476.17"/><text fill="#000000" font-family="DejaVu Sans Mono" font-size="10.9009" lengthAdjust="spacingAndGlyphs" textLength="93.9154" x="266.2752" y="487.9655">05 evidence[9]</text><line style="stroke: #2B6F8E; stroke-width: 1.2577950791791073;" x1="208.4166" x2="418.0492" y1="492.2135" y2="492.2135"/><text fill="#000000" font-family="DejaVu Sans Mono" font-size="10.9009" lengthAdjust="spacingAndGlyphs" textLength="201.2472" x="212.6093" y="505.686">E07 waiter before E08 stimulus</text><!--MD5=[b7e71f7141b02c58c904389e905337d6]
link Stimulus to ISR--><path d="M301.7702,80.6019 C292.9656,98.3871 281.7713,121.0274 272.5726,139.6008 " fill="none" id="Stimulus-&gt;ISR" style="stroke: #8295A0; stroke-width: 0.8385300527860715;"/><polygon fill="#8295A0" points="270.7278,143.3407,277.0826,138.0662,272.5884,139.5835,271.0711,135.0893,270.7278,143.3407" style="stroke: #8295A0; stroke-width: 0.8385300527860715;"/><text fill="#000000" font-family="DejaVu Sans Mono" font-size="10.9009" lengthAdjust="spacingAndGlyphs" textLength="60.3742" x="288.6556" y="116.3374">interrupt</text><!--MD5=[543c5bbe781d98d8f2f3d49b22d318ca]
link ISR to Sem--><path d="M257.2275,205.8447 C258.393,224.5859 259.8605,248.2324 260.8751,264.5921 " fill="none" id="ISR-&gt;Sem" style="stroke: #8295A0; stroke-width: 0.8385300527860715;"/><polygon fill="#8295A0" points="261.1183,268.5751,263.9909,260.8323,260.8545,264.3908,257.296,261.2543,261.1183,268.5751" style="stroke: #8295A0; stroke-width: 0.8385300527860715;"/><text fill="#000000" font-family="DejaVu Sans Mono" font-size="10.9009" lengthAdjust="spacingAndGlyphs" textLength="73.7906" x="260.3636" y="241.7228">GiveFromISR</text><!--MD5=[73d18557beaa1ebac0bafb58cabd0786]
link Sem to Waiter--><path d="M260.33,299.8691 C258.4853,314.7278 255.5085,338.6846 253.0264,358.6752 " fill="none" id="Sem-&gt;Waiter" style="stroke: #8295A0; stroke-width: 0.8385300527860715;"/><polygon fill="#8295A0" points="252.5317,362.675,256.8085,355.6101,253.0591,358.5156,250.1536,354.7662,252.5317,362.675" style="stroke: #8295A0; stroke-width: 0.8385300527860715;"/><text fill="#000000" font-family="DejaVu Sans Mono" font-size="10.9009" lengthAdjust="spacingAndGlyphs" textLength="46.9577" x="257.8145" y="335.7472">unblock</text><!--MD5=[4d2bc5b9e47152e661298c7abd7751c2]
link ISR to Waiter--><path d="M176.368,184.0597 C120.9999,194.273 50.6975,217.4667 14.7162,270.1767 C-26.8246,331.0289 75.5264,364.1508 157.7694,380.3931 " fill="none" id="ISR-&gt;Waiter" style="stroke: #8295A0; stroke-width: 0.8385300527860715;"/><polygon fill="#8295A0" points="161.6602,381.1562,154.8806,376.4402,157.5427,380.3662,153.6166,383.0282,161.6602,381.1562" style="stroke: #8295A0; stroke-width: 0.8385300527860715;"/><text fill="#000000" font-family="DejaVu Sans Mono" font-size="10.9009" lengthAdjust="spacingAndGlyphs" textLength="160.9978" x="15.5547" y="288.7392">restore selected context</text><!--MD5=[5e057b0a8dad3f09c9d5a69954f37c37]
link Waiter to Evidence--><path d="M268.3883,425.2629 C278.2494,440.1719 289.9721,457.8817 298.9527,471.4659 " fill="none" id="Waiter-&gt;Evidence" style="stroke: #8295A0; stroke-width: 0.8385300527860715;"/><polygon fill="#8295A0" points="301.1832,474.8452,299.8072,466.702,298.8659,471.3511,294.2168,470.4098,301.1832,474.8452" style="stroke: #8295A0; stroke-width: 0.8385300527860715;"/><!--MD5=[e04e511a3d6ba16d5e8f40dc15b06440]
link Stimulus to Evidence--><path d="M341.4662,80.6103 C358.7315,104.458 378.6382,139.5254 378.6382,174.3579 C378.6382,174.3579 378.6382,174.3579 378.6382,395.4531 C378.6382,425.9253 356.3753,454.0664 337.8186,472.2206 " fill="none" id="Stimulus-&gt;Evidence" style="stroke: #8295A0; stroke-width: 0.8385300527860715;"/><polygon fill="#8295A0" points="334.8502,475.0632,342.6223,472.2705,337.88,472.1651,337.9854,467.4228,334.8502,475.0632" style="stroke: #8295A0; stroke-width: 0.8385300527860715;"/><!--MD5=[7cbb59bf83159d30751aec88f810183a]
@startuml
scale max 900*520
skinparam backgroundColor transparent
skinparam shadowing false
skinparam defaultFontName "DejaVu Sans Mono"
skinparam defaultFontSize 13
skinparam objectBorderColor #2b6f8e
skinparam objectBackgroundColor #edf6fa
skinparam ArrowColor #8295a0
top to bottom direction
title A7 RUNTIME — three stacks and context-selected return
object "01 waiter TCB" as Waiter {
priority = 3
waiter_sp
state: Blocked → Running
}
object "02 stimulus TCB" as Stimulus {
priority = 2
stimulus_sp
interrupted after SET_IRQ
}
object "03 xISRStack" as ISR {
isr_sp
mcause = 0x8000000b
source_after_clear = 0
}
object "04 binary semaphore" as Sem
object "05 evidence[9]" as Evidence {
E07 waiter before E08 stimulus
}
Stimulus - -> ISR : interrupt
ISR - -> Sem : GiveFromISR
Sem - -> Waiter : unblock
ISR - -> Waiter : restore selected context
Waiter - -> Evidence
Stimulus - -> Evidence
@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: 9.0 KiB

+13
View File
@@ -0,0 +1,13 @@
# FC07 card plan
## Thesis
An ISR and a task use different APIs and different stacks. A FromISR operation
may unblock a higher-priority task, but the task runs immediately only if the
ISR explicitly requests a context switch.
## Evidence
The nine-record replay proves a real MEI cause, source clear before give,
`xHigherPriorityTaskWoken=pdTRUE`, distinct ISR/waiter/stimulus stack pointers,
and ordering `ISR → waiter → interrupted stimulus`.
+319
View File
@@ -0,0 +1,319 @@
% Generated from json/card_source.json by tools/render_card.py.
% Do not edit manually; update the JSON and regenerate.
\documentclass[12pt,a4paper]{article}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage[utf8]{inputenc}
\usepackage[polish]{babel}
\usepackage{csquotes}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{xcolor}
\usepackage[a4paper,left=2.15cm,right=2.15cm,top=0.5cm,bottom=0.5cm,headheight=24mm,headsep=3mm,includehead]{geometry}
\usepackage{eso-pic}
\usepackage{marginnote}
\usepackage{array}
\usepackage{tabularx}
\usepackage{graphicx}
\usepackage{pdflscape}
\usepackage{float}
\usepackage{silence}
\WarningFilter{soulutf8}{This package is obsolete}
\usepackage{pdfcomment}
\usepackage{enumitem}
\usepackage{needspace}
\usepackage{fancyhdr}
\usepackage{lastpage}
\usepackage{microtype}
\usepackage[most]{tcolorbox}
\usepackage{qrcode}
\IfFileExists{references.bib}{%
\usepackage[backend=biber,style=numeric,sorting=none]{biblatex}%
\addbibresource{references.bib}%
}{}
\hypersetup{hidelinks}
\IfFileExists{build-meta.tex}{%
\input{build-meta.tex}%
}{%
\newcommand{\BuildCommit}{lokalna}%
}
\newcommand{\DocumentAuthor}{M. Pabiszczak}
\newcommand{\DocumentYear}{2026}
\newcommand{\CardSeries}{freertos-c}
\newcommand{\CardNumber}{07}
\newcommand{\CardCount}{15}
\newcommand{\CardSlug}{isr-semaphore}
\newcommand{\CardVersion}{v00.01}
\newcommand{\DocumentUUID}{530724e2-6774-5b17-9912-b3f5c243c15d}
\newcommand{\EmptyCheck}{\(\square\)}
\newcommand{\EscAnswerLines}[1][3]{\par\noindent\dotfill\par\noindent\dotfill\par\noindent\dotfill}
\newcommand{\EscWriteRow}[1][2.8em]{\rule{0pt}{#1}}
\setlength{\parindent}{0pt}
\setlength{\parskip}{0.45em}
\setlength{\headheight}{24mm}
\setlength{\headsep}{3mm}
\setlength{\footskip}{8mm}
\setlength{\marginparwidth}{1.5cm}
\setlength{\marginparsep}{0.25cm}
\renewcommand{\arraystretch}{1.22}
% Margin separator lines disabled for layout trial.
\newcommand{\ESCPageResourceHeader}{%
\begingroup%
\setlength{\parskip}{0pt}%
\setlength{\fboxsep}{0pt}%
\setlength{\fboxrule}{0.35pt}%
\setlength{\arrayrulewidth}{0.35pt}%
\noindent\fbox{%
\begin{minipage}[c][23.5mm][c]{\dimexpr\textwidth-2\fboxrule\relax}%
\begin{minipage}[c][23mm][c]{24mm}\centering%
\qrcode[level=L,height=22mm]{https://zsl-gitea.mpabi.pl/edu-freertos-c/lab-rv32i-freertos-c-isr-semaphore}%
\end{minipage}%
\vrule width0.35pt%
\begin{minipage}[c][23mm][c]{\dimexpr\linewidth-48mm-0.7pt\relax}%
\setlength{\tabcolsep}{0pt}%
\renewcommand{\arraystretch}{0}%
\begin{tabularx}{\linewidth}{@{}p{\dimexpr0.50000000\linewidth-\arrayrulewidth\relax}|p{\dimexpr0.15126050\linewidth-\arrayrulewidth\relax}|X@{}}%
\parbox[c][5.19414mm][c]{\linewidth}{\hspace{0.45mm}{\fontsize{3.2}{3.4}\selectfont\ttfamily\bfseries TITLE}\par\nointerlineskip\vspace{0.12mm}\noindent\makebox[\linewidth][r]{{\fontsize{7.7}{7.9}\selectfont\ttfamily\bfseries Przerwanie zewnętrzne i semaphore FromISR}\hspace{0.45mm}}\par} & \parbox[c][5.19414mm][c]{\linewidth}{\hspace{0.45mm}{\fontsize{3.2}{3.4}\selectfont\ttfamily\bfseries VER.}\par\nointerlineskip\vspace{0.12mm}\noindent\makebox[\linewidth][r]{{\fontsize{6.6}{6.8}\selectfont\ttfamily\bfseries v00.01}\hspace{0.45mm}}\par} & \parbox[c][5.19414mm][c]{\linewidth}{\hspace{0.45mm}{\fontsize{3.2}{3.4}\selectfont\ttfamily\bfseries DATETIME}\par\nointerlineskip\vspace{0.12mm}\noindent\makebox[\linewidth][r]{{\fontsize{6.4}{6.6}\selectfont\ttfamily\bfseries 2026-07-19T00:00:00+02:00}\hspace{0.45mm}}\par} \\%
\end{tabularx}%
\par\nointerlineskip%
\hrule height0.35pt%
\nointerlineskip%
\begin{tabularx}{\linewidth}{@{}p{\dimexpr0.50000000\linewidth-\arrayrulewidth\relax}|p{\dimexpr0.25210084\linewidth-\arrayrulewidth\relax}|p{\dimexpr0.14285714\linewidth-\arrayrulewidth\relax}|X@{}}%
\parbox[c][5.19414mm][c]{\linewidth}{\hspace{0.45mm}{\fontsize{3.2}{3.4}\selectfont\ttfamily\bfseries PROJECT}\par\nointerlineskip\vspace{0.12mm}\noindent\makebox[\linewidth][r]{{\fontsize{7.7}{7.9}\selectfont\ttfamily\bfseries Freestanding C nad FreeRTOS}\hspace{0.45mm}}\par} & \parbox[c][5.19414mm][c]{\linewidth}{\hspace{0.45mm}{\fontsize{3.2}{3.4}\selectfont\ttfamily\bfseries SERIES}\par\nointerlineskip\vspace{0.12mm}\noindent\makebox[\linewidth][r]{{\fontsize{6.4}{6.6}\selectfont\ttfamily\bfseries FreeRTOS C}\hspace{0.45mm}}\par} & \parbox[c][5.19414mm][c]{\linewidth}{\hspace{0.45mm}{\fontsize{3.2}{3.4}\selectfont\ttfamily\bfseries CARD}\par\nointerlineskip\vspace{0.12mm}\noindent\makebox[\linewidth][r]{{\fontsize{6.4}{6.6}\selectfont\ttfamily\bfseries 07/15}\hspace{0.45mm}}\par} & \parbox[c][5.19414mm][c]{\linewidth}{\hspace{0.45mm}{\fontsize{3.2}{3.4}\selectfont\ttfamily\bfseries SHEET}\par\nointerlineskip\vspace{0.12mm}\noindent\makebox[\linewidth][r]{{\fontsize{6.4}{6.6}\selectfont\ttfamily\bfseries \thepage/\pageref{LastPage}}\hspace{0.45mm}}\par} \\%
\end{tabularx}%
\par\nointerlineskip%
\hrule height0.35pt%
\nointerlineskip%
\begin{tabularx}{\linewidth}{@{}p{\dimexpr0.05882353\linewidth-\arrayrulewidth\relax}|p{\dimexpr0.05042017\linewidth-\arrayrulewidth\relax}|p{\dimexpr0.14705882\linewidth-\arrayrulewidth\relax}|p{\dimexpr0.09243697\linewidth-\arrayrulewidth\relax}|p{\dimexpr0.07563025\linewidth-\arrayrulewidth\relax}|p{\dimexpr0.07563025\linewidth-\arrayrulewidth\relax}|X@{}}%
\parbox[c][5.19414mm][c]{\linewidth}{\hspace{0.15mm}{\fontsize{2.85}{3}\selectfont\ttfamily\bfseries SUBJ.}\par\nointerlineskip\vspace{0.12mm}\noindent\makebox[\linewidth][r]{{\fontsize{4.45}{4.65}\selectfont\ttfamily\bfseries Inf.}\hspace{0.15mm}}\par} & \parbox[c][5.19414mm][c]{\linewidth}{\hspace{0.15mm}{\fontsize{2.85}{3}\selectfont\ttfamily\bfseries PROG.}\par\nointerlineskip\vspace{0.12mm}\noindent\makebox[\linewidth][r]{{\fontsize{4.45}{4.65}\selectfont\ttfamily\bfseries}\hspace{0.15mm}}\par} & \parbox[c][5.19414mm][c]{\linewidth}{\hspace{0.15mm}{\fontsize{2.85}{3}\selectfont\ttfamily\bfseries CORE}\par\nointerlineskip\vspace{0.12mm}\noindent\makebox[\linewidth][r]{{\fontsize{4.45}{4.65}\selectfont\ttfamily\bfseries}\hspace{0.15mm}}\par} & \parbox[c][5.19414mm][c]{\linewidth}{\hspace{0.15mm}{\fontsize{2.85}{3}\selectfont\ttfamily\bfseries SCOPE}\par\nointerlineskip\vspace{0.12mm}\noindent\makebox[\linewidth][r]{{\fontsize{4.45}{4.65}\selectfont\ttfamily\bfseries}\hspace{0.15mm}}\par} & \parbox[c][5.19414mm][c]{\linewidth}{\hspace{0.15mm}{\fontsize{2.85}{3}\selectfont\ttfamily\bfseries LEVEL}\par\nointerlineskip\vspace{0.12mm}\noindent\makebox[\linewidth][r]{{\fontsize{4.45}{4.65}\selectfont\ttfamily\bfseries}\hspace{0.15mm}}\par} & \parbox[c][5.19414mm][c]{\linewidth}{\hspace{0.15mm}{\fontsize{2.85}{3}\selectfont\ttfamily\bfseries POS.}\par\nointerlineskip\vspace{0.12mm}\noindent\makebox[\linewidth][r]{{\fontsize{4.45}{4.65}\selectfont\ttfamily\bfseries}\hspace{0.15mm}}\par} & \parbox[c][5.19414mm][c]{\linewidth}{\hbox to\linewidth{\hspace{0.35mm}{\fontsize{3.4}{3.75}\selectfont\ttfamily\bfseries GITEA UUID}\hfill{\fontsize{3.4}{3.75}\selectfont\ttfamily 530724e2-6774-5b17-9912-b3f5c243c15d}\hspace{0.35mm}}\par\nointerlineskip\hbox to\linewidth{\hspace{0.35mm}{\fontsize{3.4}{3.75}\selectfont\ttfamily\bfseries CARD UUID} {\fontsize{3.4}{3.75}\selectfont\ttfamily a6da1075-8d1f-5615-b0e6-0fc33e59e1e3}\hfill{\fontsize{3.4}{3.75}\selectfont\ttfamily\bfseries AUTHOR M. Pabiszczak}\hspace{0.35mm}}} \\%
\end{tabularx}%
\par\nointerlineskip%
\hrule height0.35pt%
\nointerlineskip%
\begin{tabularx}{\linewidth}{@{}X@{}}%
\parbox[c][3.46276mm][c]{\linewidth}{\hspace{0.45mm}{\fontsize{4.5}{4.85}\selectfont\ttfamily\bfseries GITEA} {\fontsize{4.5}{4.85}\selectfont\ttfamily\href{https://zsl-gitea.mpabi.pl/edu-freertos-c/lab-rv32i-freertos-c-isr-semaphore}{\nolinkurl{https://zsl-gitea.mpabi.pl/edu-freertos-c/lab-rv32i-freertos-c-isr-semaphore}}}} \\%
\end{tabularx}%
\par\nointerlineskip%
\hrule height0.35pt%
\nointerlineskip%
\begin{tabularx}{\linewidth}{@{}X@{}}%
\parbox[c][3.46276mm][c]{\linewidth}{\hspace{0.45mm}{\fontsize{4.5}{4.85}\selectfont\ttfamily\bfseries HTML} {\fontsize{4.5}{4.85}\selectfont\ttfamily\href{https://dce7fb9d-7b2f-5d49-96a2-3a30d3070b84.mpabi.pl/a6da1075-8d1f-5615-b0e6-0fc33e59e1e3}{\nolinkurl{https://dce7fb9d-7b2f-5d49-96a2-3a30d3070b84.mpabi.pl/a6da1075-8d1f-5615-b0e6-0fc33e59e1e3}}}} \\%
\end{tabularx}%
\end{minipage}%
\vrule width0.35pt%
\begin{minipage}[c][23mm][c]{24mm}\centering%
\qrcode[level=L,height=22mm]{https://dce7fb9d-7b2f-5d49-96a2-3a30d3070b84.mpabi.pl/a6da1075-8d1f-5615-b0e6-0fc33e59e1e3}%
\end{minipage}%
\end{minipage}%
}%
\endgroup%
}
\pagestyle{fancy}
\fancyhf{}
\fancyhead[C]{\ESCPageResourceHeader}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
\newcommand{\ESCMarginTag}[4]{%
\hspace*{#1}\textcolor{#2}{#3~#4}%
}
\newcommand{\ESCSectionBlockStart}{%
\Needspace{8\baselineskip}%
\par\vspace{0.35em}%
\noindent\textcolor{black!28}{\rule{\textwidth}{0.35pt}}%
\par\vspace{0.15em}%
}
\newcommand{\ESCSectionBlockEnd}{%
\par\vspace{0.25em}%
\noindent\textcolor{black!18}{\rule{\textwidth}{0.25pt}}%
\par\vspace{0.45em}%
}
\newcommand{\ESCTinyStepSeparator}{%
\par\vspace{0.10em}%
\noindent{\color{black!18}\leaders\hbox{\rule{0.60em}{0.22pt}\hspace{0.38em}}\hfill\kern0pt}%
\par\vspace{0.10em}%
}
\newtcolorbox{ESCTaskFrame}[1]{enhanced,breakable,arc=0pt,boxrule=0.35pt,colback=white,colframe=black,boxsep=0pt,left=1.4mm,right=1.4mm,top=0.8mm,bottom=0.8mm,colbacktitle=black!7,coltitle=black,title={\ttfamily\bfseries TASK\quad #1}}
\newtcolorbox{ESCBlockFrame}[1]{enhanced,breakable,arc=0pt,boxrule=0.35pt,colback=white,colframe=black!55,boxsep=0pt,left=1.0mm,right=1.0mm,top=0.6mm,bottom=0.6mm,colbacktitle=black!4,coltitle=black,title={\ttfamily\bfseries BLOCK\quad #1}}
\newtcolorbox{ESCStepFrame}[1]{enhanced,breakable,arc=0pt,boxrule=0.35pt,colback=white,colframe=black!28,boxsep=0pt,left=0.8mm,right=0.8mm,top=0.45mm,bottom=0.45mm,colbacktitle=black!2,coltitle=black,title={\ttfamily STEP\quad #1}}
\newtcolorbox{ESCConclusionFrame}{enhanced,breakable,arc=0pt,boxrule=0.45pt,colback=blue!2,colframe=blue!45!black,boxsep=0pt,left=1.2mm,right=1.2mm,top=0.7mm,bottom=0.7mm,colbacktitle=blue!7,coltitle=black,title={\ttfamily\bfseries WNIOSEK}}
\newcommand{\ESCLearningTreeWidget}{%
\reversemarginpar
\marginnote[%
\begin{minipage}{\marginparwidth}%
\raggedright
{\fontsize{3.55}{3.95}\selectfont\ttfamily
\begin{minipage}[t]{\marginparwidth}%
\raggedright
{\bfseries\textcolor{black!65}{TECH}\par}%
\vspace{0.08em}%
\hspace*{0.00em}\textcolor{red}{WE~01}\textcolor{black!48}{}\par%
\hspace*{0.28em}\textcolor{orange!85!black}{EK~LOCAL~RTOS}\textcolor{black!48}{\pdftooltip[width=\textwidth]{.07}{Uczeń odtwarza E01E09 i wiąże mcause, source clear, xHPW, trzy SP oraz kolejność context\textCR restore.}}\par%
\hspace*{0.54em}\textcolor{blue!70!black}{KW~LOCAL~RTOS}\textcolor{black!48}{\pdftooltip[width=\textwidth]{.07}{Łączy kod, diagram i zweryfikowany dowód.}}\par%
\end{minipage}%
}%
\end{minipage}%
]{}
\normalmarginpar
\marginnote{%
\begin{minipage}{\marginparwidth}%
\raggedright
{\fontsize{3.55}{3.95}\selectfont\ttfamily
\hspace*{0.06cm}%
\begin{minipage}[t]{\dimexpr\marginparwidth-0.06cm\relax}%
\raggedright
{\bfseries\textcolor{black!65}{OG}\par}%
\vspace{0.08em}%
\hspace*{0.00em}\textcolor{red}{WE~01}\textcolor{black!48}{}\par%
\hspace*{0.28em}\textcolor{green!50!black}{EN~LOCAL~EN~RTOS}\textcolor{black!48}{\pdftooltip[width=\textwidth]{.07}{Uczeń rozdziela hardware source, trap port, xISRStack, FromISR API i task scheduling.}}\par%
\hspace*{0.54em}\textcolor{blue!70!black}{KW~LOCAL~KW~RTOS}\textcolor{black!48}{\pdftooltip[width=\textwidth]{.07}{Łączy kod, diagram i zweryfikowany dowód.}}\par%
\end{minipage}%
}%
\end{minipage}%
}
}
\begin{document}
\sloppy
\vspace{1.0em}
\noindent{\Large\bfseries Cel karty}\par
\vspace{0.35em}
Uczeń rozdziela task context od ISR context, używa API FromISR i dowodzi natychmiastowego przełączenia do wyższego taska.
\vspace{0.8em}
\noindent\textcolor{black!25}{\rule{\textwidth}{0.35pt}}
\vspace{0.7em}
\noindent{\Large\bfseries Zakres karty}\par
\vspace{0.35em}
Prawdziwe wejście IRQ5 testbencha wywołuje machine external interrupt. Port zapisuje pełny kontekst i przechodzi na xISRStack. ISR czyści źródło, daje binary semaphore i wywołuje portYIELD_FROM_ISR. Waiter priority 3 działa przed powrotem do stimulus priority 2.
\vspace{0.55em}
\small\begin{tabularx}{\textwidth}{@{}>{\ttfamily\raggedright\arraybackslash}p{0.85cm}>{\ttfamily\raggedright\arraybackslash}p{1.45cm}X>{\raggedright\arraybackslash}p{2.45cm}>{\raggedright\arraybackslash}p{1.75cm}>{\ttfamily\raggedright\arraybackslash}p{1.50cm}@{}}
\textbf{Lekcja} & \textbf{Task} & \textbf{Najważniejsza idea} & \textbf{Priorytet} & \textbf{Status} & \textbf{Version} \\ \hline
\hline
\multicolumn{1}{|l|}{\textbf{\texttt{FC07}}} & \multicolumn{1}{l|}{\textbf{\texttt{Task01}}} & \multicolumn{1}{l|}{\textbf{Hazard3 MEI, xISRStack, xSemaphoreGiveFromISR i yield}} & \multicolumn{1}{l|}{\textbf{główny}} & \multicolumn{1}{l|}{\textbf{opracowane}} & \multicolumn{1}{l|}{\textbf{\texttt{v00.01}}} \\ \hline
\end{tabularx}
\normalsize
\vspace{0.8em}
\noindent\textcolor{black!25}{\rule{\textwidth}{0.35pt}}
\clearpage
\begin{landscape}
\ESCSectionBlockStart
\noindent{\small\bfseries A1 — Context \hfill część 1/1 \textperiodcentered\ r1 c1}\par
\vspace{0.35em}
\begin{figure}[H]
\centering
\includegraphics[width=0.52979\linewidth,trim=0.000bp 0.000bp 0.000bp 0.000bp,clip]{\detokenize{../assets/a1-context.png}}
\caption{A1 CONTEXT — IRQ5 do high-priority waitera. — część 1/1 (r1 c1).}
\label{fig:a1-context}
\end{figure}
\ESCSectionBlockEnd
\end{landscape}
\clearpage
\begin{landscape}
\ESCSectionBlockStart
\noindent{\small\bfseries A3 — Dispatch \hfill część 1/1 \textperiodcentered\ r1 c1}\par
\vspace{0.35em}
\begin{figure}[H]
\centering
\includegraphics[width=0.36596\linewidth,trim=0.000bp 0.000bp 0.000bp 0.000bp,clip]{\detokenize{../assets/a3-dispatch.png}}
\caption{A3 DISPATCH — vector, trap, FromISR i restore. — część 1/1 (r1 c1).}
\label{fig:a3-dispatch}
\end{figure}
\ESCSectionBlockEnd
\end{landscape}
\clearpage
\begin{landscape}
\ESCSectionBlockStart
\noindent{\small\bfseries A5 — Flow \hfill część 1/1 \textperiodcentered\ r1 c1}\par
\vspace{0.35em}
\begin{figure}[H]
\centering
\includegraphics[width=0.96383\linewidth,trim=0.000bp 0.000bp 0.000bp 0.000bp,clip]{\detokenize{../assets/a5-flow.png}}
\caption{A5 FLOW — od Blocked przez ISR do natychmiastowego waitera. — część 1/1 (r1 c1).}
\label{fig:a5-flow}
\end{figure}
\ESCSectionBlockEnd
\end{landscape}
\clearpage
\ESCSectionBlockStart
\noindent{\small\bfseries A6 — State \hfill część 1/1 \textperiodcentered\ r1 c1}\par
\vspace{0.35em}
\begin{figure}[H]
\centering
\includegraphics[width=0.4197\linewidth,trim=0.000bp 0.000bp 0.000bp 0.000bp,clip]{\detokenize{../assets/a6-state.png}}
\caption{A6 STATE — empty, given, switch i taken. — część 1/1 (r1 c1).}
\label{fig:a6-state}
\end{figure}
\ESCSectionBlockEnd
\clearpage
\ESCSectionBlockStart
\noindent{\small\bfseries A7 — Runtime \hfill część 1/1 \textperiodcentered\ r1 c1}\par
\vspace{0.35em}
\begin{figure}[H]
\centering
\includegraphics[width=0.64697\linewidth,trim=0.000bp 0.000bp 0.000bp 0.000bp,clip]{\detokenize{../assets/a7-runtime.png}}
\caption{A7 RUNTIME — stimulus TCB, xISRStack i waiter TCB. — część 1/1 (r1 c1).}
\label{fig:a7-runtime}
\end{figure}
\ESCSectionBlockEnd
\clearpage
\ESCSectionBlockStart
\section{Task01 — ISR semaphore}
\begin{ESCTaskFrame}{TASK01 · External IRQ → FromISR semaphore → high-priority task}
{\scriptsize\ttfamily a6da1075-8d1f-5615-b0e6-0fc33e59e1e3}\par
\begin{ESCBlockFrame}{A — kontrakt przerwania}
Rozdziel source, vector, port, ISR i task.
\begin{ESCStepFrame}{order · Ustal kolejność ISR.}
Najpierw clear, potem give, na końcu yield.
\end{ESCStepFrame}
\begin{ESCStepFrame}{predict · Przewidź context restore.}
Wskaż, czy pierwszy wykona się waiter czy stimulus.
\end{ESCStepFrame}
\end{ESCBlockFrame}
\begin{ESCBlockFrame}{B — replay Hazard3}
Każdy RUN zaczyna się od czystej RAM i wyłączonego źródła.
\begin{ESCStepFrame}{trap · Zbadaj E03E05.}
Zapisz mcause, mepc, isr_sp i source state.
\end{ESCStepFrame}
\begin{ESCStepFrame}{handoff · Zbadaj E06E08.}
Porównaj xHPW i kolejność tasków.
\end{ESCStepFrame}
\begin{ESCStepFrame}{pass · Zbadaj E09.}
Sprawdź trzy stosy, markers i digest.
\end{ESCStepFrame}
\end{ESCBlockFrame}
\begin{ESCBlockFrame}{Ćwiczenie · Ćwiczenie — brak yield request}
W kontrolowanym wariancie pomiń portYIELD_FROM_ISR, zachowując GiveFromISR. Zmierz, kiedy waiter zacznie działać i wskaż następny legalny scheduling point.
\par\textbf{Evidence:} Dwa timestampowane ślady E07/E08 z yield i bez yield oraz opis różnicy.
\par\textbf{Acceptance:} Uczeń nie myli odblokowania taska z natychmiastowym wykonaniem i przywraca poprawny yield w wersji finalnej.
\end{ESCBlockFrame}
\tcblower\textbf{Task acceptance:} PASS; mcause=MEI; source=0 przed give; xHPW=1; waiter E07 przed stimulus E08; trzy różne stosy; deterministyczny digest.
\end{ESCTaskFrame}
\begin{ESCConclusionFrame}
ISR działa na osobnym stacku i używa FromISR API. xHigherPriorityTaskWoken jest informacją dla portu; dopiero portYIELD_FROM_ISR powoduje restore kontekstu wyższego taska przed powrotem do przerwanego kodu.
\end{ESCConclusionFrame}
\ESCSectionBlockEnd
\end{document}
+4
View File
@@ -0,0 +1,4 @@
# Page layout
A1, A3, A5, A6 and A7 each use one fresh landscape page. Generated diagrams are
single SVGs below 900×520 and require neither tiling nor scrollbars.