Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BoolFromUintptr ¶
BoolFromUintptr extracts a boolean stored as a uintptr for syscall arguments or return values.
func BoolToUintptr ¶
BoolToUintptr stores a boolean as a uintptr for syscall arguments or return values.
Types ¶
type ByteSliceView ¶
type Dispatcher ¶
type Dispatcher struct {
// contains filtered or unexported fields
}
The Dispatcher is the bridge between user space code and OS code. User space goroutines call Dispatcher.Dispatch and the dispatcher runs OS.HandleSyscall on the OS goroutine.
func (Dispatcher) Dispatch ¶
func (b Dispatcher) Dispatch(syscall *Syscall)
func (Dispatcher) Run ¶
func (b Dispatcher) Run()
type OS ¶
type OS interface {
HandleSyscall(*Syscall)
}
OS is the interface for types that implement the syscall logic.
Implementations of this interface are generated by gensyscall.
type PollDesc ¶
type PollDesc struct {
// contains filtered or unexported fields
}
PollDesc is a poll descriptor like the go runtime's netpoll descriptors.
Blocking operations pass poll descriptors to the OS, which tracks those descriptors and marks them as readable or writable using a Pollers.
func AllocPollDesc ¶
func (*PollDesc) SetDeadline ¶
func (*PollDesc) WaitCanceled ¶
type Pollers ¶
type Pollers struct {
// contains filtered or unexported fields
}
func (*Pollers) NotifyCanRead ¶
func (*Pollers) NotifyCanWrite ¶
type SliceView ¶
type SliceView[T any] struct { Ptr []T }
SliceView is a OS-wrapper around slices passed from user space. It lets the OS access user space memory without triggering the race detector.
func NewSliceView ¶
type Syscall ¶
type Syscall struct { OS OS Trap uintptr Int0, Int1, Int2, Int3, Int4, Int5 uintptr Ptr0, Ptr1, Ptr2, Ptr3, Ptr4 any R0, R1 uintptr RPtr0 any Errno uintptr Sema uint32 }
Syscall holds the arguments and return values of gosim syscalls.
Syscalls are calls from user code to high-level system calls in the os package. To prevent allocations, each goroutine has a single Syscall that gets reused and be retrieved using GetGoroutineLocalSyscall.
Syscalls are different from upcalls, which calls in this package from user goroutines that execute code on the scheduler goroutine.
func GetGoroutineLocalSyscall ¶
func GetGoroutineLocalSyscall() *Syscall
GetGoroutineLocalSyscall returns the per-goroutine pre-allocated Syscall struct.
Sharing Syscalls is safe because each goroutine invokes at most one syscall at a time.
TODO: Just pool them instead?
type ValueView ¶
type ValueView[T any] struct { // contains filtered or unexported fields }
ValueView is a OS-wrapper around pointers passed from user space. It lets the OS access user space memory without triggering the race detector.