L4Re - L4 Runtime Environment
L4::Kobject Class Reference

Base class for all kinds of kernel objects and remote objects, referenced by capabilities. More...

+ Inheritance diagram for L4::Kobject:
+ Collaboration diagram for L4::Kobject:

Public Member Functions

l4_msgtag_t dec_refcnt (l4_mword_t diff, l4_utcb_t *utcb=l4_utcb())
 Decrement the in kernel reference counter for the object. More...

Protected Member Functions

l4_cap_idx_t cap () const noexcept
 Return capability selector. More...

Detailed Description

Base class for all kinds of kernel objects and remote objects, referenced by capabilities.

Include File
#include <l4/sys/capability>

This is the base class for all remote objects accessible using RPC. However, subclasses doe not directly inherit from L4::Kobject but must use L4::Kobject_t (L4::Kobject_0t, L4::Kobject_2t, L4::Kobject_3t, or L4::Kobject_x) for inheritance, otherwise these classes cannot be used as RPC interfaces.

Objects derived from Kobject must never add any data to those objects. Kobjects can act only as proxy object for encapsulating object invocations.

Definition at line 46 of file kobject.

Member Function Documentation

◆ cap()

l4_cap_idx_t L4::Kobject::cap ( ) const

Return capability selector.

Capability selector.

This method is for derived classes to gain access to the actual capability selector.

Definition at line 79 of file kobject.

References L4_CAP_MASK.

Referenced by L4::Irq::attach(), L4::Icu::bind(), L4::Irq_mux::chain(), L4::Factory::create(), L4::Factory::create_factory(), L4::Factory::create_gate(), L4::Factory::create_irq(), L4::Factory::create_task(), L4::Factory::create_thread(), L4::Factory::create_vm(), L4::Irq::detach(), L4::Semaphore::down(), L4::Thread::ex_regs(), L4::Vcon::get_attr(), L4::Icu::info(), L4::Icu::mask(), L4::Thread::modify_senders(), L4::Vcon::read(), L4::Irq::receive(), L4::Vcon::send(), L4::Vcon::set_attr(), L4::Icu::set_mode(), L4::Triggerable::trigger(), L4::Icu::unbind(), L4::Thread::vcpu_control(), L4::Thread::vcpu_control_ext(), and L4::Vcon::write().

+ Here is the caller graph for this function:

◆ dec_refcnt()

l4_msgtag_t L4::Kobject::dec_refcnt ( l4_mword_t  diff,
l4_utcb_t utcb = l4_utcb() 

Decrement the in kernel reference counter for the object.

diffThe delta that shall be subtracted from the reference count.
utcbUTCB to be used for this operation, usually the UTCB of the calling thread.

This function is intended for servers to be able to remove the servers own capability from the counted references. This leads to the semantics that the kernel will delete the object even if the capability of the server is valid. The server can detect the deletion by polling its capabilities or by using the IPC-gate deletion IRQs. And to cleanup if the clients dropped the last reference (capability) to the object.

Definition at line 104 of file kobject.

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