Ignore:
Timestamp:
Jan 13, 2021, 12:47:53 AM (4 years ago)
Author:
alain
Message:

cosmetic

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/hal/x86_64/core/hal_gpt.c

    r635 r686  
    301301        L4dst = (pt_entry_t *)ppm_page2base(page_xp);
    302302        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) |
    304304            PG_V | PG_KW | PG_NX;
    305305
     
    324324error_t hal_gpt_set_pte(gpt_t *gpt, vpn_t vpn, uint32_t attr, ppn_t ppn)
    325325{
    326         vaddr_t va = vpn << CONFIG_PPM_PAGE_SHIFT;
     326        vaddr_t va = vpn << CONFIG_PPM_PAGE_ORDER;
    327327        paddr_t pa;
    328328        kmem_req_t req;
     
    384384        }
    385385
    386         pa = ppn << CONFIG_PPM_PAGE_SHIFT;
     386        pa = ppn << CONFIG_PPM_PAGE_ORDER;
    387387        L1_BASE[pl1_i(va)] = pa | hal_gpt_attr_to_pte(attr);
    388388
     
    392392void hal_gpt_get_pte(gpt_t *gpt, vpn_t vpn, uint32_t *attr, ppn_t *ppn)
    393393{
    394         vaddr_t va = vpn << CONFIG_PPM_PAGE_SHIFT;
     394        vaddr_t va = vpn << CONFIG_PPM_PAGE_ORDER;
    395395
    396396        *attr = 0;
     
    408408                /* large page */
    409409                *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;
    411411        } else {
    412412                /* small page */
    413413                *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;
    415415        }
    416416
Note: See TracChangeset for help on using the changeset viewer.