[kernel] Let objects inherit caps from superclasses
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.
This commit is contained in:
30
definitions/objects/object.def
Normal file
30
definitions/objects/object.def
Normal file
@@ -0,0 +1,30 @@
|
||||
# The base type of all kernel-exposed objects
|
||||
object object [virtual] {
|
||||
uid 667f61fb2cd57bb4
|
||||
cname kobject
|
||||
|
||||
capabilities [
|
||||
clone
|
||||
]
|
||||
|
||||
# Get the internal kernel object id of an object
|
||||
method koid {
|
||||
param koid uint64 [out]
|
||||
}
|
||||
|
||||
# Block the current thread waiting for an object to assert
|
||||
# one of a set of signals
|
||||
method wait {
|
||||
param mask uint64 # Bitmap of which signals to wait for
|
||||
param signals uint64 [out] # Returns the state of the signals
|
||||
}
|
||||
|
||||
# Block the current thread waiting for an one of multiple
|
||||
# objects to assert one of a set of signals
|
||||
method wait_many [static] {
|
||||
param handles ref object [list] # The objects to wait on
|
||||
param mask uint64 # Bitmap of which signals to wait for
|
||||
param handle ref object [out] # Returns the object that signalled
|
||||
param signals uint64 [out] # Returns the state of the signals
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user