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.
10 * As a special exception, you may use this file as part of a free software
11 * library without restriction. Specifically, if other files instantiate
12 * templates or use macros or inline functions from this file, or you compile
13 * this file and link it with other files to produce an executable, this
14 * file does not by itself cause the resulting executable to be covered by
15 * the GNU General Public License. This exception does not however
16 * invalidate any other reasons why the executable file might be covered by
17 * the GNU General Public License.
20 #include <l4/sys/err.h>
23 #include <l4/re/dataspace>
24 #include <l4/re/debug>
26 #include <l4/re/c/rm.h>
27 #include <l4/re/c/dataspace.h>
30 l4re_rm_reserve_area_srv(l4_cap_idx_t rm, l4_addr_t *start, unsigned long size,
31 unsigned flags, unsigned char align) L4_NOTHROW
33 L4::Cap<L4Re::Rm> x(rm);
34 return x->reserve_area(start, size, flags, align);
38 l4re_rm_free_area_srv(l4_cap_idx_t rm, l4_addr_t addr) L4_NOTHROW
40 L4::Cap<L4Re::Rm> x(rm);
41 return x->free_area(addr);
45 l4re_rm_attach_srv(l4_cap_idx_t rm, void **start, unsigned long size,
46 unsigned long flags, l4re_ds_t const mem, l4_addr_t offs,
47 unsigned char align) L4_NOTHROW
49 L4::Cap<L4Re::Rm> x(rm);
50 L4::Cap<L4Re::Dataspace> _mem(mem);
51 return x->attach(start, size, flags, _mem, offs, align);
56 l4re_rm_detach_srv(l4_cap_idx_t rm, l4_addr_t addr, l4re_ds_t *ds,
57 l4_cap_idx_t task) L4_NOTHROW
59 L4::Cap<L4Re::Rm> x(rm);
60 L4::Cap<L4::Task> t(task);
61 L4::Cap<L4Re::Dataspace> d;
62 int r = x->detach(addr, &d, t);
70 l4re_rm_find_srv(l4_cap_idx_t rm, l4_addr_t *addr,
71 unsigned long *size, l4_addr_t *offset,
72 unsigned *flags, l4_cap_idx_t *m) L4_NOTHROW
74 L4::Cap<L4Re::Rm> x(rm);
75 L4::Cap<L4Re::Dataspace> mm;
76 int r = x->find(addr, size, offset, flags, &mm);
82 l4re_rm_show_lists_srv(l4_cap_idx_t rm) L4_NOTHROW
84 L4::Cap<L4Re::Debug_obj> d(rm);
85 d->debug(0); // XXX: use enum