]> rtime.felk.cvut.cz Git - l4.git/blob - l4/pkg/moe/server/src/dataspace_cont.h
update
[l4.git] / l4 / pkg / moe / server / src / dataspace_cont.h
1 /*
2  * (c) 2008-2009 Alexander Warg <warg@os.inf.tu-dresden.de>
3  *     economic rights: Technische Universität Dresden (Germany)
4  *
5  * This file is part of TUD:OS and distributed under the terms of the
6  * GNU General Public License 2.
7  * Please see the COPYING-GPL-2 file for details.
8  */
9 #pragma once
10
11 #include "dataspace.h"
12
13 namespace Moe {
14
15 class Dataspace_cont : public Dataspace
16 {
17 public:
18   Dataspace_cont(void *start, unsigned long size, unsigned long flags = 0);
19
20   Address address(l4_addr_t offset,
21                   Ds_rw rw, l4_addr_t hot_spot = 0,
22                   l4_addr_t min = 0, l4_addr_t max = ~0) const;
23
24   unsigned long page_shift() const throw() { return L4_LOG2_PAGESIZE; }
25
26   void unmap(bool ro = false) const throw();
27
28   int phys(l4_addr_t offset, l4_addr_t &phys_addr, l4_size_t &phys_size) throw();
29
30   virtual ~Dataspace_cont() {}
31
32
33 protected:
34   void start(void *start) { _start = (char*)start; }
35   void *start() { return _start; }
36
37 private:
38   char *_start;
39 };
40
41 };
42