26 #include <l4/cxx/list> 27 #include <l4/cxx/minmax> 30 #include <l4/sys/cxx/ipc_legacy> 32 namespace L4Re {
namespace Util {
56 : _ds_start(0), _ds_size(0), _map_flags(Snd_fpage::Map),
57 _cache_flags(Snd_fpage::Cached)
93 (void)offs; (void)flags; (void)min; (void)max;
140 l4_addr_t src_offs,
unsigned long size)
throw()
142 (void)dst_offs; (void)src_id; (void)src_offs; (void)size;
155 virtual long clear(
unsigned long offs,
unsigned long size)
const throw();
169 { (void)offset; (void)size; (void)access;
return -
L4_ENODEV; }
188 long op_map(L4Re::Dataspace::Rights rights,
194 if (read_only && (flags & 1))
197 return map(offset, spot, flags & 1, 0, ~0, fp);
200 long op_take(L4Re::Dataspace::Rights)
201 {
take();
return 0; }
203 long op_release(L4Re::Dataspace::Rights)
217 long op_allocate(L4Re::Dataspace::Rights rights,
219 {
return allocate(offset, size, rights & 3); }
221 long op_copy_in(L4Re::Dataspace::Rights rights,
234 return copy(dst_offs, src_cap.
data(), src_offs, sz);
237 long op_phys(L4Re::Dataspace::Rights,
l4_addr_t offset,
239 {
return phys(offset, phys_addr, phys_size); }
245 s.
flags = rw_flags() & ~Writable;
251 long op_clear(L4Re::Dataspace::Rights rights,
258 return clear(offset, size);
263 unsigned long size()
const throw()
265 unsigned long map_flags()
const throw()
266 {
return _map_flags; }
267 unsigned long rw_flags()
const throw()
268 {
return _rw_flags; }
269 unsigned long is_writable()
const throw()
270 {
return _rw_flags & Writable; }
271 unsigned long page_size()
const throw()
273 unsigned long round_size()
const throw()
275 bool check_limit(
l4_addr_t offset)
const throw()
276 {
return offset < round_size(); }
279 void size(
unsigned long size)
throw() { _ds_size = size; }
284 Cache_type _cache_flags;
unsigned int l4_size_t
Unsigned size type.
virtual unsigned long page_shift() const
Define the size of the flexpage to map.
Interface specific 'W' right for capability flex-pages.
Common L4 ABI Data Types.
Information about the dataspace.
l4_addr_t l4_round_size(l4_umword_t value, unsigned char bits) L4_NOTHROW
Round value up to the next alignment with bits size.
Dataspace protocol defintion.
Cacheopt
Caching options, see l4_fpage_cacheability_opt_t.
Interface for memory-like objects.
T1 max(T1 a, T1 b)
Get the maximum of a and b.
#define L4_LOG2_PAGESIZE
Number of bits used for page offset.
virtual int phys(l4_addr_t offset, l4_addr_t &phys_addr, l4_size_t &phys_size)
Return physical address for a virtual address.
l4_umword_t data() const
Return the raw flex page descriptor.
virtual bool is_static() const
Return whether the dataspace is static.
virtual void take()
Take a reference to this dataspace.
unsigned long l4_umword_t
Unsigned machine word.
virtual long copy(l4_addr_t dst_offs, l4_umword_t src_id, l4_addr_t src_offs, unsigned long size)
Copy from src dataspace to this destination dataspace.
int map(l4_addr_t offset, l4_addr_t local_addr, unsigned long flags, l4_addr_t min_addr, l4_addr_t max_addr, L4::Ipc::Snd_fpage &memory)
Map a region of the dataspace.
virtual long clear(unsigned long offs, unsigned long size) const
Clear a region in the dataspace.
virtual unsigned long release()
Release a reference to this dataspace.
unsigned long l4_addr_t
Address type.
bool id_received() const
Check if a label was received instead of a mapping.
virtual long allocate(l4_addr_t offset, l4_size_t size, unsigned access)
Allocate a region within a dataspace.
T1 min(T1 a, T1 b)
Get the minimum of a and b.
Generic RPC wrapper for L4 flex-pages.
virtual int map_hook(l4_addr_t offs, unsigned long flags, l4_addr_t min, l4_addr_t max)
A hook that is called as the first operation in each map request.