Conversation
Add the riscv64-linux OS layer mirroring the aarch64 one: - riscv64 arms in shared.mach for the syscall numbers, stat_t, O_DIRECTORY, the syscall0..6 inline-asm bodies (ecall), and the clone/spawn/trap asm. - src/system/os/linux/riscv64.mach: page_size + thread_spawn + the fwd re-exports. - riscv64 dispatch in os/linux.mach and the riscv64 panic write/trap. riscv64 and aarch64 share the asm-generic syscall table; only the inline-asm dialect changes. The one divergence: riscv lacks __ARCH_WANT_RENAMEAT, so rename uses renameat2 (276) instead of renameat (38), confirmed under qemu. Refs #306
Add src/runtime/linux/riscv64.mach (_start, _rt_init, the argc/argv/envp globals) and the riscv64 dispatch in runtime/linux.mach. _start is a naked inline-asm entry that reads the kernel-supplied sp, publishes argc/argv/envp, calls _rt_init then main, and exits via exit_group. Refs #306
Add riscv64 implementations for all 8 atomic ops, mirroring the x86_64/aarch64 arms: - load: full FENCEs bracket a plain aligned ld (seq-cst load) - store: amoswap.d.aqrl discarding the old value (seq-cst store) - cas: lr.d.aqrl/sc.d.aqrl retry loop - fetch_add: amoadd.d.aqrl - fetch_sub: neg then amoadd.d.aqrl (no amosub) - exchange: amoswap.d.aqrl - fence: fence - spin_hint: pause Each op uses the RISC-V A extension with .aqrl ordering for sequential consistency. Additive and comptime-gated, so x86_64/aarch64 are unaffected. Closes #308
Add a test/riscv64 fixture (a tiny std consumer that reaches main through _start and exercises a write syscall) plus verify.sh, and a cross-riscv64 CI job that cross-compiles it for linux-riscv64 with the released mach and runs it under qemu-riscv64 asserting the exit code. Mirrors mach's cross riscv64-linux lane and exercises the riscv64 runtime end to end.
feat(sync/atomic): riscv64 arms
feat: riscv64-linux runtime (_start + syscall stubs)
The page_size docstrings in riscv64.mach and aarch64.mach put a NOTE block between two `---` separators, so the doclint parsed `NOTE` as a documented component and warned 'documented component matches no parameter, field, generic, or ret'. Move the NOTE into the summary block (above the `---`) so the doc-item section holds only `ret`. Closes #310
doc(os/linux): fix page_size doclint warning
chore: repoint relocated repos to the briar-systems org
the darwin runtime startup globals lacked the #[symbol(...)] annotations the linux runtime carries, so the start inline-asm storing into them could not resolve the symbols and the link failed with 'undefined symbol: _rt_argc'. annotate all three on both darwin arch runtimes, mirroring src/runtime/linux/x86_64.mach. Closes #314
the darwin aarch64 syscall wrappers moved the syscall number and
arguments into registers with 'mov xN, {operand}', but those operands
bind to stack slots and arm64 'mov' only accepts a register or immediate
source, so the encoder rejected them with 'inline-asm mov source must be
a register or immediate'. switch every slot-bound source to 'ldr',
mirroring the linux aarch64 path. covers syscall0..6 plus the fork/vfork
wrappers, which carried the same 'mov x16, {n}'. x86_64 wrappers are
untouched (x86 mov takes a memory source).
Closes #315
fix(runtime/darwin): export _rt_argc/_rt_argv/_rt_envp symbols
…call-asm fix(os/darwin): load aarch64 syscall operands with ldr, not mov
release: v0.16.0
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.
Integration sweep of
dev→mainfor v0.16.0. No-fast-forward merge to preserve branching history.Contents
_start+ syscall stubs / os module (runtime: riscv64-linux _start + syscall stubs #306) and atomics on the A extension (sync/atomic: riscv64 arms (blocked on mach RV64A inline-asm support) #308), plus a cross-riscv64 qemu CI lane._rt_argc/_rt_argv/_rt_envp#[symbol]s so the darwin entry links (runtime/darwin: _rt_argc/_rt_argv/_rt_envp missing #[symbol] annotations — darwin entry fails to link #314), and load aarch64 syscall operands withldrso they encode (system/os/darwin: aarch64 syscall wrappers use 'mov xN, {aN}' (slot-bound source) — fails inline-asm encode #315).page_sizedoclint fix (doc: page_size docstring trips the doclint 'documented component' warning #310).mach.toml0.15.0 → 0.16.0 + CHANGELOG (release: v0.16.0 #318).Notes
devinto a detachedmainresolved automatically with zero conflicts.mainis behinddevonly by the briar-systems-refs hotfix merge (chore: repoint relocated repos to the briar-systems org #312), whose identical contentdevalready carries via chore: repoint relocated repos to the briar-systems org #313 — no merge-back needed.branch/main, so these commits reachingmainare what the darwin build (infra: CD-authored darwin release build (x86_64 + aarch64, native fixpoint) mach#1680) needs.v0.16.0from this PR — tagging is handled separately by the maintainer.