]> rtime.felk.cvut.cz Git - l4.git/blob - kernel/fiasco/src/abi/l4_buf_desc.cpp
update
[l4.git] / kernel / fiasco / src / abi / l4_buf_desc.cpp
1 INTERFACE:
2
3 #include "types.h"
4
5 class L4_buf_desc
6 {
7 public:
8   enum Flags
9   {
10     Inherit_fpu = (1UL << 24)
11   };
12
13   L4_buf_desc() {}
14
15   L4_buf_desc(unsigned mem, unsigned io, unsigned obj,
16               unsigned flags = 0)
17   : _raw(mem | (io << 5) | (obj << 10) | flags)
18   {}
19
20   unsigned mem() const { return _raw & ((1UL << 5)-1); }
21   unsigned io()  const { return (_raw >> 5) & ((1UL << 5)-1); }
22   unsigned obj() const { return (_raw >> 10) & ((1UL << 5)-1); }
23   Mword flags() const { return _raw; }
24
25   Mword raw() const { return _raw; }
26
27 private:
28   Mword _raw;
29 };