| Crates.io | libriscv-macros |
| lib.rs | libriscv-macros |
| version | 0.2.0 |
| created_at | 2025-12-20 09:49:13.367556+00 |
| updated_at | 2026-01-24 11:26:54.626135+00 |
| description | Proc-macro helpers for libriscv |
| homepage | |
| repository | https://github.com/cijiugechu/libriscv |
| max_upload_size | |
| id | 1996277 |
| size | 27,448 |
Proc-macro helpers for libriscv to declare syscall, stdout, and error handlers, including the syscall registry macros.
Add this crate as a dependency (usually via libriscv) and apply the attribute
macros to your handler functions. See the libriscv crate for signatures and
examples.
Short example using the syscall registry macros:
use libriscv::{syscall, syscall_registry, SyscallContext, SyscallResult};
#[syscall_registry]
mod host_syscalls {
use super::*;
#[syscall(id = 1)]
fn write(_ctx: &mut SyscallContext) -> SyscallResult<()> {
Ok(())
}
}
let registry = host_syscalls::registry().unwrap();