L4Re Operating System Framework – Interface and Usage Documentation
Loading...
Searching...
No Matches
L4Re::Util::Names::Name_space Class Referenceabstract

Abstract server-side implementation of the L4::Namespace interface. More...

#include <name_space_svr>

+ Collaboration diagram for L4Re::Util::Names::Name_space:

Public Member Functions

virtual ~Name_space ()
 The destructor of the derived class is responsible for freeing resources.
 

Protected Member Functions

virtual Entry * alloc_dynamic_entry (Name const &n, unsigned flags)=0
 Allocate a new entry for the given name.
 
virtual void free_dynamic_entry (Entry *e)=0
 Free an entry previously allocated with alloc_dynamic_entry().
 
virtual int get_epiface (l4_umword_t data, bool is_local, L4::Epiface **lo)=0
 Return a pointer to the epiface assigned to a given label.
 
virtual int copy_receive_cap (L4::Cap< void > *cap)=0
 Return the receive capability for permanent use.
 
virtual void free_capability (L4::Cap< void > cap)=0
 Free a capability previously acquired with copy_receive_cap().
 
virtual void free_epiface (L4::Epiface *epiface)=0
 Free epiface previously acquired with get_epiface().
 

Detailed Description

Abstract server-side implementation of the L4::Namespace interface.

Note
The derived class is resposible for resource management through the provided interfaces. This includes freeing all resources on destruction!

Definition at line 186 of file name_space_svr.

Member Function Documentation

◆ alloc_dynamic_entry()

virtual Entry * L4Re::Util::Names::Name_space::alloc_dynamic_entry ( Name const &  n,
unsigned  flags 
)
protectedpure virtual

Allocate a new entry for the given name.

Parameters
nName of the entry, must be copied.
flagsEntry flags, see Obj::Flags.
Returns
A pointer to the newly allocated entry or NULL on error.

This method is called when a new entry was received. It must allocate memory, copy n out of the receive buffer and wrap everything in an Entry.

◆ copy_receive_cap()

virtual int L4Re::Util::Names::Name_space::copy_receive_cap ( L4::Cap< void > *  cap)
protectedpure virtual

Return the receive capability for permanent use.

Parameters
[out]capCapability slot with the received capability. Must be permanently available until free_capability() is called.

This method is called when a new entry is registered together with a capability mapping. It must decide whether and where to store the capability and return the final capability slot. Typical implementations return the capability slot in the receive window and allocate a new receive window.

◆ free_capability()

virtual void L4Re::Util::Names::Name_space::free_capability ( L4::Cap< void >  cap)
protectedpure virtual

Free a capability previously acquired with copy_receive_cap().

Parameters
[in]capCapability to free.

Counterpart of copy_receive_cap. Free the capability slot when the entry is deleted or changed.

◆ free_dynamic_entry()

virtual void L4Re::Util::Names::Name_space::free_dynamic_entry ( Entry *  e)
protectedpure virtual

Free an entry previously allocated with alloc_dynamic_entry().

Parameters
eEntry to free.

◆ free_epiface()

virtual void L4Re::Util::Names::Name_space::free_epiface ( L4::Epiface epiface)
protectedpure virtual

Free epiface previously acquired with get_epiface().

Parameters
[in]epifaceEpiface to free.

Called when an entry that points to an epiface is deleted allowing implementations that hold resources to free them.

◆ get_epiface()

virtual int L4Re::Util::Names::Name_space::get_epiface ( l4_umword_t  data,
bool  is_local,
L4::Epiface **  lo 
)
protectedpure virtual

Return a pointer to the epiface assigned to a given label.

Parameters
[in]dataLabel or in the local case the capability slot of the receiving capability.
[in]is_localIf true, a local capability slot was supplied, if false the label of a locally bound IPC gate.
[out]loPointer to epiface responsible for the capability.
Returns
L4_EOK if a valid interface could be found or an error message otherwise.

This method is called when a new entry is registered and some local ID was received for the capability. In this case, the generic implementation needs to get the epiface in order to get the capability.

The callee must make sure that the epiface remains valid until free_epiface is called. In particular, the capability slot must not be reallocated as long as the namespace server holds a reference to the epiface.


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