Changes in kernel/genarch/src/mm/page_pt.c [caed0279:a2789d2] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/genarch/src/mm/page_pt.c
rcaed0279 ra2789d2 48 48 #include <align.h> 49 49 #include <macros.h> 50 #include <bitops.h>51 50 52 51 static void pt_mapping_insert(as_t *, uintptr_t, uintptr_t, unsigned int); … … 293 292 } 294 293 295 /** Return the size of the region mapped by a single PTL0 entry.296 *297 * @return Size of the region mapped by a single PTL0 entry.298 */299 static uintptr_t ptl0_step_get(void)300 {301 size_t va_bits;302 303 va_bits = fnzb(PTL0_ENTRIES) + fnzb(PTL1_ENTRIES) + fnzb(PTL2_ENTRIES) +304 fnzb(PTL3_ENTRIES) + PAGE_WIDTH;305 306 return 1UL << (va_bits - fnzb(PTL0_ENTRIES));307 }308 309 294 /** Make the mappings in the given range global accross all address spaces. 310 295 * … … 324 309 { 325 310 uintptr_t ptl0 = PA2KA((uintptr_t) AS_KERNEL->genarch.page_table); 326 uintptr_t ptl0 _step = ptl0_step_get();311 uintptr_t ptl0step = (((uintptr_t) -1) / PTL0_ENTRIES) + 1; 327 312 size_t order; 328 313 uintptr_t addr; … … 336 321 #endif 337 322 323 ASSERT(ispwr2(ptl0step)); 338 324 ASSERT(size > 0); 339 325 340 for (addr = ALIGN_DOWN(base, ptl0 _step); addr - 1 < base + size - 1;341 addr += ptl0 _step) {326 for (addr = ALIGN_DOWN(base, ptl0step); addr - 1 < base + size - 1; 327 addr += ptl0step) { 342 328 uintptr_t l1; 343 329
Note:
See TracChangeset
for help on using the changeset viewer.