Changes in kernel/arch/ia32/include/mm/page.h [0eef314:dc0b964] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/ia32/include/mm/page.h
r0eef314 rdc0b964 27 27 */ 28 28 29 /** @addtogroup ia32mm 29 /** @addtogroup ia32mm 30 30 * @{ 31 31 */ … … 37 37 38 38 #include <arch/mm/frame.h> 39 40 #define PAGE_WIDTH FRAME_WIDTH 41 #define PAGE_SIZE FRAME_SIZE 39 #include <trace.h> 40 41 #define PAGE_WIDTH FRAME_WIDTH 42 #define PAGE_SIZE FRAME_SIZE 42 43 43 44 #ifdef KERNEL 44 45 45 46 #ifndef __ASM__ 46 # define KA2PA(x) (((uintptr_t) (x)) - 0x80000000) 47 # define PA2KA(x) (((uintptr_t) (x)) + 0x80000000) 48 #else 49 # define KA2PA(x) ((x) - 0x80000000) 50 # define PA2KA(x) ((x) + 0x80000000) 51 #endif 47 48 #define KA2PA(x) (((uintptr_t) (x)) - UINT32_C(0x80000000)) 49 #define PA2KA(x) (((uintptr_t) (x)) + UINT32_C(0x80000000)) 50 51 #else /* __ASM__ */ 52 53 #define KA2PA(x) ((x) - 0x80000000) 54 #define PA2KA(x) ((x) + 0x80000000) 55 56 #endif /* __ASM__ */ 52 57 53 58 /* … … 57 62 58 63 /* Number of entries in each level. */ 59 #define PTL0_ENTRIES_ARCH 60 #define PTL1_ENTRIES_ARCH 61 #define PTL2_ENTRIES_ARCH 62 #define PTL3_ENTRIES_ARCH 64 #define PTL0_ENTRIES_ARCH 1024 65 #define PTL1_ENTRIES_ARCH 0 66 #define PTL2_ENTRIES_ARCH 0 67 #define PTL3_ENTRIES_ARCH 1024 63 68 64 69 /* Page table sizes for each level. */ 65 #define PTL0_SIZE_ARCH 66 #define PTL1_SIZE_ARCH 67 #define PTL2_SIZE_ARCH 68 #define PTL3_SIZE_ARCH 70 #define PTL0_SIZE_ARCH ONE_FRAME 71 #define PTL1_SIZE_ARCH 0 72 #define PTL2_SIZE_ARCH 0 73 #define PTL3_SIZE_ARCH ONE_FRAME 69 74 70 75 /* Macros calculating indices for each level. */ 71 #define PTL0_INDEX_ARCH(vaddr) (((vaddr) >> 22) & 0x3ff)72 #define PTL1_INDEX_ARCH(vaddr) 73 #define PTL2_INDEX_ARCH(vaddr) 74 #define PTL3_INDEX_ARCH(vaddr) (((vaddr) >> 12) & 0x3ff)76 #define PTL0_INDEX_ARCH(vaddr) (((vaddr) >> 22) & 0x3ffU) 77 #define PTL1_INDEX_ARCH(vaddr) 0 78 #define PTL2_INDEX_ARCH(vaddr) 0 79 #define PTL3_INDEX_ARCH(vaddr) (((vaddr) >> 12) & 0x3ffU) 75 80 76 81 /* Get PTE address accessors for each level. */ … … 105 110 106 111 /* Set PTE flags accessors for each level. */ 107 #define SET_PTL1_FLAGS_ARCH(ptl0, i, x) 112 #define SET_PTL1_FLAGS_ARCH(ptl0, i, x) \ 108 113 set_pt_flags((pte_t *) (ptl0), (size_t) (i), (x)) 109 114 #define SET_PTL2_FLAGS_ARCH(ptl1, i, x) … … 121 126 #define PTE_WRITABLE_ARCH(p) \ 122 127 ((p)->writeable != 0) 123 #define PTE_EXECUTABLE_ARCH(p) 128 #define PTE_EXECUTABLE_ARCH(p) 1 124 129 125 130 #ifndef __ASM__ … … 127 132 #include <mm/mm.h> 128 133 #include <arch/interrupt.h> 129 #include <arch/types.h>130 134 #include <typedefs.h> 131 135 … … 144 148 145 149 /** When bit on this position is 1, a reserved bit was set in page directory. */ 146 #define PFERR_CODE_RSVD (1 << 3) 150 #define PFERR_CODE_RSVD (1 << 3) 147 151 148 152 /** Page Table Entry. */ … … 162 166 } __attribute__ ((packed)) pte_t; 163 167 164 static inline unsigned int get_pt_flags(pte_t *pt, size_t i)168 NO_TRACE static inline unsigned int get_pt_flags(pte_t *pt, size_t i) 165 169 { 166 170 pte_t *p = &pt[i]; … … 175 179 } 176 180 177 static inline void set_pt_flags(pte_t *pt, size_t i, int flags)181 NO_TRACE static inline void set_pt_flags(pte_t *pt, size_t i, int flags) 178 182 { 179 183 pte_t *p = &pt[i]; … … 193 197 194 198 extern void page_arch_init(void); 195 extern void page_fault( int n, istate_t *istate);199 extern void page_fault(unsigned int, istate_t *); 196 200 197 201 #endif /* __ASM__ */
Note:
See TracChangeset
for help on using the changeset viewer.