2 * (c) 2008-2009 Adam Lackorzynski <adam@os.inf.tu-dresden.de>,
3 * Alexander Warg <warg@os.inf.tu-dresden.de>
4 * economic rights: Technische Universität Dresden (Germany)
6 * This file is part of TUD:OS and distributed under the terms of the
7 * GNU General Public License 2.
8 * Please see the COPYING-GPL-2 file for details.
12 #include <l4/sys/types.h>
13 #include <l4/re/dataspace>
14 #include <l4/re/util/region_mapping>
15 #include <l4/cxx/ipc_server>
17 #include "slab_alloc.h"
19 class Rm_dataspace : public L4::Capability
22 Rm_dataspace(L4::Capability const &ds) : L4::Capability(ds) {}
24 Rm_dataspace() : L4::Capability(L4_INVALID_CAP) {}
26 int map(unsigned long offset, unsigned long flags,
27 l4_addr_t local_addr, l4_addr_t min, l4_addr_t max) const;
33 typedef L4Re::Util::Region_handler<L4::Cap<L4Re::Dataspace>, Region_ops> Region_handler;
38 typedef l4_umword_t Map_result;
39 static int map(Region_handler const *h, l4_addr_t addr,
40 L4Re::Util::Region const &r, bool writable,
43 static void unmap(Region_handler const *h, l4_addr_t vaddr,
44 l4_addr_t offs, unsigned long size);
46 static void free(Region_handler const *h, l4_addr_t start, unsigned long size);
48 static void take(Region_handler const *h);
49 static void release(Region_handler const *h);
54 : public L4Re::Util::Region_map<Region_handler, Slab_alloc>
57 typedef L4Re::Util::Region_map<Region_handler, Slab_alloc> Base;
61 //void setup_wait(L4::Ipc_istream &istr);
62 int handle_pagefault(L4::Ipc_iostream &ios);
63 int handle_rm_request(L4::Ipc_iostream &ios);
64 virtual ~Region_map() {}
68 void debug_dump(unsigned long function) const;
70 int reply_err(L4::Ipc_iostream &ios);