-
Notifications
You must be signed in to change notification settings - Fork 0
Upgrade rust edition, remove cbindgen #22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Upgrades the Rust edition to 2024 and removes cbindgen, updating exported symbols and unsafe pointer usage as required.
- Changed #[no_mangle] attributes to #[unsafe(no_mangle)] in exported functions.
- Wrapped calls requiring unsafe behavior in explicit unsafe blocks.
- Removed the cbindgen generation in build.rs and updated the public API header accordingly.
Reviewed Changes
Copilot reviewed 13 out of 16 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
kernel/src/syscalls/tasks.rs | Updated syscall attribute for reschedule syscall. |
kernel/src/syscalls/dummy.rs | Updated syscall attribute for dummy syscall. |
kernel/src/sched/scheduler.rs | Updated syscall attributes for scheduler functions. |
kernel/src/mem/pool.rs | Added an unsafe block for NonZeroUsize creation. |
kernel/src/mem/boxed.rs | Reordered imports; no functional changes. |
kernel/src/mem/alloc.rs | Wrapped pointer arithmetic and writes in unsafe blocks. |
kernel/src/mem.rs | Wrapped allocator.free call in an unsafe block. |
kernel/src/lib.rs | Updated kernel initialization function with unsafe block. |
kernel/macros/Cargo.toml | Upgraded dependency versions. |
kernel/include/kernel/lib.h | Removed syscall declarations in line with cbindgen removal. |
kernel/build.rs | Eliminated cbindgen generation; now using direct syscall map generation. |
Files not reviewed (3)
- .devcontainer/Dockerfile: Language not supported
- hal/stm32l4: Language not supported
- kernel/Cargo.toml.in: Language not supported
Comments suppressed due to low confidence (5)
kernel/src/syscalls/tasks.rs:12
- Verify that the custom attribute #[unsafe(no_mangle)] is correctly handled by the toolchain and does not affect symbol export or linking.
#[unsafe(no_mangle)]
kernel/src/syscalls/dummy.rs:5
- Ensure that changing #[no_mangle] to #[unsafe(no_mangle)] for the dummy syscall is compatible with the rest of the system and intended symbol visibility.
#[unsafe(no_mangle)]
kernel/src/sched/scheduler.rs:183
- Confirm that applying #[unsafe(no_mangle)] to exported scheduler functions does not interfere with expected external linkage or runtime behavior.
#[unsafe(no_mangle)]
kernel/include/kernel/lib.h:59
- The removal of syscall declarations in the header is intentional with cbindgen removal; please ensure that any external consumers no longer rely on these declarations.
void syscall_dummy(const void *svc_args);
kernel/src/mem/alloc.rs:155
- Review the unsafe pointer arithmetic here to ensure that the offset calculation remains correct and memory safety is maintained.
unsafe { ptr.byte_add(size_of::<BestFitMeta>() + Self::align_up()) }
LCOV of commit
|
Upgrades the rust edition to 2024. Implements the first two points of #21.