30 #include <l4/sys/l4int.h> 35 #include <l4/sys/cxx/ipc_ret_array> 73 L4::Type_info::Demand_t<1> >
82 Detach_result_mask = 3,
157 template<
typename T >
165 Auto_region()
throw()
168 explicit Auto_region(T addr)
throw()
172 : _addr(addr), _rm(rm) {}
174 Auto_region(Auto_region
const &o)
throw() : _addr(o.get()), _rm(o._rm)
177 Auto_region &operator = (Auto_region
const &o)
throw()
189 ~Auto_region()
throw()
195 T
get()
const throw() {
return _addr; }
210 T operator * ()
const throw() {
return _addr; }
213 T operator -> ()
const throw() {
return _addr; }
244 {
return reserve_area_t::call(c(), start, size, flags, align); }
249 unsigned char align));
266 template<
typename T >
270 {
return reserve_area_t::call(c(), (
l4_addr_t*)start, size, flags, align); }
287 unsigned long size,
unsigned long flags,
339 long attach(
l4_addr_t *start,
unsigned long size,
unsigned long flags,
346 template<
typename T >
347 long attach(T **start,
unsigned long size,
unsigned long flags,
352 X *x =
reinterpret_cast<X*
>(start);
353 return attach(&x->a, size, flags, mem, offs, align);
356 #pragma GCC diagnostic push 357 #pragma GCC diagnostic ignored "-Wdeprecated-declarations" 358 template<
typename T >
359 long attach(Auto_region<T> *start,
unsigned long size,
unsigned long flags,
365 long res = attach(&addr, size, flags, mem, offs, align);
372 #pragma GCC diagnostic pop 374 #if __cplusplus >= 201103L 375 template<
typename T >
383 Unique_region(Unique_region
const &) =
delete;
384 Unique_region &operator = (Unique_region
const &) =
delete;
386 Unique_region() noexcept
389 explicit Unique_region(T addr) noexcept
392 Unique_region(T addr,
L4::Cap<Rm> const &rm) noexcept
393 : _addr(addr), _rm(rm) {}
395 Unique_region(Unique_region &&o) noexcept : _addr(o.get()), _rm(o._rm)
398 Unique_region &operator = (Unique_region &&o) noexcept
410 ~Unique_region() noexcept
416 T
get()
const noexcept
434 void reset() noexcept
437 bool is_valid()
const noexcept
441 T operator * ()
const noexcept {
return _addr; }
444 T operator -> ()
const noexcept {
return _addr; }
447 template<
typename T >
448 long attach(Unique_region<T> *start,
unsigned long size,
unsigned long flags,
454 long res = attach(&addr, size, flags, mem, offs, align);
557 {
return find_t::call(c(), addr, size, flags, offset, m); }
585 reserve_area_t, free_area_t,
586 get_regions_t, get_areas_t>
Rpcs;
593 {
return detach(addr, 1, mem, task, Detach_overlap); }
598 {
return detach((
l4_addr_t)addr, 1, mem, task, Detach_overlap); }
603 {
return detach(addr, size, mem, task, Detach_exact); }
Capability type for RPC interfaces (see L4::Cap<T>).
long reserve_area(l4_addr_t *start, unsigned long size, unsigned flags=0, unsigned char align=L4_PAGESHIFT) const
Reserve the given area in the region map.
Standard list of RPCs of an interface.
Detach_flags
Flags for detach operation.
Common L4 ABI Data Types.
Pass the argument as plain data value.
shift value for caching flags
request uncacheable memory mappings
unsigned long l4_cap_idx_t
L4 Capability selector Type.
L4::Cap related definitions.
List of RPCs of an interface using a single operation without an opcode.
long reserve_area(T **start, unsigned long size, unsigned flags=0, unsigned char align=L4_PAGESHIFT) const
Reserve the given area in the region map.
int detach(l4_addr_t addr, L4::Cap< Dataspace > *mem, L4::Cap< L4::Task > const &task=This_task) const
Detach a region from the address space.
request bufferable (write buffered) mappings
request normal memory mapping
Mark an argument as in-out argument.
Attach_flags
Flags for attach operation.
Interface Definition Language.
Attribute for defining an optional RPC argument.
#define L4_PAGESHIFT
Size of a page, log2-based.
long attach(T **start, unsigned long size, unsigned long flags, L4::Ipc::Cap< Dataspace > mem, l4_addr_t offs=0, unsigned char align=L4_PAGESHIFT) const
Attach a data space to a region.
bool is_valid() const
Test whether the capability is a valid capability index (i.e., not L4_INVALID_CAP).
int find(l4_addr_t *addr, unsigned long *size, l4_addr_t *offset, unsigned *flags, L4::Cap< Dataspace > *m)
Find a region given an address and size.
Helper class to create an L4Re interface class that is derived from a single base class...
Detach_result
Result values for detach operation.
Region_flags
Flags for regions.
C++ interface for capabilities.
L4Re Protocol Constants (C version)
unsigned long l4_addr_t
Address type.
#define L4_DEPRECATED(s)
Mark symbol deprecated.
#define L4_RPC(res, name, args, attr...)
Define an RPC call (type and callable).
#define L4_RPC_NF(res, name, args...)
Define an RPC call type (the type only, no callable).
Dynamically sized output array of type T.