Interface for syscall handling.
Full in-memory representation of a process.
A result type that holds either a success value of type T or an ErrorCode.
Result< RegisterValue > dispatch(SyscallId id, std::span< const RegisterValue > args, ProcessImage &caller) const
Dispatches syscall to registered handler.
std::size_t handlerCount() const noexcept
Number of registered handlers.
std::unique_ptr< Impl > impl_
Result< void > unregisterHandler(SyscallId id)
Unregisters a handler for syscall id.
std::function< Result< RegisterValue >(std::span< const RegisterValue >, ProcessImage &)> HandlerFn
Function signature used for syscall handlers.
bool hasHandler(SyscallId id) const noexcept
Returns true when id has a registered handler.
SyscallTable(const SyscallTable &)=delete
Result< void > registerHandler(SyscallId id, HandlerFn handler)
Registers/replaces a function handler for syscall id.
SyscallTable(SyscallTable &&) noexcept
SyscallTable & operator=(const SyscallTable &)=delete
Error codes and Result<T> type for fallible operations.
SyscallId
Numeric identifiers for system calls.
std::int32_t RegisterValue
Value stored in a CPU register.
ISyscallHandler interface.
Syscall IDs for the user-kernel boundary.
Common type aliases, sentinel constants, and forward declarations used throughout the Contur 2 kernel...