Changeset 116 for trunk/hal/x86_64/core/hal_gpt.c
- Timestamp:
- Jun 30, 2017, 5:18:13 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/hal/x86_64/core/hal_gpt.c
r114 r116 71 71 void hal_gpt_bootstrap_reset() 72 72 { 73 // XXX: will be revisited later 74 // size_t npages = (va_avail - (CLUSTER_MIN_VA(0) + KERNEL_VA_SIZE)) / PAGE_SIZE; 75 // hal_gpt_leave_range(CLUSTER_MIN_VA(0) + KERNEL_VA_SIZE, npages); 76 // va_avail = CLUSTER_MIN_VA(0) + KERNEL_VA_SIZE; 73 size_t npages = (va_avail - (CLUSTER_MIN_VA(0) + KERNEL_VA_SIZE)) / PAGE_SIZE; 74 hal_gpt_leave_range(CLUSTER_MIN_VA(0) + KERNEL_VA_SIZE, npages); 75 va_avail = CLUSTER_MIN_VA(0) + KERNEL_VA_SIZE; 76 } 77 78 /* 79 * Uniformize the PA and VA offsets, and return the value. After this function, 80 * we are guaranteed to have [VA = PA + constant_offset]. And therefore we can 81 * only call hal_gpt_bootstrap_valloc, without entering it in a PA. 82 */ 83 size_t hal_gpt_bootstrap_uniformize() 84 { 85 size_t pa_offset = pa_avail - 0; 86 size_t va_offset = va_avail - CLUSTER_MIN_VA(0); 87 88 if (pa_offset < va_offset) 89 pa_avail += (va_offset - pa_offset); 90 else if (pa_offset > va_offset) 91 va_avail += (pa_offset - va_offset); 92 93 return MAX(pa_offset, va_offset); 77 94 } 78 95 … … 81 98 XASSERT(va % PAGE_SIZE == 0); 82 99 XASSERT(pa % PAGE_SIZE == 0); 83 XASSERT(va == tmpva || PTE_BASE[pl1_i(va)] == 0);100 //XASSERT(va == tmpva || PTE_BASE[pl1_i(va)] == 0); 84 101 PTE_BASE[pl1_i(va)] = (pa & PG_FRAME) | flags; 85 102 invlpg(va); … … 223 240 224 241 /* Manually enter cluster0's heap */ 225 /*226 242 hal_gpt_enter_range(CLUSTER_MIN_VA(0) + kimg_size, kimg_max_pa, 227 243 (CLUSTER_VA_SIZE - kimg_size) / PAGE_SIZE); 228 */229 244 } 230 245
Note: See TracChangeset
for help on using the changeset viewer.