]> rtime.felk.cvut.cz Git - l4.git/blob - kernel/fiasco/src/kern/io_space_sigma0.cpp
update
[l4.git] / kernel / fiasco / src / kern / io_space_sigma0.cpp
1 INTERFACE [io]:
2
3 #include "io_space.h"
4
5 template< typename SPACE >
6 class Io_space_sigma0 : public Generic_io_space<SPACE>
7 {
8   typedef Generic_io_space<SPACE> _B;
9 public:
10   typedef typename _B::Addr Addr;
11   typedef typename _B::Size Size;
12   typedef typename _B::Phys_addr Phys_addr;
13 };
14
15 IMPLEMENTATION [io]:
16
17 //
18 // Utilities for map<Generic_io_space> and unmap<Generic_io_space>
19 //
20
21 PUBLIC template< typename SPACE >
22 bool
23 Io_space_sigma0<SPACE>::v_fabricate(Addr address, Phys_addr* phys,
24                                     Size* size, unsigned* attribs = 0)
25 {
26   // special-cased because we don't do lookup for sigma0
27   *phys = address.trunc(Size(_B::Map_superpage_size));
28   *size = Size(_B::Map_superpage_size);
29   if (attribs) *attribs = _B::Page_writable | _B::Page_user_accessible;
30   return true;
31 }
32