Loading...
Searching...
No Matches
L4::Kobject Class Reference
Base API » Kernel Objects

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

`#include <kobject>`

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.

## Protected Member Functions

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

## Detailed Description

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

Include File
  #include <l4/sys/capability>
  capability
  L4::Cap related definitions.

This is the base class for all remote objects accessible using RPC. However, subclasses do 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.

Attention
  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 36 of file kobject.

## Member Function Documentation

## cap()

l4_cap_idx_t L4::Kobject::cap | ( |  | ) | const

inlineprotectednoexcept

Return capability selector.

Returns
  Capability selector.

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

Definition at line 69 of file kobject.

Referenced by L4::Thread_group::add(), L4::Debugger::add_image_info(), L4::Task::add_ku_mem(), L4Re::Mem_alloc::alloc(), L4vbus::Vbus::assign_dma_domain(), L4vbus::Vbus::assign_dma_domain(), L4::Icu::bind(), L4::Rcv_endpoint::bind_snd_destination(), L4::Irq::bind_vcpu(), L4::Task::cap_equal(), L4::Task::cap_valid(), L4::Thread::control(), L4::Factory::create(), L4::Factory::create(), L4::Factory::create_factory(), L4::Factory::create_gate(), L4::Factory::create_task(), L4::Factory::create_thread_group(), L4Re::Video::Goos::create_view(), dec_refcnt(), L4::Task::delete_obj(), L4::Irq::detach(), L4::Semaphore::down(), L4::Thread::ex_regs(), L4::Thread::ex_regs(), L4::Vcon::get_attr(), L4::Debugger::get_object_name(), L4::Debugger::global_id(), L4::Icu::info(), L4::Scheduler::is_online(), L4::Debugger::kobj_to_id(), L4::Task::map(), L4::Icu::mask(), L4::Thread::modify_senders(), L4::Debugger::query_log_name(), L4::Debugger::query_log_typeid(), L4::Vcon::read(), L4::Vcon::read_with_flags(), L4::Irq::receive(), L4::Thread::register_del_irq(), L4::Thread::register_doorbell_irq(), L4::Task::release_cap(), L4vbus::Vbus::release_ioport(), L4::Thread_group::remove(), L4vbus::Vbus::request_ioport(), L4vbus::Vbus::root(), L4::Vcon::send(), L4::Vcon::set_attr(), L4::Icu::set_mode(), L4::Debugger::set_object_name(), L4::Thread::stats_time(), L4::Debugger::switch_log(), L4::Thread::switch_to(), L4::Triggerable::trigger(), L4::Icu::unbind(), L4::Task::unmap(), L4::Task::unmap_batch(), L4::Irq_eoi::unmask(), L4::Thread::vcpu_control(), L4::Thread::vcpu_control_ext(), L4::Thread::vcpu_resume_commit(), L4::Vm::vgicc_map(), L4Re::Video::Goos::view(), 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() )

inline

Decrement the in kernel reference counter for the object.

Parameters

  diff | The delta that shall be subtracted from the reference count.
  utcb | UTCB to be used for this operation, shall be the UTCB of the calling thread. See l4_utcb.

Returns
  Syscall return tag

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.

This function only succeeds on a kernel object of type L4::Ipc_gate which has the server right (L4_FPAGE_C_IPCGATE_SVR). For other kernel objects, -L4_ENOSYS is returned.

Definition at line 100 of file kobject.

References cap().

Here is the call graph for this function:

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

- l4/sys/kobject