Module syscall

Source
Expand description

Wrapper functions around for raw_syscall, providing a typed and safer way to interact with the kernel.

Structs§

Clock
ClockFlags
Flags about a given clock or clock read.
ClockID
ID used internally to read the appropriate clock source.
ClockInfo
Information about a given clock source, including precision and current clock value.
CreateTieFlags
Flags controlling how a particular object tie operates.
CreateTieSpec
A specification of ties to create. (see the book for more information on ties).
DeleteFlags
Flags to control operation of the object delete operation.
FemtoSeconds
GetRandomFlags
KernelConsoleReadFlags
Flags to pass to sys_kernel_console_read.
KernelConsoleWriteFlags
Flags to pass to sys_kernel_console_write.
MapFlags
Flags to pass to sys_object_map.
MapInfo
Information about an object mapping.
MicroSeconds
MilliSeconds
NanoSeconds
NewHandleFlags
Flags to pass to sys_new_handle.
ObjectCreate
Full object creation specification, minus ties.
ObjectCreateFlags
Flags to pass to the object create system call.
ObjectInfo
Information about an object, according to the local kernel.
ObjectSource
Specifications for an object-copy from a source object. The specified ranges are source:[src_start, src_start + len) copied to <some unspecified destination object>:[dest_start, dest_start + len). Each range must start within an object, and end within the object.
PicoSeconds
PinnedPage
ReadClockFlags
Flags to pass to sys_read_clock_info.
ReadClockListFlags
Flags to pass to sys_read_clock_list.
Seconds
SyncFlags
Flags for a sync command.
SyncInfo
Parameters for the kernel for syncing a mapping.
SysInfo
Information about the system.
ThreadSpawnArgs
Arguments to pass to sys_spawn.
ThreadSpawnFlags
Flags to pass to sys_spawn.
ThreadSyncFlags
Flags to pass to sys_thread_sync.
ThreadSyncSleep
Specification for a thread sleep request.
ThreadSyncWake
Specification for a thread wake request.
TimeSpan
TraceSpec
Tracing specification. Note that events can be disabled and enabled in one spec. It is unspecified if events are disabled or enabled first.
UnbindHandleFlags
Flags to pass to sys_unbind_handle.
UnmapFlags
Flags to pass to sys_object_unmap.

Enums§

BackingType
The backing memory type for this object. Currently doesn’t do anything.
ClockKind
Different kinds of clocks exposed by the kernel.
ClockSource
Possible clock sources.
HandleType
Possible kernel handle types.
KernelConsoleSource
Possible sources for a kernel console read syscall.
LifetimeType
The base lifetime type of the object. Note that this does not ensure that the object is stored in a specific type of memory, the kernel is allowed to migrate objects with the Normal BackingType as it sees fit. For more information on object lifetime, see the book.
MapControlCmd
Possible map control commands for sys_map_ctrl.
ObjectControlCmd
Possible object control commands for sys_object_ctrl.
Syscall
All possible Synchronous syscalls into the Twizzler kernel.
ThreadControl
Possible Thread Control operations
ThreadSync
Either a sleep or wake request. The syscall comprises of a number of either sleep or wake requests.
ThreadSyncOp
Possible operations the kernel can perform when looking at the supplies reference and the supplied value. If the operation *reference OP value evaluates to true (or false if the INVERT flag is passed), then the thread is put to sleep.
ThreadSyncReference
A reference to a piece of data. May either be a non-realized persistent reference or a virtual address.
TimeUnitError
UpcallTargetSpawnOption

Constants§

FEMTOS_PER_NANO
FEMTOS_PER_SEC
NANOS_PER_SEC
PERTHREAD_TRACE_GEN_SAMPLE

Functions§

sys_debug_shutdownDeprecated
Shutdown the computer.
sys_get_random
sys_info
Get a SysInfo struct from the kernel.
sys_kaction
Execute a kaction on an object.
sys_kernel_console_read
Read from the specified kernel console input, placing data into buffer.
sys_kernel_console_read_interruptable
Read from the specified kernel console input, placing data into buffer.
sys_kernel_console_write
Write to the kernel console.
sys_ktrace
Trace events in the kernel, storing them in the provided object.
sys_map_ctrl
Perform a kernel operation on this mapping.
sys_new_handle
Make a new handle object.
sys_object_create
Create an object, returning either its ID or an error.
sys_object_ctrl
Perform a kernel operation on this object.
sys_object_map
Map an object into the address space with the specified protections.
sys_object_read_map
Reads the map information about a given slot in the address space specified by handle (or current address space if none is specified).
sys_object_stat
Read information about a given object.
sys_object_unmap
Unmaps an object from the address space specified by handle (or the current address space if none is specified).
sys_read_clock_info
Read information about a give clock, as specified by clock source.
sys_read_clock_list
Discover a list of clock sources exposed by the kernel.
sys_sctx_attach
Attach to a given security context.
sys_spawn
Spawn a new thread, returning the ObjID of the thread’s handle or an error.
sys_thread_active_sctx_id
Get the active security context ID for the calling thread.
sys_thread_change_state
Change the thread’s state. If successful, returns the previous state.
sys_thread_ctrl
sys_thread_exit
Exit the thread. The code will be written to the crate::thread::ThreadRepr for the current thread as part of updating the status and code to indicate thread has exited.
sys_thread_get_trace_events
Get the Trap State for the thread.
sys_thread_get_trap_state
Get the Trap State for the thread.
sys_thread_gettls
Get the current kernel thread’s TLS pointer.
sys_thread_read_registers
Read the thread’s CPU state. The thread must be suspended.
sys_thread_resume_from_upcall
Resume from an upcall, restoring registers. If you can resume yourself in userspace, this call is not necessary.
sys_thread_self_id
Get the repr ID of the calling thread.
sys_thread_send_message
Send a user-defined async or sync event to the thread.
sys_thread_set_active_sctx_id
Get the active security context ID for the calling thread.
sys_thread_set_trace_events
Set the Trap State for the thread.
sys_thread_set_trap_state
Set the Trap State for the thread.
sys_thread_set_upcall
Set the upcall location for this thread.
sys_thread_settls
Set the current kernel thread’s TLS pointer. On x86_64, for example, this changes user’s FS segment base to the supplies TLS value.
sys_thread_sync
Perform a number of ThreadSync operations, either waking of threads waiting on words of memory, or sleeping this thread on one or more words of memory (or both). The order these requests are processed in is undefined.
sys_thread_write_registers
Write the thread’s CPU state. The thread must be suspended.
sys_thread_yield
Yield the thread’s CPU time now. The actual effect of this is unspecified, but it acts as a hint to the kernel that this thread does not need to run right now. The kernel, of course, is free to ignore this hint.
sys_unbind_handle
Unbind an object from handle status.

Type Aliases§

ThreadSyncResult
Result of sync operations.