![]() |
Contur 2
Educational OS kernel simulator
|
Dispatch table mapping SyscallId to handler functions. More...
#include <syscall_table.h>
Public Types | |
| using | HandlerFn = std::function<Result<RegisterValue>(std::span<const RegisterValue>, ProcessImage &)> |
| Function signature used for syscall handlers. | |
Public Member Functions | |
| SyscallTable () | |
| Constructs empty syscall handler table. | |
| ~SyscallTable () | |
| Destroys syscall handler table. | |
| SyscallTable (const SyscallTable &)=delete | |
| Copy construction is disabled. | |
| SyscallTable & | operator= (const SyscallTable &)=delete |
| Copy assignment is disabled. | |
| SyscallTable (SyscallTable &&) noexcept | |
| Move-constructs syscall handler table state. | |
| SyscallTable & | operator= (SyscallTable &&) noexcept |
| Move-assigns syscall handler table state. | |
| Result< void > | registerHandler (SyscallId id, HandlerFn handler) |
| Registers/replaces a function handler for syscall id. | |
| Result< void > | registerHandler (SyscallId id, ISyscallHandler &handler) |
| Registers/replaces an interface-based handler for syscall id. | |
| Result< void > | unregisterHandler (SyscallId id) |
| Unregisters a handler for syscall id. | |
| Result< RegisterValue > | dispatch (SyscallId id, std::span< const RegisterValue > args, ProcessImage &caller) const |
| Dispatches syscall to registered handler. | |
| bool | hasHandler (SyscallId id) const noexcept |
| Returns true when id has a registered handler. | |
| std::size_t | handlerCount () const noexcept |
| Number of registered handlers. | |
Private Attributes | |
| std::unique_ptr< Impl > | impl_ |
Dispatch table mapping SyscallId to handler functions.
Definition at line 21 of file syscall_table.h.
| using contur::SyscallTable::HandlerFn = std::function<Result<RegisterValue>(std::span<const RegisterValue>, ProcessImage &)> |
Function signature used for syscall handlers.
Definition at line 25 of file syscall_table.h.
| contur::SyscallTable::SyscallTable | ( | ) |
Constructs empty syscall handler table.
Referenced by operator=(), operator=(), SyscallTable(), and SyscallTable().
| contur::SyscallTable::~SyscallTable | ( | ) |
Destroys syscall handler table.
|
delete |
Copy construction is disabled.
References SyscallTable().
|
noexcept |
Move-constructs syscall handler table state.
References SyscallTable().
|
nodiscard |
Dispatches syscall to registered handler.
References dispatch().
Referenced by dispatch().
|
nodiscardnoexcept |
|
nodiscardnoexcept |
|
delete |
Copy assignment is disabled.
References SyscallTable().
|
noexcept |
Move-assigns syscall handler table state.
References SyscallTable().
Registers/replaces a function handler for syscall id.
References registerHandler().
Referenced by registerHandler(), and registerHandler().
|
nodiscard |
Registers/replaces an interface-based handler for syscall id.
The table stores a lightweight wrapper that forwards to handler.
References registerHandler().
Unregisters a handler for syscall id.
References unregisterHandler().
Referenced by unregisterHandler().
|
private |
Definition at line 70 of file syscall_table.h.