Changeset 316 for trunk/hal


Ignore:
Timestamp:
Aug 3, 2017, 12:01:19 PM (4 years ago)
Author:
max@…
Message:

Synchronize with Alain's changes. Still several issues.

Location:
trunk/hal/x86_64/core
Files:
2 edited

Legend:

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

    r272 r316  
    257257{
    258258        page_t *page;
     259        xptr_t page_xp;
    259260
    260261        /* check page size */
     
    276277        }
    277278
     279        /*
     280         * XXX XXX XXX: can kmem_alloc allocate the page in a remote cluster??
     281         */
     282        page_xp = XPTR(local_cxy, page);
     283
    278284        /* populate the kernel entries */
    279285        pt_entry_t *L4src, *L4dst;
     
    281287        vaddr_t L4vaddr = L4paddr + KERNBASE; // XXX
    282288        L4src = (pt_entry_t *)L4vaddr;
    283         L4dst = (pt_entry_t *)ppm_page2vaddr(page);
     289        L4dst = (pt_entry_t *)ppm_page2base(page_xp);
    284290        memcpy(&L4dst[256], &L4src[256], 256 * sizeof(pt_entry_t));
    285         L4dst[L4_SLOT_PTE] = (ppm_page2ppn(page) >> CONFIG_PPM_PAGE_SHIFT) |
     291        L4dst[L4_SLOT_PTE] = (ppm_page2ppn(page_xp) >> CONFIG_PPM_PAGE_SHIFT) |
    286292            PG_V | PG_KW | PG_NX;
    287293
    288294        /* initialize generic page table descriptor */
    289         gpt->ptr  = ppm_page2vaddr(page);
    290         gpt->ppn  = ppm_page2ppn(page);
    291         gpt->page = page;
     295        gpt->ptr  = GET_PTR(ppm_page2base(page_xp));
     296        gpt->ppn  = ppm_page2ppn(page_xp);
     297        gpt->page = GET_PTR(page_xp);
    292298
    293299        /* initialize PTE entries attributes masks */
  • trunk/hal/x86_64/core/hal_types.h

    r315 r316  
    217217#define LPA_SHIFT              33
    218218#define CXY_FROM_PADDR(paddr)  ((cxy_t)((paddr) >> LPA_SHIFT))
    219 #define LPA_FROM_PADDR(paddr)  (lpa_t)((paddr & LPA_MASK)
     219#define LPA_FROM_PADDR(paddr)  (lpa_t)(paddr & LPA_MASK)
    220220#define PADDR(cxy,lpa)         (((uint64_t)(cxy) << LPA_SHIFT) | (((uint64_t)(lpa)) & LPA_MASK))
    221221
Note: See TracChangeset for help on using the changeset viewer.