Skip to content

Split allocator crate#426

Open
han-jiang277 wants to merge 7 commits into
mainfrom
split-allocator-crate
Open

Split allocator crate#426
han-jiang277 wants to merge 7 commits into
mainfrom
split-allocator-crate

Conversation

@han-jiang277

Copy link
Copy Markdown
Contributor

No description provided.

han-jiang277 and others added 6 commits June 12, 2026 16:28
…d ContextSwitchHookHolder

Zero-dependency traits crate to break arch↔scheduler circular dependency.

Co-Authored-By: Claude <noreply@anthropic.com>
Extract pure architecture code (CSR register ops, Context struct,
asm macros, constants) from kernel/src/arch/riscv/mod.rs into
a standalone arch crate (crate name: arch_crate).

The kernel's arch module remains intact — the arch crate is linked
as a separate dependency for future use.

Co-Authored-By: Claude <noreply@anthropic.com>
Remove scheduler/boards/kernel-dependent code from arch crate:
- Replace crate::scheduler imports with core_traits
- Remove pend_switch_context kernel check (simplified)
- Remove start_schedule (kernel-dependent)
- Remove send_ipi (boards-dependent)
- Remove trap.rs (kernel-dependent, stays in kernel crate)
- Keep pure arch code: CSR ops, Context struct, macros, constants

Co-Authored-By: Claude <noreply@anthropic.com>
- Complete truncated license header in arch/src/lib.rs
- Apply rustfmt to core_traits/src/lib.rs, arch/src/lib.rs, arch/src/riscv/mod.rs
- Apply gn format to core_traits/BUILD.gn, arch/BUILD.gn, kernel/BUILD.gn

Co-Authored-By: Claude <noreply@anthropic.com>
These board-specific dependencies cause GN resolution failures
for boards that don't include them in their dependency chain.
Arch crate only needs core_traits, blueos_kconfig, and blueos_hal.

Co-Authored-By: Claude <noreply@anthropic.com>
Required for gn gen to resolve the rustflags.txt input dependency.
Without this, boards fail with 'Input to target not generated by
a dependency'.

Co-Authored-By: Claude <noreply@anthropic.com>
@han-jiang277

Copy link
Copy Markdown
Contributor Author

build_prs

@github-actions

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown

❌ Job failed. Failed jobs: build_and_check_boards (failure), see https://github.com/vivoblueos/kernel/actions/runs/27537189948.

Move raw heap implementations (TLSF, LLFF, SLAB, block, support)
to kernel/allocator/ as allocator_crate. Keep SpinLock wrappers
and GlobalAlloc impl in kernel crate.

Co-Authored-By: Claude <noreply@anthropic.com>
@han-jiang277 han-jiang277 force-pushed the split-allocator-crate branch from ca79688 to 09745e1 Compare June 15, 2026 09:47
@han-jiang277

Copy link
Copy Markdown
Contributor Author

build_prs

@github-actions

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown

✅ All jobs completed successfully, see https://github.com/vivoblueos/kernel/actions/runs/27538348553.

@han-jiang277

Copy link
Copy Markdown
Contributor Author

build_prs

@github-actions

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown

✅ All jobs completed successfully, see https://github.com/vivoblueos/kernel/actions/runs/27542541479.

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