Skip to content

release: sweep dev → main (v0.16.0)#319

Merged
octalide merged 15 commits into
mainfrom
dev
Jun 28, 2026
Merged

release: sweep dev → main (v0.16.0)#319
octalide merged 15 commits into
mainfrom
dev

Conversation

@octalide

Copy link
Copy Markdown
Collaborator

Integration sweep of devmain for v0.16.0. No-fast-forward merge to preserve branching history.

Contents

Notes

octalide and others added 15 commits June 26, 2026 22:02
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: 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
@octalide octalide merged commit 05f937b into main Jun 28, 2026
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