Changes in kernel/arch/arm32/include/mm/page.h [c09adc10:98000fb] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/arm32/include/mm/page.h
rc09adc10 r98000fb 75 75 /* Get PTE address accessors for each level. */ 76 76 #define GET_PTL1_ADDRESS_ARCH(ptl0, i) \ 77 ((pte_t *) ((((pte_ t *)(ptl0))[(i)].l0).coarse_table_addr << 10))77 ((pte_t *) ((((pte_level0_t *)(ptl0))[(i)]).coarse_table_addr << 10)) 78 78 #define GET_PTL2_ADDRESS_ARCH(ptl1, i) \ 79 79 (ptl1) … … 81 81 (ptl2) 82 82 #define GET_FRAME_ADDRESS_ARCH(ptl3, i) \ 83 ((uintptr_t) ((((pte_ t *)(ptl3))[(i)].l1).frame_base_addr << 12))83 ((uintptr_t) ((((pte_level1_t *)(ptl3))[(i)]).frame_base_addr << 12)) 84 84 85 85 /* Set PTE address accessors for each level. */ 86 86 #define SET_PTL0_ADDRESS_ARCH(ptl0) \ 87 (set_ptl0_addr((pte_ t *) (ptl0)))87 (set_ptl0_addr((pte_level0_t *) (ptl0))) 88 88 #define SET_PTL1_ADDRESS_ARCH(ptl0, i, a) \ 89 (((pte_ t *) (ptl0))[(i)].l0.coarse_table_addr = (a) >> 10)89 (((pte_level0_t *) (ptl0))[(i)].coarse_table_addr = (a) >> 10) 90 90 #define SET_PTL2_ADDRESS_ARCH(ptl1, i, a) 91 91 #define SET_PTL3_ADDRESS_ARCH(ptl2, i, a) 92 92 #define SET_FRAME_ADDRESS_ARCH(ptl3, i, a) \ 93 (((pte_ t *) (ptl3))[(i)].l1.frame_base_addr = (a) >> 12)93 (((pte_level1_t *) (ptl3))[(i)].frame_base_addr = (a) >> 12) 94 94 95 95 /* Get PTE flags accessors for each level. */ 96 96 #define GET_PTL1_FLAGS_ARCH(ptl0, i) \ 97 get_pt_level0_flags((pte_ t *) (ptl0), (size_t) (i))97 get_pt_level0_flags((pte_level0_t *) (ptl0), (size_t) (i)) 98 98 #define GET_PTL2_FLAGS_ARCH(ptl1, i) \ 99 99 PAGE_PRESENT … … 101 101 PAGE_PRESENT 102 102 #define GET_FRAME_FLAGS_ARCH(ptl3, i) \ 103 get_pt_level1_flags((pte_ t *) (ptl3), (size_t) (i))103 get_pt_level1_flags((pte_level1_t *) (ptl3), (size_t) (i)) 104 104 105 105 /* Set PTE flags accessors for each level. */ 106 106 #define SET_PTL1_FLAGS_ARCH(ptl0, i, x) \ 107 set_pt_level0_flags((pte_ t *) (ptl0), (size_t) (i), (x))107 set_pt_level0_flags((pte_level0_t *) (ptl0), (size_t) (i), (x)) 108 108 #define SET_PTL2_FLAGS_ARCH(ptl1, i, x) 109 109 #define SET_PTL3_FLAGS_ARCH(ptl2, i, x) 110 110 #define SET_FRAME_FLAGS_ARCH(ptl3, i, x) \ 111 set_pt_level1_flags((pte_ t *) (ptl3), (size_t) (i), (x))111 set_pt_level1_flags((pte_level1_t *) (ptl3), (size_t) (i), (x)) 112 112 113 113 /* Macros for querying the last-level PTE entries. */ … … 115 115 (*((uint32_t *) (pte)) != 0) 116 116 #define PTE_PRESENT_ARCH(pte) \ 117 (((pte_ t *) (pte))->l0.descriptor_type != 0)117 (((pte_level0_t *) (pte))->descriptor_type != 0) 118 118 #define PTE_GET_FRAME_ARCH(pte) \ 119 (((pte_ t *) (pte))->l1.frame_base_addr << FRAME_WIDTH)119 (((pte_level1_t *) (pte))->frame_base_addr << FRAME_WIDTH) 120 120 #define PTE_WRITABLE_ARCH(pte) \ 121 (((pte_t *) (pte))->l1.access_permission_0 == PTE_AP_USER_RW_KERNEL_RW) 121 (((pte_level1_t *) (pte))->access_permission_0 == \ 122 PTE_AP_USER_RW_KERNEL_RW) 122 123 #define PTE_EXECUTABLE_ARCH(pte) \ 123 124 1 … … 158 159 } ATTRIBUTE_PACKED pte_level1_t; 159 160 160 typedef union {161 pte_level0_t l0;162 pte_level1_t l1;163 } pte_t;164 161 165 162 /* Level 1 page tables access permissions */ … … 194 191 * @param pt Pointer to the page table to set. 195 192 */ 196 static inline void set_ptl0_addr(pte_ t *pt)193 static inline void set_ptl0_addr(pte_level0_t *pt) 197 194 { 198 195 asm volatile ( … … 208 205 * @param i Index of the entry to return. 209 206 */ 210 static inline int get_pt_level0_flags(pte_ t *pt, size_t i)211 { 212 pte_level0_t *p = &pt[i] .l0;207 static inline int get_pt_level0_flags(pte_level0_t *pt, size_t i) 208 { 209 pte_level0_t *p = &pt[i]; 213 210 int np = (p->descriptor_type == PTE_DESCRIPTOR_NOT_PRESENT); 214 211 … … 223 220 * @param i Index of the entry to return. 224 221 */ 225 static inline int get_pt_level1_flags(pte_ t *pt, size_t i)226 { 227 pte_level1_t *p = &pt[i] .l1;222 static inline int get_pt_level1_flags(pte_level1_t *pt, size_t i) 223 { 224 pte_level1_t *p = &pt[i]; 228 225 229 226 int dt = p->descriptor_type; … … 248 245 * @param flags new flags 249 246 */ 250 static inline void set_pt_level0_flags(pte_ t *pt, size_t i, int flags)251 { 252 pte_level0_t *p = &pt[i] .l0;247 static inline void set_pt_level0_flags(pte_level0_t *pt, size_t i, int flags) 248 { 249 pte_level0_t *p = &pt[i]; 253 250 254 251 if (flags & PAGE_NOT_PRESENT) { … … 276 273 * @param flags New flags. 277 274 */ 278 static inline void set_pt_level1_flags(pte_ t *pt, size_t i, int flags)279 { 280 pte_level1_t *p = &pt[i] .l1;275 static inline void set_pt_level1_flags(pte_level1_t *pt, size_t i, int flags) 276 { 277 pte_level1_t *p = &pt[i]; 281 278 282 279 if (flags & PAGE_NOT_PRESENT) {
Note:
See TracChangeset
for help on using the changeset viewer.