Skip to content
This repository was archived by the owner on Sep 21, 2021. It is now read-only.
This repository was archived by the owner on Sep 21, 2021. It is now read-only.

Redesigning KObject #15

@roblabla

Description

@roblabla

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 0xffff8001
    • KHandle<_, thread> is a thread handle. You may pass 0xffff8000
    • KHandle<_, transfer_memory> is a transfer memory handle.
    • KHandle<_, shared_memory> is a shared memory handle.
    • KHandle<_, port> is a port handle
    • KHandle<_, session> is a session handle
    • KHandle<_, 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions