break monster VM into small pieces :D
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
mod asset;
|
||||
mod audio;
|
||||
mod bank;
|
||||
mod fs;
|
||||
mod gfx;
|
||||
mod input;
|
||||
mod log;
|
||||
mod system;
|
||||
|
||||
use super::{CapFlags, Determinism, Syscall, SyscallMeta, SyscallRegistryEntry};
|
||||
|
||||
pub(crate) const fn entry(
|
||||
syscall: Syscall,
|
||||
module: &'static str,
|
||||
name: &'static str,
|
||||
version: u16,
|
||||
arg_slots: u8,
|
||||
ret_slots: u16,
|
||||
caps: CapFlags,
|
||||
determinism: Determinism,
|
||||
may_allocate: bool,
|
||||
cost_hint: u32,
|
||||
) -> SyscallRegistryEntry {
|
||||
SyscallRegistryEntry {
|
||||
syscall,
|
||||
meta: SyscallMeta {
|
||||
id: syscall as u32,
|
||||
module,
|
||||
name,
|
||||
version,
|
||||
arg_slots,
|
||||
ret_slots,
|
||||
caps,
|
||||
determinism,
|
||||
may_allocate,
|
||||
cost_hint,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn all_entries() -> impl Iterator<Item = &'static SyscallRegistryEntry> {
|
||||
system::ENTRIES
|
||||
.iter()
|
||||
.chain(gfx::ENTRIES.iter())
|
||||
.chain(input::ENTRIES.iter())
|
||||
.chain(audio::ENTRIES.iter())
|
||||
.chain(fs::ENTRIES.iter())
|
||||
.chain(log::ENTRIES.iter())
|
||||
.chain(asset::ENTRIES.iter())
|
||||
.chain(bank::ENTRIES.iter())
|
||||
}
|
||||
Reference in New Issue
Block a user