feat: promote all qemu/cortex components to cortex_m - #104
Merged
Conversation
Closes #97 — PendSV-based LowPriorityInterrupt with Trigger/Register/ Unregister built on the existing InterruptHandler/InterruptTable machinery. Extends EnableIrq/DisableIrq/ClearPendingIrq in InterruptCortex to handle pendSvIrq via SCB SHPR3 priority and ICSR PENDSVCLR. Closes #96 — DataWatchpointAndTrace cycle counter using fixed DWT/CoreDebug register addresses (no CMSIS headers), matching the existing pattern. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Use a no-op lambda initialised in the constructor and reset in Unregister so Invoke() can call onInvoke() unconditionally, avoiding a branch in ISR context. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Inherit from InterfaceConnector<LowPriorityInterrupt> so that constructing a second instance asserts at runtime, matching the pattern used by InterruptTable and FaultTracer. Also moves onInvoke sentinel initialisation inline on the member declaration, removing the explicit constructor. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Move SystemTick, SystemTickTimerService, Reset, EventDispatcherCortex, and Semihosting from hal/qemu/cortex/ to hal/cortex_m/ so any Cortex-M HAL (not just QEMU) can use them without reimplementing locally. Key changes: - Reset now implements hal::Reset (takes const char* resetReason) - EventDispatcherCortexWorker switches base to EventDispatcherWorkerImpl and uses DSB+WFE/SEV for proper ARM sleep/wakeup instead of bare WFI - hal.qemu.cortex becomes an INTERFACE library (no sources remain) - All hal/qemu/default_init and test consumers updated to new paths Closes #100, #101, #102 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
✅
|
| Descriptor | Linter | Files | Fixed | Errors | Warnings | Elapsed time |
|---|---|---|---|---|---|---|
| ✅ ACTION | actionlint | 5 | 0 | 0 | 0.27s | |
| ✅ ACTION | zizmor | 5 | 5 | 0 | 0 | 2.43s |
| ✅ CPP | clang-format | 1065 | 10 | 0 | 0 | 7.57s |
| ✅ DOCKERFILE | hadolint | 1 | 0 | 0 | 0.05s | |
| ✅ JSON | jsonlint | 8 | 0 | 0 | 0.27s | |
| ✅ JSON | prettier | 8 | 7 | 0 | 0 | 0.43s |
| markdownlint | 27 | 7 | 51 | 0 | 1.49s | |
| ✅ MARKDOWN | markdown-table-formatter | 27 | 7 | 0 | 0 | 0.2s |
| betterleaks | yes | 1 | 4 | 0.97s | ||
| ✅ REPOSITORY | checkov | yes | no | no | 34.82s | |
| ✅ REPOSITORY | git_diff | yes | no | no | 0.07s | |
| ✅ REPOSITORY | grype | yes | no | no | 64.01s | |
| ✅ REPOSITORY | ls-lint | yes | no | no | 0.01s | |
| ✅ REPOSITORY | secretlint | yes | no | no | 11.48s | |
| ✅ REPOSITORY | syft | yes | no | no | 1.21s | |
| ✅ REPOSITORY | trivy | yes | no | no | 11.86s | |
| ✅ REPOSITORY | trivy-sbom | yes | no | no | 0.25s | |
| ✅ REPOSITORY | trufflehog | yes | no | no | 2.19s | |
| lychee | 192 | 2 | 0 | 89.06s | ||
| ✅ YAML | prettier | 8 | 8 | 0 | 0 | 0.55s |
| ✅ YAML | v8r | 8 | 0 | 0 | 5.68s | |
| ✅ YAML | yamllint | 8 | 0 | 0 | 0.42s |
Detailed Issues
⚠️ REPOSITORY / betterleaks - 1 error
warning: private-key has detected secret for file services/network/tls/test_doubles/Certificates.cpp.
┌─ services/network/tls/test_doubles/Certificates.cpp:56:15
│
56 │ "HIDDEN_BY_MEGALINTER\r\n";
│ ╰──────────────────────────────────────────^
warning: private-key has detected secret for file services/network/tls/test_doubles/Certificates.cpp.
┌─ services/network/tls/test_doubles/Certificates.cpp:108:15
│
108 │ "HIDDEN_BY_MEGALINTER\r\n";
│ ╰──────────────────────────────────────────^
warning: generic-api-key has detected secret for file services/network/websocket/WebSocket.cpp.
┌─ services/network/websocket/WebSocket.cpp:81:50
│
81 │ headers.push_back(services::HttpHeader("Sec-Websocket-Key", "AQIDBAUGBbgJCgsMDQ4PEC=="));
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: private-key has detected secret for file services/network/tls/CertificatesMbedTls.cpp.
┌─ services/network/tls/CertificatesMbedTls.cpp:125:21
│
125 │ stream << "HIDDEN_BY_MEGALINTER\r\n";
│ ╰────────────────────────────────────────────────^
warning: 4 warnings emitted
⚠️ SPELL / lychee - 2 errors
📝 Summary
---------------------
🔍 Total..........478
🔗 Unique.........442
✅ Successful.....476
⏳ Timeouts.........0
🔀 Redirected.....188
👻 Excluded.........0
❓ Unknown..........0
🚫 Errors...........2
⛔ Unsupported......2
Errors in docs/index.md
[404] https://github.com/embedded-pro/embeddedinfralib/issues/37 (at 41:167) | Rejected status code: 404 Not Found
Errors in external/protoc/CMakeLists.txt
[404] https://github.com/protocolbuffers/protobuf/releases/download/v$%7Bprotobuf_tag%7D/protoc-$%7Bprotobuf_version%7D-$%7Bos_postfix%7D.zip (at 18:13) | Rejected status code: 404 Not Found
Hint: Followed 188 redirects. You might want to consider replacing redirecting URLs with the resolved URLs. Use verbose mode (`-v`/`-vv`) to see redirection details.
Hint: You can configure accepted/rejected response codes with `-a` or `--accept`
⚠️ MARKDOWN / markdownlint - 51 errors
.claude/agents/executor.md:7 error MD041/first-line-heading/first-line-h1 First line in a file should be a top-level heading [Context: "You are the executor agent for..."]
.claude/agents/orchestrator.md:7 error MD041/first-line-heading/first-line-h1 First line in a file should be a top-level heading [Context: "You are the orchestrator agent..."]
.claude/agents/planner.md:7 error MD041/first-line-heading/first-line-h1 First line in a file should be a top-level heading [Context: "You are the planner agent for ..."]
.claude/agents/reviewer.md:7 error MD041/first-line-heading/first-line-h1 First line in a file should be a top-level heading [Context: "You are the reviewer agent for..."]
.github/agents/executor.agent.md:11 error MD041/first-line-heading/first-line-h1 First line in a file should be a top-level heading [Context: "You are the executor agent for..."]
.github/agents/executor.agent.md:108:401 error MD013/line-length Line length [Expected: 400; Actual: 416]
.github/agents/orchestrator.agent.md:18 error MD041/first-line-heading/first-line-h1 First line in a file should be a top-level heading [Context: "You are the orchestrator agent..."]
.github/agents/planner.agent.md:11 error MD041/first-line-heading/first-line-h1 First line in a file should be a top-level heading [Context: "You are the planner agent for ..."]
.github/agents/planner.agent.md:89:401 error MD013/line-length Line length [Expected: 400; Actual: 609]
.github/agents/reviewer.agent.md:14 error MD041/first-line-heading/first-line-h1 First line in a file should be a top-level heading [Context: "You are the reviewer agent for..."]
.github/agents/reviewer.agent.md:116:401 error MD013/line-length Line length [Expected: 400; Actual: 514]
.github/prompts/orchestrate.prompt.md:8 error MD041/first-line-heading/first-line-h1 First line in a file should be a top-level heading [Context: "Analyze the following task for..."]
docs/CodingStandard.md:98:401 error MD013/line-length Line length [Expected: 400; Actual: 457]
docs/CodingStandard.md:481:401 error MD013/line-length Line length [Expected: 400; Actual: 670]
docs/Containers.md:5:401 error MD013/line-length Line length [Expected: 400; Actual: 537]
docs/Containers.md:11:401 error MD013/line-length Line length [Expected: 400; Actual: 566]
docs/Containers.md:24:401 error MD013/line-length Line length [Expected: 400; Actual: 454]
docs/Containers.md:46:401 error MD013/line-length Line length [Expected: 400; Actual: 812]
docs/Containers.md:86:401 error MD013/line-length Line length [Expected: 400; Actual: 557]
docs/Echo.md:5:401 error MD013/line-length Line length [Expected: 400; Actual: 508]
docs/Echo.md:7:401 error MD013/line-length Line length [Expected: 400; Actual: 416]
docs/Echo.md:38:401 error MD013/line-length Line length [Expected: 400; Actual: 511]
docs/Echo.md:49:401 error MD013/line-length Line length [Expected: 400; Actual: 476]
docs/Echo.md:53:401 error MD013/line-length Line length [Expected: 400; Actual: 554]
docs/Echo.md:59 error MD040/fenced-code-language Fenced code blocks should have a language specified [Context: "```"]
docs/Echo.md:65 error MD040/fenced-code-language Fenced code blocks should have a language specified [Context: "```"]
docs/Echo.md:73:401 error MD013/line-length Line length [Expected: 400; Actual: 887]
docs/ExecutionModel.md:7:401 error MD013/line-length Line length [Expected: 400; Actual: 632]
docs/ExecutionModel.md:9:401 error MD013/line-length Line length [Expected: 400; Actual: 834]
docs/ExecutionModel.md:11:401 error MD013/line-length Line length [Expected: 400; Actual: 642]
docs/ExecutionModel.md:15:401 error MD013/line-length Line length [Expected: 400; Actual: 812]
docs/ExecutionModel.md:19:401 error MD013/line-length Line length [Expected: 400; Actual: 456]
docs/ExecutionModel.md:27:401 error MD013/line-length Line length [Expected: 400; Actual: 724]
docs/index.md:5:401 error MD013/line-length Line length [Expected: 400; Actual: 487]
docs/index.md:9 error MD040/fenced-code-language Fenced code blocks should have a language specified [Context: "```"]
docs/MemoryRange.md:3:401 error MD013/line-length Line length [Expected: 400; Actual: 862]
docs/MemoryRange.md:5:401 error MD013/line-length Line length [Expected: 400; Actual: 441]
docs/NetworkConnections.md:5:401 error MD013/line-length Line length [Expected: 400; Actual: 439]
docs/NetworkConnections.md:9:401 error MD013/line-length Line length [Expected: 400; Actual: 496]
docs/Sesame.md:9 error MD040/fenced-code-language Fenced code blocks should have a language specified [Context: "```"]
docs/Sesame.md:25:401 error MD013/line-length Line length [Expected: 400; Actual: 445]
docs/Sesame.md:29 error MD040/fenced-code-language Fenced code blocks should have a language specified [Context: "```"]
docs/Sesame.md:41 error MD040/fenced-code-language Fenced code blocks should have a language specified [Context: "```"]
docs/Sesame.md:58 error MD040/fenced-code-language Fenced code blocks should have a language specified [Context: "```"]
docs/Sesame.md:73 error MD040/fenced-code-language Fenced code blocks should have a language specified [Context: "```"]
docs/Sesame.md:91 error MD040/fenced-code-language Fenced code blocks should have a language specified [Context: "```"]
docs/Sesame.md:120 error MD040/fenced-code-language Fenced code blocks should have a language specified [Context: "```"]
external/crypto/tiny-aes128/README.md:1 error MD041/first-line-heading/first-line-h1 First line in a file should be a top-level heading [Context: "### Tiny AES128 in C"]
external/crypto/tiny-aes128/README.md:29 error MD046/code-block-style Code block style [Expected: fenced; Actual: indented]
external/crypto/tiny-aes128/README.md:39 error MD046/code-block-style Code block style [Expected: fenced; Actual: indented]
external/crypto/tiny-aes128/README.md:49 error MD046/code-block-style Code block style [Expected: fenced; Actual: indented]
Notices
📣 MegaLinter 9.5.0 is out! Discover the new features and security recommendations in the release announcement. (Skip this info by defining SECURITY_SUGGESTIONS: false)
See detailed reports in MegaLinter artifacts
Your project could benefit from a custom flavor, which would allow you to run only the linters you need, and thus improve runtime performances. (Skip this info by defining FLAVOR_SUGGESTIONS: false)
- Documentation: Custom Flavors
- Command:
npx mega-linter-runner@9.6.0 --custom-flavor-setup --custom-flavor-linters ACTION_ACTIONLINT,ACTION_ZIZMOR,CPP_CLANG_FORMAT,DOCKERFILE_HADOLINT,JSON_JSONLINT,JSON_PRETTIER,MARKDOWN_MARKDOWNLINT,MARKDOWN_MARKDOWN_TABLE_FORMATTER,REPOSITORY_CHECKOV,REPOSITORY_GIT_DIFF,REPOSITORY_BETTERLEAKS,REPOSITORY_GRYPE,REPOSITORY_LS_LINT,REPOSITORY_SECRETLINT,REPOSITORY_SYFT,REPOSITORY_TRIVY,REPOSITORY_TRIVY_SBOM,REPOSITORY_TRUFFLEHOG,SPELL_LYCHEE,YAML_PRETTIER,YAML_YAMLLINT,YAML_V8R

