Loading...
Searching...
No Matches
kobject
// vi:set ft=cpp: -*- Mode: C++ -*-
/* \file
* Kobject C++ interface.
*/
/*
* Copyright (C) 2015-2017, 2019, 2021, 2023-2024 Kernkonzept GmbH.
* Author(s): Alexander Warg <alexander.warg@kernkonzept.com>
*
* License: see LICENSE.spdx (in this directory or the directories above)
*/
#pragma once
#include "kernel_object.h"
#include "types.h"
#include "__typeinfo.h"
namespace L4 {
class L4_EXPORT Kobject
{
private:
Kobject();
Kobject(Kobject const &);
Kobject &operator = (Kobject const &);
template<typename T> friend struct Kobject_typeid;
protected:
typedef Typeid::Iface<L4_PROTO_META, Kobject> __Iface;
typedef Typeid::Iface_list<__Iface> __Iface_list;
struct __Kobject_typeid
{
typedef Type_info::Demand_t<> Demand;
static Type_info const _m;
};
l4_cap_idx_t cap() const noexcept { return _c(); }
private:
l4_cap_idx_t _c() const noexcept
{ return reinterpret_cast< l4_cap_idx_t >(this) & L4_CAP_MASK; }
public:
l4_msgtag_t dec_refcnt(l4_mword_t diff, l4_utcb_t *utcb = l4_utcb())
{ return l4_kobject_dec_refcnt_u(cap(), diff, utcb); }
};
template<typename Derived, long PROTO = L4::PROTO_ANY,
typename S_DEMAND = Type_info::Demand_t<> >
struct Kobject_0t : Kobject_t<Derived, L4::Kobject, PROTO, S_DEMAND> {};
}
__typeinfo.h
Type information handling.
L4::Kobject::cap
l4_cap_idx_t cap() const noexcept
Return capability selector.
Definition kobject:69
L4::Kobject::dec_refcnt
l4_msgtag_t dec_refcnt(l4_mword_t diff, l4_utcb_t *utcb=l4_utcb())
Decrement the in kernel reference counter for the object.
Definition kobject:100
l4_mword_t
signed long l4_mword_t
Signed machine word.
Definition l4int.h:37
l4_cap_idx_t
unsigned long l4_cap_idx_t
Capability selector type.
Definition types.h:336
L4_CAP_MASK
@ L4_CAP_MASK
Mask to get only the relevant bits of an l4_cap_idx_t.
Definition consts.h:151
l4_utcb_t
struct l4_utcb_t l4_utcb_t
Opaque type for the UTCB.
Definition utcb.h:56
l4_utcb
l4_utcb_t * l4_utcb(void) L4_NOTHROW L4_PURE
Get the UTCB address.
Definition utcb.h:346
L4_EXPORT
#define L4_EXPORT
Attribute to mark functions, variables, and data types as being exported from a library.
Definition compiler.h:214
kernel_object.h
Kernel object system calls.
types.h
Common L4 ABI Data Types.
L4
L4 low-level kernel interface.
Definition l4sys-l4f-groups.dox:50
L4::PROTO_ANY
@ PROTO_ANY
Default protocol used by Kobject_t and Kobject_x.
Definition __typeinfo.h:47
L4::Type_info::Demand_t
Template type statically describing demand of receive buffers.
Definition __typeinfo.h:554
L4::Type_info
Dynamic Type Information for L4Re Interfaces.
Definition __typeinfo.h:500
l4_msgtag_t
Message tag data structure.
Definition types.h:154