]> rtime.felk.cvut.cz Git - l4.git/blob - l4/pkg/l4re-core/moe/server/src/dataspace_cont.h
Update
[l4.git] / l4 / pkg / l4re-core / 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 short flags,
19                  unsigned char page_shift);
20
21   Address address(l4_addr_t offset,
22                   Ds_rw rw, l4_addr_t hot_spot = 0,
23                   l4_addr_t min = 0, l4_addr_t max = ~0) const;
24
25   void unmap(bool ro = false) const throw();
26
27   int dma_map(Dma_space *dma, l4_addr_t offset, l4_size_t *size,
28               Dma_attribs dma_attrs, Dma_space::Direction dir,
29               Dma_space::Dma_addr *dma_addr);
30   int dma_unmap(Dma_space *dma, l4_addr_t offset, l4_size_t size,
31                 Dma_attribs dma_attrs, Dma_space::Direction dir);
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