Ignore:
Timestamp:
Jul 18, 2017, 10:29:58 AM (7 years ago)
Author:
max@…
Message:

Create a (virtual) copy of the local cluster in 0xffffe00000000000, and
make GET_PTR() point to it. This way we can use pointers from GET_PTR()
directly, instead of reconstructing a XPTR with local_cxy.

File:
1 edited

Legend:

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

    r150 r224  
    224224        XASSERT(kimg_size % PAGE_SIZE == 0);
    225225
    226         /* Create cluster0's page tree */
     226        /*
     227         * Create cluster0's page tree, enter the space, and unmap the area
     228         * below the kernel.
     229         */
    227230        hal_gpt_maptree_area(CLUSTER_MIN_VA(0), CLUSTER_MIN_VA(0) + CLUSTER_PA_SIZE);
    228 
    229         /* Enter cluster0's space */
    230231        hal_gpt_enter_range(CLUSTER_MIN_VA(0), 0, CLUSTER_PA_SIZE / PAGE_SIZE);
    231 
    232         /* Unmap the area below the kernel */
    233232        hal_gpt_leave_range(CLUSTER_MIN_VA(0), (KERNTEXTOFF - KERNBASE) / PAGE_SIZE);
     233
     234        /*
     235         * Do the same, but now in the local cluster map.
     236         */
     237        hal_gpt_maptree_area(LOCAL_CLUSTER_MIN_VA, LOCAL_CLUSTER_MIN_VA + CLUSTER_PA_SIZE);
     238        hal_gpt_enter_range(LOCAL_CLUSTER_MIN_VA, 0, CLUSTER_PA_SIZE / PAGE_SIZE);
     239        hal_gpt_leave_range(LOCAL_CLUSTER_MIN_VA, (KERNTEXTOFF - KERNBASE) / PAGE_SIZE);
    234240}
    235241
Note: See TracChangeset for help on using the changeset viewer.