L4Re Operating System Framework – Interface and Usage Documentation
Loading...
Searching...
No Matches
L4::Kobject Class Reference

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>
L4::Cap related definitions.

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.

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

Member Function Documentation

◆ cap()

◆ 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
diffThe delta that shall be subtracted from the reference count.
utcbUTCB 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 110 of file kobject.


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