Skip to content

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

Merged
merged 13 commits into from
Apr 3, 2025
Merged

Conversation

thomasw04
Copy link
Member

Upgrades the rust edition to 2024. Implements the first two points of #21.

@Copilot Copilot AI review requested due to automatic review settings April 2, 2025 19:51
Copy link

@Copilot Copilot AI left a 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()) }

Copy link

github-actions bot commented Apr 2, 2025

LCOV of commit 99b3323 during Osiris CI #128

This pull request changes total coverage 0.00% (3.73% -> 3.73%) for this diff

Summary coverage rate:
  lines......: 3.7% (80 of 2146 lines)
  functions..: 0.2% (1 of 441 functions)
  branches...: no data found

Files changed coverage rate: n/a

@thomasw04 thomasw04 merged commit 084bdad into main Apr 3, 2025
10 checks passed
@thomasw04 thomasw04 deleted the upgrade/rust-edition branch April 3, 2025 13:01
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.

2 participants