mirror of
https://github.com/justinian/jsix.git
synced 2025-12-09 16:04:32 -08:00
The main point of this change is to allow "global" capabilities defined on the base object type. The example here is the clone capability on all objects, which governs the ability to clone a handle. Related changes in this commit: - Renamed `kobject` to `object` as far as the syscall interface is concerned. `kobject` is the cname, but j6_cap_kobject_clone feels clunky. - The above change made me realize that the "object <type>" syntax for specifying object references was also clunky, so now it's "ref <type>" - Having to add `.object` on everywhere to access objects in interface.exposes or object.super was cumbersome, so those properties now return object types directly, instead of ObjectRef. - syscall_verify.cpp.cog now generates code to check capabilities on handles if they're specified in the definition, even when not passing an object to the implementation function.
38 lines
982 B
Modula-2
38 lines
982 B
Modula-2
# Channels are objects that enable synchronous IPC of
|
|
# arbitrary-sized messages.
|
|
|
|
object endpoint : object {
|
|
uid c5882f24a4c03b7e
|
|
|
|
capabilities [
|
|
send
|
|
receive
|
|
]
|
|
|
|
method create [constructor]
|
|
|
|
# Send a message on a channel. Blocks until the message
|
|
# is received.
|
|
method send [cap:send] {
|
|
param tag uint64
|
|
param data buffer
|
|
}
|
|
|
|
# Receieve a message on a channel. Blocks until a message
|
|
# is available.
|
|
method receive [cap:receive] {
|
|
param tag uint64 [out]
|
|
param data buffer [out optional]
|
|
param timeout uint64 # Receive timeout in nanoseconds
|
|
}
|
|
|
|
# Send a message on a channel and then await a new message.
|
|
# Equivalent to calling send and then recieve, as a single
|
|
# operation.
|
|
method sendrecv [cap:send cap:receive] {
|
|
param tag uint64 [inout]
|
|
param data buffer [inout]
|
|
param timeout uint64 # Receive timeout in nanoseconds
|
|
}
|
|
}
|