Changeset 148 for trunk


Ignore:
Timestamp:
Jul 5, 2017, 3:14:43 PM (7 years ago)
Author:
max@…
Message:

fix a pretty dumb bug; we must not unmap since we use the area for
cluster0's virtual space

File:
1 edited

Legend:

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

    r147 r148  
    6363void hal_gpt_bootstrap_reset()
    6464{
    65         size_t npages = (va_avail - (CLUSTER_MIN_VA(0) + KERNEL_VA_SIZE)) / PAGE_SIZE;
    66         hal_gpt_leave_range(CLUSTER_MIN_VA(0) + KERNEL_VA_SIZE, npages);
     65        /*
     66         * Re-enter cluster0's space, because we altered it when mapping the ACPI
     67         * tables.
     68         */
     69        hal_gpt_enter_range(CLUSTER_MIN_VA(0), 0, CLUSTER_PA_SIZE / PAGE_SIZE);
     70
    6771        va_avail = CLUSTER_MIN_VA(0) + KERNEL_VA_SIZE;
    6872}
     
    124128 * enter these addresses to physical locations.
    125129 *
    126  * This functions is a bit complicated, and may need to be revisited.
     130 * This function is a bit complicated, and may need to be revisited.
    127131 */
    128132void hal_gpt_maptree_area(vaddr_t va_start, vaddr_t va_end)
     
    226230
    227231        /* Create cluster0's page tree */
    228         hal_gpt_maptree_area(CLUSTER_MIN_VA(0), CLUSTER_MAX_VA(0));
    229 
    230         /* Manually enter cluster0's kimg */
    231         hal_gpt_enter_range(CLUSTER_MIN_VA(0), kimg_min_pa, kimg_size / PAGE_SIZE);
    232 
    233         /* Manually enter cluster0's heap */
    234         hal_gpt_enter_range(CLUSTER_MIN_VA(0) + kimg_size, kimg_max_pa,
    235             (CLUSTER_VA_SIZE - kimg_size) / PAGE_SIZE);
     232        hal_gpt_maptree_area(CLUSTER_MIN_VA(0), CLUSTER_MIN_VA(0) + CLUSTER_PA_SIZE);
     233
     234        /* Enter cluster0's space */
     235        hal_gpt_enter_range(CLUSTER_MIN_VA(0), 0, CLUSTER_PA_SIZE / PAGE_SIZE);
    236236
    237237        /* Unmap the area below the kernel */
Note: See TracChangeset for help on using the changeset viewer.