e1710bf691e45a67b8ec7a55b579cad9c866779d
[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
7 /**
8  * @brief 长久页:不会被缓存,但允许释放
9  *
10  */
11 #define PP_FGPERSIST    0b0001
12
13 /**
14  * @brief 锁定页:不会被缓存,默认不可释放
15  *
16  */
17 #define PP_FGLOCKED     0b0011
18
19 /**
20  * @brief 预留页:不会被缓存,永远不可释放
21  *
22  */
23 #define PP_RESERVED     0b1000
24
25 struct ppage_arch;
26
27 struct ppage
28 {
29     unsigned int refs;
30     union {
31         struct {
32             union {
33                 struct {
34                     unsigned char flags:2;
35                     unsigned char order:6;
36                 };
37                 unsigned char top_flags;
38             };
39             struct {
40                 unsigned char pool:4;
41                 unsigned char type:4;
42             };
43         };
44         unsigned short attr;
45     };
46     unsigned short companion;
47     
48     struct llist_header sibs;
49
50     struct ppage_arch arch;
51 } align(16);
52
53
54 #endif /* __LUNAIX_PHYSICAL_H */