Changeset 6b326ea1 in mainline for kernel/genarch/src/mm/page_pt.c


Ignore:
Timestamp:
2011-11-17T13:51:41Z (13 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
a55ddc64
Parents:
9d4e170
Message:

Allocate page tables from low memory so that it will be still possible
to use PA2KA when walking it.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/genarch/src/mm/page_pt.c

    r9d4e170 r6b326ea1  
    7575       
    7676        if (GET_PTL1_FLAGS(ptl0, PTL0_INDEX(page)) & PAGE_NOT_PRESENT) {
    77                 pte_t *newpt = (pte_t *) frame_alloc(PTL1_SIZE, FRAME_KA);
     77                pte_t *newpt = (pte_t *) frame_alloc(PTL1_SIZE,
     78                    FRAME_LOWMEM | FRAME_KA);
    7879                memsetb(newpt, FRAME_SIZE << PTL1_SIZE, 0);
    7980                SET_PTL1_ADDRESS(ptl0, PTL0_INDEX(page), KA2PA(newpt));
    80                 SET_PTL1_FLAGS(ptl0, PTL0_INDEX(page), PAGE_PRESENT | PAGE_USER | PAGE_EXEC | PAGE_CACHEABLE | PAGE_WRITE);
     81                SET_PTL1_FLAGS(ptl0, PTL0_INDEX(page),
     82                    PAGE_PRESENT | PAGE_USER | PAGE_EXEC | PAGE_CACHEABLE |
     83                    PAGE_WRITE);
    8184        }
    8285       
     
    8487       
    8588        if (GET_PTL2_FLAGS(ptl1, PTL1_INDEX(page)) & PAGE_NOT_PRESENT) {
    86                 pte_t *newpt = (pte_t *) frame_alloc(PTL2_SIZE, FRAME_KA);
     89                pte_t *newpt = (pte_t *) frame_alloc(PTL2_SIZE,
     90                    FRAME_LOWMEM | FRAME_KA);
    8791                memsetb(newpt, FRAME_SIZE << PTL2_SIZE, 0);
    8892                SET_PTL2_ADDRESS(ptl1, PTL1_INDEX(page), KA2PA(newpt));
    89                 SET_PTL2_FLAGS(ptl1, PTL1_INDEX(page), PAGE_PRESENT | PAGE_USER | PAGE_EXEC | PAGE_CACHEABLE | PAGE_WRITE);
     93                SET_PTL2_FLAGS(ptl1, PTL1_INDEX(page),
     94                    PAGE_PRESENT | PAGE_USER | PAGE_EXEC | PAGE_CACHEABLE |
     95                    PAGE_WRITE);
    9096        }
    9197       
     
    9399       
    94100        if (GET_PTL3_FLAGS(ptl2, PTL2_INDEX(page)) & PAGE_NOT_PRESENT) {
    95                 pte_t *newpt = (pte_t *) frame_alloc(PTL3_SIZE, FRAME_KA);
     101                pte_t *newpt = (pte_t *) frame_alloc(PTL3_SIZE,
     102                    FRAME_LOWMEM | FRAME_KA);
    96103                memsetb(newpt, FRAME_SIZE << PTL3_SIZE, 0);
    97104                SET_PTL3_ADDRESS(ptl2, PTL2_INDEX(page), KA2PA(newpt));
    98                 SET_PTL3_FLAGS(ptl2, PTL2_INDEX(page), PAGE_PRESENT | PAGE_USER | PAGE_EXEC | PAGE_CACHEABLE | PAGE_WRITE);
     105                SET_PTL3_FLAGS(ptl2, PTL2_INDEX(page),
     106                    PAGE_PRESENT | PAGE_USER | PAGE_EXEC | PAGE_CACHEABLE |
     107                    PAGE_WRITE);
    99108        }
    100109       
Note: See TracChangeset for help on using the changeset viewer.