20#include <l4/sys/task.h>
22namespace L4Re {
namespace Util {
35 template <
unsigned COUNT>
41 enum State { Free = 0, Allocated, Unknown };
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;
113class Cap_alloc :
public Cap_alloc_base
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.
C++ interface for capabilities.
Helper abstraction for a word contained in the bitmap.
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.
@ L4_CAP_SHIFT
Capability index shift.
@ L4_INVALID_CAP
Invalid capability selector.
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 ...
Low-level assert implementation.
#define l4_assert(expr)
Low-level assert.