Changeset 112


Ignore:
Timestamp:
Jun 30, 2017, 10:47:08 AM (7 years ago)
Author:
max@…
Message:

In fact, we need to enter all of the VA space, because we massively
make this assumption later. The thing is, also need to keep the
same offset for the PA and VA, so it needs to be rethought. Until
then, add a commented code.

File:
1 edited

Legend:

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

    r83 r112  
    117117void hal_gpt_maptree_area(vaddr_t va_start, vaddr_t va_end)
    118118{
    119         pt_entry_t flags = PG_V| PG_KW | PG_NX;
     119        pt_entry_t flags = PG_V | PG_KW | PG_NX;
    120120        size_t L4start, L4end, nL4e;
    121121        size_t L3start, L3end, nL3e;
     
    203203void hal_gpt_init(paddr_t firstpa)
    204204{
    205         paddr_t kimg_min_pa = 0;
     205        paddr_t kimg_min_pa, kimg_max_pa;
    206206
    207207        /* Initialize global values */
     
    210210        kimg_size = ((uint64_t)&__kernel_end - KERNBASE);
    211211        XASSERT(kimg_size % PAGE_SIZE == 0);
    212         kimg_size = kimg_size / PAGE_SIZE;
     212
     213        kimg_min_pa = 0;
     214        kimg_max_pa = kimg_min_pa + kimg_size;
    213215
    214216        /* Create cluster0's heap entry. */
     
    216218
    217219        /* Manually enter cluster0's kimg */
    218         hal_gpt_enter_range(CLUSTER_MIN_VA(0), kimg_min_pa, kimg_size);
     220        hal_gpt_enter_range(CLUSTER_MIN_VA(0), kimg_min_pa, kimg_size / PAGE_SIZE);
     221
     222        /* Manually enter cluster0's heap */
     223/*
     224        hal_gpt_enter_range(CLUSTER_MIN_VA(0) + kimg_size, kimg_max_pa,
     225            (CLUSTER_VA_SIZE - kimg_size) / PAGE_SIZE);
     226*/
    219227}
    220228
Note: See TracChangeset for help on using the changeset viewer.