35 template <
unsigned COUNT>
38 typename Bitmap_base::Word<COUNT>::Type _bits[Bitmap_base::Word<COUNT>::Size];
41 enum State { Free = 0, Allocated, Unknown };
42 Cap_alloc_base(
long max,
void *mem,
long bias = 0,
void * = 0)
43 noexcept : _bias(bias), _items(max, mem) {}
47 long cap = _items.alloc();
54 long hint()
const {
return _items.hint(); }
59 template<
typename T >
71 if (idx >= _items.size())
74 return _items.is_allocated(idx) ? Allocated : Free;
89 if (idx >= _items.size())
108 return _items.size() + _bias - 1;
116 typename Bitmap_base::Word<Size>::Type _bits[Bitmap_base::Word<Size>::Size];
119 explicit Cap_alloc(
long bias = 0) noexcept
120 : Cap_alloc_base(Size, _bits, bias) {}
L4::Cap related definitions.
L4::Cap< T > alloc() noexcept
Allocate a capability slot.
void free(L4::Cap< T > const &cap, l4_cap_idx_t task=L4_INVALID_CAP, l4_umword_t unmap_flags=L4_FP_ALL_SPACES) noexcept
Free a capability slot.
@ Invalid
Invalid capability selector.
C++ interface for capabilities.
unsigned long l4_umword_t
Unsigned machine word.
unsigned long l4_cap_idx_t
Capability selector type.
unsigned l4_is_valid_cap(l4_cap_idx_t c) L4_NOTHROW
Test if a capability selector is a valid selector.
#define L4_CAP_SHIFT
Capability index shift.
l4_msgtag_t l4_task_unmap(l4_cap_idx_t task, l4_fpage_t fpage, l4_umword_t map_mask) L4_NOTHROW
Revoke rights from the task.
@ L4_FP_ALL_SPACES
Flag to tell the unmap operation to revoke permissions from all child mappings including the mapping ...
#define L4_INVALID_CAP
Invalid capability selector.
Common task related definitions.
Documentation of the L4 Runtime Environment utility functionality in C++.
@ L4_FP_ALL_SPACES
Flag to tell the unmap operation to revoke permissions from all child mappings including the mapping ...
Low-level assert implementation.
#define l4_assert(expr)
Low-level assert.