Files
spl/stage0/spl_syscall.h
2026-07-03 22:27:50 +08:00

23 lines
768 B
C

/* spl_syscall.h — built-in syscall layer for SIR VM
*
* Provides I/O native functions (putchar, getchar, file ops, etc.)
* that compiled SPL programs can call via NCALL.
*
* spl_syscall_register() must be called AFTER spl_prog_load_from_file()
* and BEFORE spl_vm_run_until(). It matches native declarations in the
* loaded program against known syscall names and hooks up the C
* implementations.
*/
#ifndef __SPL_SYSCALL_H__
#define __SPL_SYSCALL_H__
#include "spl_ir.h"
/* Register all known built-in syscalls into prog->natives[].
* Entries whose name matches a known syscall get their impl_fn set;
* unmatched entries remain NULL (will error at runtime if called). */
void spl_syscall_register(spl_prog_t *prog);
#endif /* __SPL_SYSCALL_H__ */