stage0
This commit is contained in:
22
stage0/spl_syscall.h
Normal file
22
stage0/spl_syscall.h
Normal file
@@ -0,0 +1,22 @@
|
||||
/* 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__ */
|
||||
Reference in New Issue
Block a user