-
Notifications
You must be signed in to change notification settings - Fork 13
Redesigning KObject #15
Description
Right now, both copy and move handles have the same "KObject" type in the SwIPC definitions. This type is extremely vague: not only does it not specify the kind of handle it represents, it isn't enough information to know if it's a move or a copy handle.
Right now, SwIPC uses object for two different things (that share the same IPC message). It represents a moved handle that can either be casted to a kind of kernel handle (NPort, IPipe) or to a service (which is a special-case of IPipe). While it's certainly not wrong at the IPC marshalling level, it makes it hard on the IPC codegen to differentiate the two (we don't necessarily want to return the same types depending of the kind of handle returned).
As such, I'm interested in changing KObject a little. I'm thinking of renaming KObject to KHandle to be closer to the kernel terminology, and give it two template arguments:
- The first specifies if it is a copy or a move object.
KHandle<copy>is a copy handle,KHandle<move>is a move handle - The second specifies the kind of handle.
KHandle<_, process>is a process handle. You may pass 0xffff8001KHandle<_, thread>is a thread handle. You may pass 0xffff8000KHandle<_, transfer_memory>is a transfer memory handle.KHandle<_, shared_memory>is a shared memory handle.KHandle<_, port>is a port handleKHandle<_, session>is a session handleKHandle<_, event>is an event handle ?
An object is the same as a KHandle<move, session> as far as the IPC marshalling is concerned, but is additionally given an interface type that the returned session conforms to.