Show us your support by starring ⭐ the repository
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
hal/qemu/cortex/SystemTicktohal/cortex_m/SystemTick#101), SystemTickTimerService (Movehal/qemu/cortex/SystemTickTimerServicetohal/cortex_m/SystemTickTimerService#102), Reset (Generalizehal/qemu/cortex/Resettohal/cortex_m/Reset#100), EventDispatcherCortex, and Semihosting are all moved fromhal/qemu/cortex/tohal/cortex_m/so any downstream Cortex-M HAL can use them without reimplementing locally or depending on the QEMU gate (EMIL_BUILD_QEMU).hal::cortex::Resetnow implementshal::Reset(ResetModule(const char* resetReason)) — theresetReasonparameter is accepted and ignored at this layer; callers are responsible for tracing before reset.EventDispatcherCortexWorkerswitches its base fromEventDispatcherWithWeakPtrWorkertoEventDispatcherWorkerImpland adopts the DSB+WFE/SEV pattern for proper ARM sleep/wakeup (memory barrier before sleep, send-event to unblock a waiting core/interrupt), replacing the barewfi.hal.qemu.cortexbecomes a CMakeINTERFACElibrary (no compilation units remain) and continues to exposehal.cortex_m,infra.event,infra.timer, andhal.interfacesto its five existing consumers without requiring changes at their call sites.hal::TimeKeeperGenericvs. ahal/cortex_m/TimeKeeper— which is the intended pattern for injected timer-service consumers? #103 (TimeKeeperGenericvs injectedTimeKeeper) was answered and closed —TimeKeeperGenericis the correct pattern onceSystemTickTimerServiceis registered.Test plan
cmake --preset host && cmake --build --preset host-Debugbuilds cleanlyctest --preset hostpasses (host-side tests unaffected by embedded-only changes)cmake --preset embedded && cmake --build --preset embeddedbuilds cleanly for Cortex-M targetshal.qemu.test) passes —TestSystemTickTimerServiceexercises the promotedSystemTickTimerServicefrom its new location🤖 Generated with Claude Code