30 #include <l4/cxx/type_traits> 63 template<
typename T >
88 template<
typename CAP_ALLOC >
96 void take(
L4::Cap<void> cap)
throw()
override { _ca.take(cap); }
100 { _ca.free(cap, task, unmap_flags); }
103 unsigned unmap_flags)
throw()
override 104 {
return _ca.release(cap, task, unmap_flags); }
106 void operator delete(
void *) {}
108 CA(CAP_ALLOC &ca) : _ca(ca) {}
116 template<
typename ALLOC>
119 template<
typename ...ARGS>
120 Cap_alloc_t(ARGS &&...args) : ALLOC(cxx::forward<ARGS>(args)...) {}
123 void take(
L4::Cap<void> cap)
throw()
override { ALLOC::take(cap); }
127 { ALLOC::free(cap, task, unmap_flags); }
130 unsigned unmap_flags)
throw()
override 131 {
return ALLOC::release(cap, task, unmap_flags); }
133 void operator delete(
void *) {}
146 template<
unsigned long Unmap_flags = L4_FP_ALL_SPACES >
173 invalidate(const_cast<L4::Cap_base &>(src));
181 template<
unsigned long Unmap_flags = L4_FP_ALL_SPACES >
198 if (_ca && _ca->release(
L4::Cap<void>(c.cap()), This_task, Unmap_flags))
248 template<
typename T >
284 template<
typename T >
L4::Cap< T > alloc()
Allocate a capability.
void free(L4::Cap_base &c)
Free operation for L4::Smart_cap (decrement ref count and delete if 0).
Invalid capability selector.
Capability allocator interface.
L4::Cap_base copy(L4::Cap_base const &src)
Copy operation for L4::Smart_cap (increment ref count).
static L4Re::Cap_alloc * get_cap_alloc(CAP_ALLOC &ca)
Construct an instance of a capability allocator.
unsigned long l4_cap_idx_t
L4 Capability selector Type.
Common task related definitions.
static void invalidate(L4::Cap_base &c)
Invalidate operation for L4::Smart_cap.
Flag to tell the unmap operation to unmap all child mappings including the mapping in the invoked tas...
void invalidate()
Set this capability to invalid (L4_INVALID_CAP).
virtual void free(L4::Cap< void > cap, l4_cap_idx_t task=L4_INVALID_CAP, unsigned unmap_flags=L4_FP_ALL_SPACES)=0
Free a capability.
virtual ~Cap_alloc()=0
Destructor.
l4_cap_idx_t cap() const
Return capability selector.
Helper for Auto_cap and Auto_del_cap.
Base class for all kinds of capabilities.
bool is_valid() const
Test whether the capability is a valid capability index (i.e., not L4_INVALID_CAP).
Cap< T > cap_cast(Cap< F > const &c)
static_cast for capabilities.
virtual L4::Cap< void > alloc()=0
Allocate a capability.
Helper for Ref_cap and Ref_del_cap.
C++ interface for capabilities.
#define L4_DEPRECATED(s)
Mark symbol deprecated.