]> rtime.felk.cvut.cz Git - l4.git/blob - l4/pkg/vmm/server/src/vm_ram.h
Update
[l4.git] / l4 / pkg / vmm / server / src / vm_ram.h
1 /*
2  * (c) 2013-2014 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 <l4/sys/l4int.h>
12
13 #include <l4/l4virtio/virtqueue>
14
15 namespace Vmm {
16
17 class Vm_ram
18 {
19 protected:
20   Vm_ram() : _vm_start(~0UL), _cont(false), _ident(false) {}
21
22 public:
23   template<typename T>
24   T *access(L4virtio::Ptr<T> p) const { return (T*)(p.get() + _offset); }
25
26   l4_addr_t vm_start() const { return _vm_start; }
27   l4_size_t size() const { return _size; }
28   l4_addr_t local_start() const { return _local_start; }
29
30 protected:
31   l4_mword_t _offset;
32   l4_addr_t _local_start;
33   l4_addr_t _local_end;
34
35   l4_addr_t _vm_start;
36   l4_size_t _size;
37
38   bool _cont;
39   bool _ident;
40 };
41
42 }