Skip to content

fix: missing constants and AtomicU64 for --all-features on riscv32 target #11

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

zjp-CN
Copy link
Contributor

@zjp-CN zjp-CN commented Dec 31, 2024

For context: #10 (comment)

This PR includes

  1. fixing missing constants like TCB_SIZE
  2. replacing u64 with usize in fields of TaskId and TaskInner: all changes are
  • struct TaskId(u64) => struct TaskId(usize)
  • static ID_COUNTER: AtomicU64 => static ID_COUNTER: AtomicUsize
  • process_id: AtomicU64 => process_id: AtomicUsize
  • set_child_tid: AtomicU64 => set_child_tid: AtomicUsize
  • clear_child_tid: AtomicU64 => clear_child_tid: AtomicUsize
  • cpu_set: AtomicU64 => cpu_set: AtomicUsize
  1. setting up CI for all targets and all features: it's weird there are errors saying unrecognized instruction mnemonic for riscv code on latest nightly rustc, but no error on a bit older toolchain nightly-2024-12-04. This has been reported to Rust repo met unrecognized instruction mnemonic error when naked function uses macro defined in global_asm! rust-lang/rust#134960 .

截图_20241231134510

error[E0425]: cannot find value `TCB_SIZE` in this scope
   --> src/tls.rs:139:9
    |
139 |         TCB_SIZE + GAP_ABOVE_TP
    |         ^^^^^^^^ not found in this scope
taskctx $ cargo c --all-features --target riscv32imafc-unknown-none-elf
   Compiling taskctx v0.1.0 (/rust/tmp/repos/taskctx)
error[E0432]: unresolved import `core::sync::atomic::AtomicU64`
  --> src/task.rs:12:53
   |
12 |     sync::atomic::{AtomicBool, AtomicI32, AtomicU8, AtomicU64, AtomicUsize, Ordering},
   |                                                     ^^^^^^^^^
   |                                                     |
   |                                                     no `AtomicU64` in `sync::atomic`
   |                                                     help: a similar name exists in the module: `AtomicU32`

Changes:
* struct TaskId(u64) => struct TaskId(usize)
* static ID_COUNTER: AtomicU64 => static ID_COUNTER: AtomicUsize
* process_id: AtomicU64 => process_id: AtomicUsize
* set_child_tid: AtomicU64 => set_child_tid: AtomicUsize
* clear_child_tid: AtomicU64 => clear_child_tid: AtomicUsize
* cpu_set: AtomicU64 => cpu_set: AtomicUsize
zjp-CN added a commit to os-checker/dockerfiles that referenced this pull request Dec 31, 2024
zjp-CN added a commit to os-checker/naked_fn that referenced this pull request Dec 31, 2024
@Azure-stars Azure-stars merged commit bee485a into Starry-OS:main Jan 2, 2025
@zjp-CN zjp-CN deleted the fix/all-features_riscv32imafc-unknown-none-elf branch January 2, 2025 02:53
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