]> rtime.felk.cvut.cz Git - l4.git/blob - kernel/fiasco/src/kern/mem_space_sigma0.cpp
update
[l4.git] / kernel / fiasco / src / kern / mem_space_sigma0.cpp
1 INTERFACE:
2
3 #include "mem_space.h"
4
5 class Mem_space_sigma0 : public Mem_space
6 {
7 };
8
9
10 IMPLEMENTATION:
11
12 #include "config.h"
13
14
15 PUBLIC inline
16 Mem_space_sigma0::Mem_space_sigma0(Ram_quota *q)
17 : Mem_space(q)
18 {}
19
20 PUBLIC inline
21 Address
22 Mem_space_sigma0::virt_to_phys_s0 (void *a) const // pgtble lookup
23 {
24   return (Address)a;
25 }
26
27
28 PUBLIC
29 bool
30 Mem_space_sigma0::v_fabricate(Vaddr address,
31                               Phys_addr* phys, Size* size,
32                               unsigned* attribs = 0)
33 {
34   // special-cased because we don't do ptab lookup for sigma0
35   *size = has_superpages() ? Size(Config::SUPERPAGE_SIZE) : Size(Config::PAGE_SIZE);
36   *phys = address.trunc(*size);
37
38   if (attribs)
39     *attribs = Page_writable | Page_user_accessible | Page_cacheable;
40
41   return true;
42 }
43
44 PUBLIC inline virtual
45 Page_number
46 Mem_space_sigma0::map_max_address() const
47 { return Page_number::create(1UL << (MWORD_BITS - Page_shift)); }
48