1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#![no_std]
#![crate_name = "multiboot"]
#![crate_type = "lib"]
macro_rules! round_up {
($num:expr, $s:expr) => {
(($num + $s - 1) / $s) * $s
};
}
macro_rules! flag {
($doc:meta, $fun:ident, $bit:expr) => (
#[$doc]
pub fn $fun(&self) -> bool {
(self.header.flags & (1 << $bit)) > 0
}
paste::paste! {
#[$doc]
fn [< set_ $fun >] (&mut self, flag: bool) {
self.header.flags = if flag {
self.header.flags | (1 << $bit)
} else {
self.header.flags & !(1 << $bit)
};
}
}
);
}
pub mod information;
pub mod header;