Loading...
Searching...
No Matches
L4::Epiface Struct Referenceabstract

Base class for interface implementations. More...

`#include <ipc_epiface>`

Inheritance diagram for L4::Epiface:
Collaboration diagram for L4::Epiface:

## Public Types

typedef Ipc_svr::Server_iface | Server_iface
| Type for abstract server interface.
typedef Ipc_svr::Server_iface::Demand | Demand
| Type for server-side receive buffer demand.

## Public Member Functions

| Epiface ()
| Make a server object.
virtual l4_msgtag_t | dispatch (l4_msgtag_t tag, unsigned rights, l4_utcb_t *utcb)=0
| The abstract handler for client requests to the object.
virtual Demand | get_buffer_demand () const =0
| Get the server-side receive buffer demand for this object.
virtual | ~Epiface ()=0
| Destroy the object.
Stored_cap | obj_cap () const
| Get the capability to the kernel object belonging to this object.
Server_iface * | server_iface () const
| Get pointer to server interface at which the object is currently registered.
int | set_server (Server_iface *srv, Cap< void > cap, bool managed=false)
| Set server registration info for the object.
void | set_obj_cap (Cap< void > const &cap)
| Deprecated server registration function.

## Detailed Description

Base class for interface implementations.

An Epiface is the base interface of objects registered in the server loop. Incomming IPC gets dispatched to the appropriate Epiface object where the call is then handled appropriately.

Note
  Server loops are allowed to internally keep raw pointers to Epiface objects for dispatching calls. Instances must therefore never be copied or moved.

Definition at line 145 of file ipc_epiface.

## Member Function Documentation

## dispatch()

virtual l4_msgtag_t L4::Epiface::dispatch | ( | l4_msgtag_t | tag,
|  | unsigned | rights,
|  | l4_utcb_t * | utcb )

pure virtual

The abstract handler for client requests to the object.

Parameters

  tag | The message tag for this invocation.
  rights | The rights bits in the invoked capability.
  utcb | The UTCB used for the invocation.

Return values

  -L4_ENOREPLY | No reply message is send.
  <0 | Error, reply with error code.
  >=0 | Success, reply with return value.

This function must be implemented by application specific server objects.

Implemented in L4::Epiface_t< Derived, IFACE, BASE, bool >, L4::Epiface_t< Block_dev< Ds_data >, L4virtio::Device >, L4::Epiface_t< Null_handler, L4::Kobject >, L4::Epiface_t< Stats_reader, Virtio_net_switch::Statistics_if >, L4::Epiface_t< Switch_factory, L4::Factory >, L4::Epiface_t< Virtio_gpio< Request_handler, L4virtio::Device >, L4virtio::Device >, L4::Epiface_t< Virtio_i2c< Request_handler, L4virtio::Device >, L4virtio::Device >, L4::Epiface_t< Virtio_net, L4virtio::Device >, L4::Epiface_t< Virtio_rng< Rnd_state >, L4virtio::Device >, L4::Irqep_t< Derived, BASE, bool >, L4::Irqep_t< Del_cap_irq >, L4::Irqep_t< Host_irq >, L4::Irqep_t< Irq_object >, L4::Irqep_t< Kick_irq >, and L4::Server_object.

Referenced by L4::Basic_registry::dispatch().

Here is the caller graph for this function:

## get_buffer_demand()

virtual Demand L4::Epiface::get_buffer_demand | ( |  | ) | const

pure virtual

Get the server-side receive buffer demand for this object.

Note
  This function is usually not implemented directly, but by using Server_object_t template with an IPC interface definition.

Returns
  The needed server-side receive buffers for this object

Implemented in L4::Epiface_t0< RPC_IFACE, BASE >, L4::Epiface_t0< IFACE, L4::Epiface >, L4::Epiface_t0< L4::Factory, L4::Epiface >, L4::Epiface_t0< L4::Kobject, L4::Epiface >, L4::Epiface_t0< L4virtio::Device, L4::Epiface >, L4::Epiface_t0< Virtio_net_switch::Statistics_if, L4::Epiface >, L4::Epiface_t0< void, Epiface >, L4::Server_object_t< IFACE, BASE >, L4::Server_object_t< IFACE, L4::Server_object >, and L4::Server_object_t< Kobject >.

## obj_cap()

Stored_cap L4::Epiface::obj_cap | ( |  | ) | const

inline

Get the capability to the kernel object belonging to this object.

Returns
  Capability for the kernel object behind the server.

This is usually either an Ipc_gate or an Irq.

Definition at line 206 of file ipc_epiface.

Referenced by L4Re::Util::Object_registry::unregister_obj().

Here is the caller graph for this function:

## server_iface()

Server_iface * L4::Epiface::server_iface | ( |  | ) | const

inline

Get pointer to server interface at which the object is currently registered.

Returns
  Pointer to the server at which the object is currently registered, NULL if the object is not registered at any server.

Definition at line 213 of file ipc_epiface.

Referenced by L4virtio::Svr::Virtio_gpio< Request_handler, Epiface >::register_single_driver_irq(), L4virtio::Svr::Virtio_i2c< Request_handler, Epiface >::register_single_driver_irq(), L4virtio::Svr::Virtio_rng< Rnd_state, Epiface >::register_single_driver_irq(), and Virtio_net::register_single_driver_irq().

Here is the caller graph for this function:

## set_server()

int L4::Epiface::set_server | ( | Server_iface * | srv,
|  | Cap< void > | cap,
|  | bool | managed = false )

inline

Set server registration info for the object.

Parameters

  srv | The server to register at
  cap | The capability that connects the object.
  managed | Mark the capability as managed or unmanaged. Typical server implementations use this flag to remember whether the capability was internally allocated or not.

Returns
  0 on success, -L4_EINVAL if the srv and cap are not consistent.

Definition at line 224 of file ipc_epiface.

References L4_EINVAL.

Referenced by L4Re::Util::Object_registry::unregister_obj().

Here is the caller graph for this function:

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

- l4/sys/cxx/ipc_epiface