Skip to content

feat: promote all qemu/cortex components to cortex_m - #104

Merged
gabrielfrasantos merged 7 commits into
mainfrom
feat/cortex-m-generalize-hal
Aug 26, 2026
Merged

feat: promote all qemu/cortex components to cortex_m#104
gabrielfrasantos merged 7 commits into
mainfrom
feat/cortex-m-generalize-hal

Conversation

@gabrielfrasantos

Copy link
Copy Markdown
Contributor

Summary

Test plan

  • cmake --preset host && cmake --build --preset host-Debug builds cleanly
  • ctest --preset host passes (host-side tests unaffected by embedded-only changes)
  • cmake --preset embedded && cmake --build --preset embedded builds cleanly for Cortex-M targets
  • QEMU integration test (hal.qemu.test) passes — TestSystemTickTimerService exercises the promoted SystemTickTimerService from its new location

🤖 Generated with Claude Code

gabrielfrasantos and others added 5 commits August 25, 2026 14:35
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>
@github-actions

github-actions Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

⚠️MegaLinter analysis: Success with warnings

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
⚠️ MARKDOWN markdownlint 27 7 51 0 1.49s
✅ MARKDOWN markdown-table-formatter 27 7 0 0 0.2s
⚠️ REPOSITORY 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
⚠️ SPELL 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

MegaLinter is graciously provided by OX Security
Show us your support by starring ⭐ the repository

Comment thread hal/qemu/default_init/EventInfrastructure.hpp
@gabrielfrasantos gabrielfrasantos changed the title feat(hal/cortex_m): promote all qemu/cortex components to cortex_m feat: promote all qemu/cortex components to cortex_m Aug 26, 2026
gabrielfrasantos and others added 2 commits August 26, 2026 10:32
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>
@sonarqubecloud

Copy link
Copy Markdown

@gabrielfrasantos
gabrielfrasantos merged commit b2ac7ed into main Aug 26, 2026
26 checks passed
@gabrielfrasantos
gabrielfrasantos deleted the feat/cortex-m-generalize-hal branch August 26, 2026 11:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant