]> rtime.felk.cvut.cz Git - l4.git/blob - l4/pkg/moe/server/src/remote_mem.cc
update
[l4.git] / l4 / pkg / moe / server / src / remote_mem.cc
1 /*
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)
5  *
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.
9  */
10 #include <cstring>
11
12 #include "remote_mem.h"
13 #include "app_task.h"
14
15 l4_addr_t
16 Moe::Stack::add(l4_addr_t start, l4_umword_t size, Region_map *rm,
17                    Moe::Dataspace const *m, unsigned long offs,
18                    unsigned flags, unsigned char align,
19                    char const *what)
20 {
21   (void) what;
22   void *x = rm->attach((void*)start, size, Region_handler(m, L4_INVALID_CAP, offs,
23         flags), flags, align);
24   if (x == L4_INVALID_PTR)
25     return 0;
26
27   l4re_mem_area_t a;
28   a.start = (l4_addr_t)x;
29   a.size = size;
30   push(a);
31   return l4_addr_t(x);
32 }
33