Changeset 686 for trunk/hal/x86_64/core/hal_gpt.c
- Timestamp:
- Jan 13, 2021, 12:47:53 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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
Note: See TracChangeset
for help on using the changeset viewer.