reduce the size of ppage by 8 bytes using signly linked list
[lunaix-os.git] / lunaix-os / includes / lunaix / mm / physical.h
1 #ifndef __LUNAIX_PHYSICAL_H
2 #define __LUNAIX_PHYSICAL_H
3
4 #include <lunaix/compiler.h>
5 #include <asm/physical.h>
6 #include <lunaix/ds/list.h>
7
8 /**
9  * @brief 长久页:不会被缓存,但允许释放
10  *
11  */
12 #define PP_FGPERSIST    0b0001
13
14 /**
15  * @brief 锁定页:不会被缓存,默认不可释放
16  *
17  */
18 #define PP_FGLOCKED     0b0011
19
20 /**
21  * @brief 预留页:不会被缓存,永远不可释放
22  *
23  */
24 #define PP_RESERVED     0b1000
25
26 struct ppage_arch;
27
28 struct ppage
29 {
30     unsigned int refs;
31     union {
32         struct {
33             union {
34                 struct {
35                     unsigned char flags:2;
36                     unsigned char order:6;
37                 };
38                 unsigned char top_flags;
39             };
40             struct {
41                 unsigned char pool:4;
42                 unsigned char type:4;
43             };
44         };
45         unsigned short attr;
46     };
47     unsigned short companion;
48     
49     struct list_node sibs;
50
51     struct ppage_arch arch;
52 } align(16);
53
54
55 #endif /* __LUNAIX_PHYSICAL_H */