Loading...
Searching...
No Matches
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...

`#include <object_registry>`

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.
| Object_registry (L4::Ipc_svr::Server_iface *sif, L4::Cap< L4::Thread > server, L4::Cap< L4::Factory > factory)
| Create a registry for arbitrary threads.
L4::Cap< void > | register_obj (L4::Epiface *o, char const *service) override
| Register a new server object to a pre-allocated receive endpoint.
L4::Cap< void > | register_obj (L4::Epiface *o) override
| Register a new server object on a newly allocated capability.
L4::Cap< L4::Irq > | register_irq_obj (L4::Epiface *o) override
| Register a handler for an interrupt.
L4::Cap< L4::Rcv_endpoint > | register_obj (L4::Epiface *o, L4::Cap< L4::Rcv_endpoint > ep) override
| Register a handler for an already existing interrupt.
void | unregister_obj (L4::Epiface *o, bool unmap=true) override
| Remove a server object from the handler list.

## 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.
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.

## 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 41 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

  sif | Server loop interface.

Definition at line 67 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

  sif | Server loop interface.
  server | Capability to the thread that executes the server objects.
  factory | Capability to a factory object capable of creating new IPC gates.

Definition at line 81 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

  o | Server object that handles IRQs.

Return values

  L4::Cap<L4::Irq> | Capability to a new IRQ object on success.
  L4::Cap<L4::Irq>::Invalid | The allocation of the IRQ has failed.

The IRQ will be newly allocated using the registry's factory object. The caller must call unregister_obj() to free all resources.

Implements L4::Registry_iface.

Definition at line 227 of file object_registry.

## register_obj() [1/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

  o | Server object that handles IPC requests.

Return values

  L4::Cap<void> | A valid capability to a new IPC gate.
  L4::Cap<void>::Invalid | The allocation of the IPC gate has failed.

The IPC gate will be allocated using the registry's factory. The caller must call unregister_obj() to free all resources.

Implements L4::Registry_iface.

Definition at line 211 of file object_registry.

## register_obj() [2/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

  o | Server object that handles IPC requests.
  service | Name of a pre-allocated receive endpoint.

Return values

  L4::Cap<void> | The capability known as service on success.
  L4::Cap<void>::Invalid | No capability with the given name found.

The interface must be freed with unregister_obj() by the caller to unbind the thread from the capability.

Implements L4::Registry_iface.

Definition at line 194 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

  o | Server object that handles the IPC.
  ep | Capability to a receive endpoint, may be a hardware or software interrupt or an IPC gate.

Return values

  L4::Cap<L4::Rcv_endpoint> | Capability ep on success.
  L4::Cap<L4::Rcv_endpoint>::Invalid | The IRQ attach operation has failed.

The interface must be freed with unregister_obj() by the caller to unbind the thread from the capability.

Implements L4::Registry_iface.

Definition at line 246 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

  o | Server object to unbind.
  unmap | Specifies 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 262 of file object_registry.

References L4::Thread::Modify_senders::add(), L4Re::Util::cap_alloc, L4::Cap_base::fpage(), L4::Cap_base::Invalid, L4::Cap_base::is_valid(), L4_FP_ALL_SPACES, L4::Epiface::obj_cap(), and L4::Epiface::set_server().

Here is the call graph for this function:

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

- l4/re/util/object_registry