62bab8d585145ac14074c583e460f471aed00960
[lunaix-os.git] / lunaix-os / arch / i386 / includes / sys / mm / memory.h
1 #ifndef __LUNAIX_MEMORY_H
2 #define __LUNAIX_MEMORY_H
3
4 #include <lunaix/mm/pagetable.h>
5 #include <lunaix/mann_flags.h>
6
7 static inline pte_attr_t
8 translate_vmr_prot(unsigned int vmr_prot)
9 {
10     pte_attr_t _pte_prot = _PTE_U;
11     if ((vmr_prot & PROT_READ)) {
12         _pte_prot |= _PTE_R;
13     }
14
15     if ((vmr_prot & PROT_WRITE)) {
16         _pte_prot |= _PTE_W;
17     }
18
19     if ((vmr_prot & PROT_EXEC)) {
20         _pte_prot |= _PTE_X;
21     }
22
23     return _pte_prot;
24 }
25
26
27 #endif /* __LUNAIX_MEMORY_H */