Changeset 44 for trunk/hal/x86_64/hal_gpt.c
- Timestamp:
- Jun 23, 2017, 9:57:35 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/hal/x86_64/hal_gpt.c
r42 r44 44 44 #define pl4_i(VA) (((VA_SIGN_POS(VA)) & L4_FRAME) >> L4_SHIFT) 45 45 46 extern vaddr_t __kernel_end; 47 size_t kimg_size __in_kdata = 0; 48 46 49 paddr_t pa_avail __in_kdata = 0; 47 50 vaddr_t va_avail __in_kdata = 0; … … 176 179 void hal_gpt_init(paddr_t firstpa) 177 180 { 181 paddr_t kimg_min_pa = 0; 182 183 /* Initialize global values */ 178 184 pa_avail = firstpa; 179 va_avail = CLUSTER_MIN_VA(0); 180 hal_gpt_maptree_area(CLUSTER_MIN_VA(0), CLUSTER_MAX_VA(0)); 185 va_avail = CLUSTER_HEAP_MIN_VA(0); 186 kimg_size = ((uint64_t)&__kernel_end - KERNBASE); 187 XASSERT(kimg_size % PAGE_SIZE == 0); 188 kimg_size = kimg_size / PAGE_SIZE; 189 190 /* Create cluster0's heap entry. */ 191 hal_gpt_maptree_area(CLUSTER_HEAP_MIN_VA(0), CLUSTER_HEAP_MAX_VA(0)); 192 193 /* Create cluster0's kimg entry. */ 194 hal_gpt_maptree_area(CLUSTER_KIMG_MIN_VA(0), CLUSTER_KIMG_MAX_VA(0)); 195 196 /* Manually enter cluster0's kimg */ 197 hal_gpt_enter_range(CLUSTER_KIMG_MIN_VA(0), kimg_min_pa, kimg_size); 181 198 } 182 199
Note: See TracChangeset
for help on using the changeset viewer.