Cleaning up and commenting

This commit is contained in:
thomas committed 2018-03-20 14:10:03 +01:00
1 parent ab1a471857
commit 83f81b9a74
3 files changed
+23 -3

No files matched your search

+13
View File
@@ -1,6 +1,19 @@
#pragma once
#define KERNEL_OFFSET 0xFFFFFF8000000000
#ifdef __ASSEMBLER__
#define V2P(a) ((a) - KERNEL_OFFSET)
#define P2V(a) ((a) + KERNEL_OFFSET)
#else
#include <stdint.h>
#define V2P(a) ((uintptr_t)(a) - KERNEL_OFFSET)
#define P2V(a) ((void *)((uintptr_t)(a) + KERNEL_OFFSET))
#endif
#define P1_OFFSET(a) (((a)>>12) & 0x1FF)
#define P2_OFFSET(a) (((a)>>21) & 0x1FF)
#define P3_OFFSET(a) (((a)>>30) & 0x1FF)
#define P4_OFFSET(a) (((a)>>39) & 0x1FF)
#define PAGE_PRESENT 0x001
#define PAGE_WRITE 0x002