Changeset 686 for trunk/hal/x86_64
- Timestamp:
- Jan 13, 2021, 12:47:53 AM (4 years ago)
- Location:
- trunk/hal/x86_64/core
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/hal/x86_64/core/hal_context.c
r457 r686 109 109 /* Switch the VM space */ 110 110 if (newproc != oldproc) { 111 lcr3((uint64_t)newproc->vmm.gpt.ppn << CONFIG_PPM_PAGE_ SHIFT);111 lcr3((uint64_t)newproc->vmm.gpt.ppn << CONFIG_PPM_PAGE_ORDER); 112 112 } 113 113 -
trunk/hal/x86_64/core/hal_exception.c
r457 r686 95 95 96 96 error = vmm_handle_page_fault(process, 97 bad_vaddr >> CONFIG_PPM_PAGE_ SHIFT);97 bad_vaddr >> CONFIG_PPM_PAGE_ORDER); 98 98 99 99 x86_printf("VA=%Z ERROR=%Z\n", bad_vaddr, (uint64_t)error); -
trunk/hal/x86_64/core/hal_gpt.c
r635 r686 301 301 L4dst = (pt_entry_t *)ppm_page2base(page_xp); 302 302 memcpy(&L4dst[256], &L4src[256], 256 * sizeof(pt_entry_t)); 303 L4dst[L4_SLOT_PTE] = (ppm_page2ppn(page_xp) << CONFIG_PPM_PAGE_ SHIFT) |303 L4dst[L4_SLOT_PTE] = (ppm_page2ppn(page_xp) << CONFIG_PPM_PAGE_ORDER) | 304 304 PG_V | PG_KW | PG_NX; 305 305 … … 324 324 error_t hal_gpt_set_pte(gpt_t *gpt, vpn_t vpn, uint32_t attr, ppn_t ppn) 325 325 { 326 vaddr_t va = vpn << CONFIG_PPM_PAGE_ SHIFT;326 vaddr_t va = vpn << CONFIG_PPM_PAGE_ORDER; 327 327 paddr_t pa; 328 328 kmem_req_t req; … … 384 384 } 385 385 386 pa = ppn << CONFIG_PPM_PAGE_ SHIFT;386 pa = ppn << CONFIG_PPM_PAGE_ORDER; 387 387 L1_BASE[pl1_i(va)] = pa | hal_gpt_attr_to_pte(attr); 388 388 … … 392 392 void hal_gpt_get_pte(gpt_t *gpt, vpn_t vpn, uint32_t *attr, ppn_t *ppn) 393 393 { 394 vaddr_t va = vpn << CONFIG_PPM_PAGE_ SHIFT;394 vaddr_t va = vpn << CONFIG_PPM_PAGE_ORDER; 395 395 396 396 *attr = 0; … … 408 408 /* large page */ 409 409 *attr = hal_gpt_pte_to_attr(&L2_BASE[pl2_i(va)]); 410 *ppn = (L2_BASE[pl2_i(va)] & PG_2MFRAME) >> CONFIG_PPM_PAGE_ SHIFT;410 *ppn = (L2_BASE[pl2_i(va)] & PG_2MFRAME) >> CONFIG_PPM_PAGE_ORDER; 411 411 } else { 412 412 /* small page */ 413 413 *attr = hal_gpt_pte_to_attr(&L1_BASE[pl1_i(va)]); 414 *ppn = (L1_BASE[pl1_i(va)] & PG_FRAME) >> CONFIG_PPM_PAGE_ SHIFT;414 *ppn = (L1_BASE[pl1_i(va)] & PG_FRAME) >> CONFIG_PPM_PAGE_ORDER; 415 415 } 416 416 -
trunk/hal/x86_64/core/hal_ppm.c
r457 r686 68 68 69 69 // compute number of pages required to store page descriptor array 70 uint32_t pages_tbl_nr = bytes >> CONFIG_PPM_PAGE_ SHIFT;70 uint32_t pages_tbl_nr = bytes >> CONFIG_PPM_PAGE_ORDER; 71 71 72 72 // compute total number of reserved pages (kernel code & pages_tbl[])
Note: See TracChangeset
for help on using the changeset viewer.