Changeset 2e9eae2 in mainline for genarch/src/mm/page_pt.c


Ignore:
Timestamp:
2006-06-23T16:03:53Z (19 years ago)
Author:
Ondrej Palkovsky <ondrap@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
757551a3
Parents:
a832dd7
Message:

Changed interface of frame_alloc/free to use address of frame instead of the pfn.
This makes it impossible to use >4GB of memory on 32-bit machines, but who cares…

File:
1 edited

Legend:

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

    ra832dd7 r2e9eae2  
    7272{
    7373        pte_t *ptl0, *ptl1, *ptl2, *ptl3;
    74         __address newpt;
     74        pte_t *newpt;
    7575
    7676        ptl0 = (pte_t *) PA2KA((__address) as->page_table);
    7777
    7878        if (GET_PTL1_FLAGS(ptl0, PTL0_INDEX(page)) & PAGE_NOT_PRESENT) {
    79                 newpt = PA2KA(PFN2ADDR(frame_alloc(ONE_FRAME, FRAME_KA)));
    80                 memsetb(newpt, PAGE_SIZE, 0);
     79                newpt = (pte_t *)frame_alloc(ONE_FRAME, FRAME_KA);
     80                memsetb((__address)newpt, PAGE_SIZE, 0);
    8181                SET_PTL1_ADDRESS(ptl0, PTL0_INDEX(page), KA2PA(newpt));
    8282                SET_PTL1_FLAGS(ptl0, PTL0_INDEX(page), PAGE_PRESENT | PAGE_USER | PAGE_EXEC | PAGE_CACHEABLE | PAGE_WRITE);
     
    8686
    8787        if (GET_PTL2_FLAGS(ptl1, PTL1_INDEX(page)) & PAGE_NOT_PRESENT) {
    88                 newpt = PA2KA(PFN2ADDR(frame_alloc(ONE_FRAME, FRAME_KA)));
    89                 memsetb(newpt, PAGE_SIZE, 0);
     88                newpt = (pte_t *)frame_alloc(ONE_FRAME, FRAME_KA);
     89                memsetb((__address)newpt, PAGE_SIZE, 0);
    9090                SET_PTL2_ADDRESS(ptl1, PTL1_INDEX(page), KA2PA(newpt));
    9191                SET_PTL2_FLAGS(ptl1, PTL1_INDEX(page), PAGE_PRESENT | PAGE_USER | PAGE_EXEC | PAGE_CACHEABLE | PAGE_WRITE);
     
    9595
    9696        if (GET_PTL3_FLAGS(ptl2, PTL2_INDEX(page)) & PAGE_NOT_PRESENT) {
    97                 newpt = PA2KA(PFN2ADDR(frame_alloc(ONE_FRAME, FRAME_KA)));
    98                 memsetb(newpt, PAGE_SIZE, 0);
     97                newpt = (pte_t *)frame_alloc(ONE_FRAME, FRAME_KA);
     98                memsetb((__address)newpt, PAGE_SIZE, 0);
    9999                SET_PTL3_ADDRESS(ptl2, PTL2_INDEX(page), KA2PA(newpt));
    100100                SET_PTL3_FLAGS(ptl2, PTL2_INDEX(page), PAGE_PRESENT | PAGE_USER | PAGE_EXEC | PAGE_CACHEABLE | PAGE_WRITE);
     
    166166                 * Release the frame and remove PTL3 pointer from preceding table.
    167167                 */
    168                 frame_free(ADDR2PFN(KA2PA((__address) ptl3)));
     168                frame_free(KA2PA((__address) ptl3));
    169169                if (PTL2_ENTRIES)
    170170                        memsetb((__address) &ptl2[PTL2_INDEX(page)], sizeof(pte_t), 0);
     
    195195                         * Release the frame and remove PTL2 pointer from preceding table.
    196196                         */
    197                         frame_free(ADDR2PFN(KA2PA((__address) ptl2)));
     197                        frame_free(KA2PA((__address) ptl2));
    198198                        if (PTL1_ENTRIES)
    199199                                memsetb((__address) &ptl1[PTL1_INDEX(page)], sizeof(pte_t), 0);
     
    224224                         * Release the frame and remove PTL1 pointer from preceding table.
    225225                         */
    226                         frame_free(ADDR2PFN(KA2PA((__address) ptl1)));
     226                        frame_free(KA2PA((__address) ptl1));
    227227                        memsetb((__address) &ptl0[PTL0_INDEX(page)], sizeof(pte_t), 0);
    228228                }
Note: See TracChangeset for help on using the changeset viewer.