L4Re - L4 Runtime Environment
L4Re::Util::Object_registry Class Reference

A registry that manages server objects and their attached IPC gates for a single server loop for a specific thread. More...

+ Inheritance diagram for L4Re::Util::Object_registry:
+ Collaboration diagram for L4Re::Util::Object_registry:

Public Member Functions

 Object_registry (L4::Ipc_svr::Server_iface *sif)
 Create a registry for the main thread of the task using the default factory. More...
 
 Object_registry (L4::Ipc_svr::Server_iface *sif, L4::Cap< L4::Thread > server, L4::Cap< L4::Factory > factory)
 Create a registry for arbitrary threads. More...
 
L4::Cap< void > register_obj (L4::Epiface *o, char const *service) override
 Register a new server object to a pre-allocated receive endpoint. More...
 
L4::Cap< void > register_obj (L4::Epiface *o) override
 Register a new server object on a newly allocated capability. More...
 
L4::Cap< L4::Irqregister_irq_obj (L4::Epiface *o) override
 Register a handler for an interrupt. More...
 
L4::Cap< L4::Rcv_endpointregister_obj (L4::Epiface *o, L4::Cap< L4::Rcv_endpoint > ep) override
 Register a handler for an already existing interrupt. More...
 
void unregister_obj (L4::Epiface *o, bool unmap=true) override
 Remove a server object from the handler list. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from L4::Basic_registry
static Value * find (l4_umword_t label)
 Get the server object for an Ipc_gate label. More...
 
static l4_msgtag_t dispatch (l4_msgtag_t tag, l4_umword_t label, l4_utcb_t *utcb)
 The dispatch function called by the server loop. More...
 

Detailed Description

A registry that manages server objects and their attached IPC gates for a single server loop for a specific thread.

This class manages most of the setup of a server object. If necessary, an IPC gate is created, the specified thread is bound to the IPC gate. Incoming IPC is dispatched to the server object based on the label of the IPC gate.

The object registry is also able to manage IRQ endpoints. They require a different method for the object creation. Otherwise they are handled in the same way as IPC gates: a server object is responsible to process the incoming interrupts.

Definition at line 52 of file object_registry.

Constructor & Destructor Documentation

◆ Object_registry() [1/2]

L4Re::Util::Object_registry::Object_registry ( L4::Ipc_svr::Server_iface sif)
inlineexplicit

Create a registry for the main thread of the task using the default factory.

Parameters
sifServer loop interface.

Definition at line 78 of file object_registry.

◆ Object_registry() [2/2]

L4Re::Util::Object_registry::Object_registry ( L4::Ipc_svr::Server_iface sif,
L4::Cap< L4::Thread server,
L4::Cap< L4::Factory factory 
)
inline

Create a registry for arbitrary threads.

Parameters
sifServer loop interface.
serverCapability to the thread that executes the server objects.
factoryCapability to a factory object capable of creating new IPC gates.

Definition at line 92 of file object_registry.

Member Function Documentation

◆ register_irq_obj()

L4::Cap<L4::Irq> L4Re::Util::Object_registry::register_irq_obj ( L4::Epiface *  o)
inlineoverridevirtual

Register a handler for an interrupt.

Parameters
oServer object that handles IRQs.
Returns
The capability the server object was registered with.

The IRQ will be newly allocated using the registry's factory object.

Implements L4::Registry_iface.

Definition at line 229 of file object_registry.

◆ register_obj() [1/3]

L4::Cap<void> L4Re::Util::Object_registry::register_obj ( L4::Epiface *  o,
char const *  service 
)
inlineoverridevirtual

Register a new server object to a pre-allocated receive endpoint.

Parameters
oServer object that handles IPC requests.
serviceName of a pre-allocated receive endpoint.
Returns
The capability the server object was registered with.

Implements L4::Registry_iface.

Definition at line 201 of file object_registry.

◆ register_obj() [2/3]

L4::Cap<void> L4Re::Util::Object_registry::register_obj ( L4::Epiface *  o)
inlineoverridevirtual

Register a new server object on a newly allocated capability.

Parameters
oServer object that handles IPC requests.
Returns
The capability the server object was registered with.

The IPC gate will be allocated using the registry's factory.

Implements L4::Registry_iface.

Definition at line 215 of file object_registry.

◆ register_obj() [3/3]

L4::Cap<L4::Rcv_endpoint> L4Re::Util::Object_registry::register_obj ( L4::Epiface *  o,
L4::Cap< L4::Rcv_endpoint ep 
)
inlineoverridevirtual

Register a handler for an already existing interrupt.

Parameters
oServer object that handles the IPC.
irqCapability to a receive endpoint, may be a hardware or software interrupt or an IPC gate.
Returns
The capability the server object was registered with.

Implements L4::Registry_iface.

Definition at line 249 of file object_registry.

◆ unregister_obj()

void L4Re::Util::Object_registry::unregister_obj ( L4::Epiface *  o,
bool  unmap = true 
)
inlineoverridevirtual

Remove a server object from the handler list.

Parameters
oServer object to unbind.
unmapSpecifies if the object capability shall be unmapped (true) or not. The default (true) is to unmap the capability.

The capability used by the server object will be unmapped if unmap is true.

Implements L4::Registry_iface.

Definition at line 265 of file object_registry.


The documentation for this class was generated from the following file: