[codex] Slim ARM kernel arch with bluekernel_arch#411
Draft
xuchang-vivo wants to merge 3 commits into
Draft
Conversation
Contributor
Author
|
build_prs |
|
Job is started, see https://github.com/vivoblueos/kernel/actions/runs/25621202208. |
|
✅ All jobs completed successfully, see https://github.com/vivoblueos/kernel/actions/runs/25621202208. |
ad830ea to
5d4d997
Compare
5d4d997 to
53ef696
Compare
Contributor
Author
|
build_prs |
|
Job is started, see https://github.com/vivoblueos/kernel/actions/runs/25632972890. |
|
❌ Job failed. Failed jobs: build_and_check_boards (failure), see https://github.com/vivoblueos/kernel/actions/runs/25632972890. |
Contributor
Author
|
build_prs |
|
Job is started, see https://github.com/vivoblueos/kernel/actions/runs/25633396644. |
|
✅ All jobs completed successfully, see https://github.com/vivoblueos/kernel/actions/runs/25633396644. |
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
This PR slims down the ARM kernel architecture layer by moving Cortex-M-only building blocks into
bluekernel_arch.The kernel side now keeps the OS-specific exception and scheduler glue, while architecture-owned pieces such as NVIC/SCB/SysTick/MPU wrappers, xPSR and exception-frame helpers, HardFault decoding, IRQ registry logic, saved
Context, local IRQ helpers, and the fixed Cortex-M exception vector layout live underkernel/arch.Why
The main goal is to make
kernel/src/arch/armsmaller and more focused. Cortex-M register layouts, exception frames, vector-table slots, and raw architectural helpers do not depend on kernel policy, so keeping them in the kernel makes the kernel layer heavier than necessary and mixes two different responsibilities.Putting those pieces into
bluekernel_archgives BlueOS a local, controllable architecture crate. That is useful for maintenance because BlueOS uses GN: rustflags are not transparently forwarded into external Rust dependencies. For example, using the upstreamcortex-mcrate's FPU register support may require passing feature/cfg such ashas_fpu; with the current GN integration that can force changes around an external dependency boundary. Maintaining a small in-tree low-level architecture crate avoids that friction, and with current AI-assisted development the cost of writing and maintaining these thin register/assembly wrappers is manageable.Changes
bluekernel_archand remove duplicate kernel-side implementations.bluekernel_arch.Contexttype intobluekernel_arch, including hard-float ABI support.bluekernel_archwithglobal_asm!; the kernel now only provides the OS-specific handlers.IsrContextalias usage withExceptionStackFrame.cortex-mcrate dependency and route its NVIC test shims throughbluekernel_arch.Validation
/Users/xuchang/workspace/bluekernel_toolchain/usr/local/bin/rustfmt ...gn format --dry-run adapter/cmsis/BUILD.gn/Users/xuchang/workspace/bluekernel_toolchain/usr/local/bin/rustfmt --check adapter/cmsis/src/validation.rsninja -C out/qemu_mps2_an385.release kernel/arch:bluekernel_arch kernel/kernel:blueosninja -C out/qemu_mps2_an385.release kernel/adapter/cmsis:adapter_validationninja -C out/qemu_mps2_an385.release kernel/adapter/cmsis:run_adapter_validationninja -C out/qemu_mps2_an385.release check_allNote:
run_adapter_validationstill prints the existingTC_osEventFlagsNew_1 FAILEDCMSIS validation case, but the ninja target exits successfully as before.