Rev 1702 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 1702 | Rev 1780 | ||
|---|---|---|---|
| Line 41... | Line 41... | ||
| 41 | #define PAGE_SIZE FRAME_SIZE |
41 | #define PAGE_SIZE FRAME_SIZE |
| 42 | 42 | ||
| 43 | #ifdef KERNEL |
43 | #ifdef KERNEL |
| 44 | 44 | ||
| 45 | #ifndef __ASM__ |
45 | #ifndef __ASM__ |
| 46 | # define KA2PA(x) (((__address) (x)) - 0x80000000) |
46 | # define KA2PA(x) (((uintptr_t) (x)) - 0x80000000) |
| 47 | # define PA2KA(x) (((__address) (x)) + 0x80000000) |
47 | # define PA2KA(x) (((uintptr_t) (x)) + 0x80000000) |
| 48 | #else |
48 | #else |
| 49 | # define KA2PA(x) ((x) - 0x80000000) |
49 | # define KA2PA(x) ((x) - 0x80000000) |
| 50 | # define PA2KA(x) ((x) + 0x80000000) |
50 | # define PA2KA(x) ((x) + 0x80000000) |
| 51 | #endif |
51 | #endif |
| 52 | 52 | ||
| Line 92... | Line 92... | ||
| 92 | #define SET_PTL1_FLAGS_ARCH(ptl0, i, x) set_pt_flags((pte_t *) (ptl0), (index_t) (i), (x)) |
92 | #define SET_PTL1_FLAGS_ARCH(ptl0, i, x) set_pt_flags((pte_t *) (ptl0), (index_t) (i), (x)) |
| 93 | #define SET_PTL2_FLAGS_ARCH(ptl1, i, x) |
93 | #define SET_PTL2_FLAGS_ARCH(ptl1, i, x) |
| 94 | #define SET_PTL3_FLAGS_ARCH(ptl2, i, x) |
94 | #define SET_PTL3_FLAGS_ARCH(ptl2, i, x) |
| 95 | #define SET_FRAME_FLAGS_ARCH(ptl3, i, x) set_pt_flags((pte_t *) (ptl3), (index_t) (i), (x)) |
95 | #define SET_FRAME_FLAGS_ARCH(ptl3, i, x) set_pt_flags((pte_t *) (ptl3), (index_t) (i), (x)) |
| 96 | 96 | ||
| 97 | #define PTE_VALID_ARCH(pte) (*((__u32 *) (pte)) != 0) |
97 | #define PTE_VALID_ARCH(pte) (*((uint32_t *) (pte)) != 0) |
| 98 | #define PTE_PRESENT_ARCH(pte) ((pte)->p != 0) |
98 | #define PTE_PRESENT_ARCH(pte) ((pte)->p != 0) |
| 99 | #define PTE_GET_FRAME_ARCH(pte) ((__address) ((pte)->pfn << 12)) |
99 | #define PTE_GET_FRAME_ARCH(pte) ((uintptr_t) ((pte)->pfn << 12)) |
| 100 | #define PTE_WRITABLE_ARCH(pte) 1 |
100 | #define PTE_WRITABLE_ARCH(pte) 1 |
| 101 | #define PTE_EXECUTABLE_ARCH(pte) 1 |
101 | #define PTE_EXECUTABLE_ARCH(pte) 1 |
| 102 | 102 | ||
| 103 | #ifndef __ASM__ |
103 | #ifndef __ASM__ |
| 104 | 104 | ||