aboutsummaryrefslogtreecommitdiff
path: root/kernel/include/mm/virtual_mm.h
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/include/mm/virtual_mm.h')
-rw-r--r--kernel/include/mm/virtual_mm.h44
1 files changed, 22 insertions, 22 deletions
diff --git a/kernel/include/mm/virtual_mm.h b/kernel/include/mm/virtual_mm.h
index 4873a30..92ffd3c 100644
--- a/kernel/include/mm/virtual_mm.h
+++ b/kernel/include/mm/virtual_mm.h
@@ -29,37 +29,37 @@
#define PAGE_TABLE_INDEX(virtual_address) ((virtual_address >> 12) & 0x3ff)
#define SET_PDE_PRESENT(x) x
-#define SET_PDE_WRITABLE(x) (x << 1)
-#define SET_PDE_USER(x) (x << 2)
-#define SET_PDE_WRITETHROUGH(x) (x << 3)
-#define SET_PDE_CACHE_DISABLE(x) (x << 4)
-#define SET_PDE_ACCESSED(x) (x << 5)
+#define SET_PDE_WRITABLE(x) ((x) << 1)
+#define SET_PDE_USER(x) ((x) << 2)
+#define SET_PDE_WRITETHROUGH(x) ((x) << 3)
+#define SET_PDE_CACHE_DISABLE(x) ((x) << 4)
+#define SET_PDE_ACCESSED(x) ((x) << 5)
/* Never set (reserved by Intel) */
-#define SET_PDE_RESERVED(x) (x << 6)
-#define SET_PDE_PAGE_SIZE(x) (x << 7)
+#define SET_PDE_RESERVED(x) ((x) << 6)
+#define SET_PDE_PAGE_SIZE(x) ((x) << 7)
/* NOTE: Unused by the CPU, free to be used by us! */
-#define SET_PDE_UNUSED(x) (x << 8)
+#define SET_PDE_UNUSED(x) ((x) << 8)
/* Page table address */
-#define SET_PDE_FRAME(x) (x << 12)
+#define SET_PDE_FRAME(x) ((x) << 12)
-#define GET_PDE_FRAME(x) (*x >> 12)
+#define GET_PDE_FRAME(x) ((*x) >> 12)
#define SET_PTE_PRESENT(x) x
-#define SET_PTE_WRITABLE(x) (x << 1)
-#define SET_PTE_USER(x) (x << 2)
-#define SET_PTE_WRITETHROUGH(x) (x << 3)
-#define SET_PTE_CACHE_DISABLE(x) (x << 4)
-#define SET_PTE_ACCESSED(x) (x << 5)
-#define SET_PTE_DIRTY(x) (x << 6)
-#define SET_PTE_PAT(x) (x << 7)
-#define SET_PTE_GLOBAL(x) (x << 8)
+#define SET_PTE_WRITABLE(x) ((x) << 1)
+#define SET_PTE_USER(x) ((x) << 2)
+#define SET_PTE_WRITETHROUGH(x) ((x) << 3)
+#define SET_PTE_CACHE_DISABLE(x) ((x) << 4)
+#define SET_PTE_ACCESSED(x) ((x) << 5)
+#define SET_PTE_DIRTY(x) ((x) << 6)
+#define SET_PTE_PAT(x) ((x) << 7)
+#define SET_PTE_GLOBAL(x) ((x) << 8)
/* NOTE: Unused by the CPU, free to be used by us! */
-#define SET_PTE_UNUSED(x) (x << 9)
+#define SET_PTE_UNUSED(x) ((x) << 9)
/* MAX: 0xFFFFF000 */
-#define SET_PTE_FRAME(x) (x << 12)
+#define SET_PTE_FRAME(x) ((x) << 12)
-#define PTE_IS_PRESENT(x) (x & 1)
-#define GET_PTE_FRAME(x) (*x >> 12)
+#define PTE_IS_PRESENT(x) ((x) &1)
+#define GET_PTE_FRAME(x) ((*x) >> 12)
#define ADD_ATTRIB(entry, attribute) (*entry |= (attribute))