Subversion Repositories HelenOS-historic

Rev

Rev 167 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 167 Rev 168
Line 56... Line 56...
56
 
56
 
57
        /*
57
        /*
58
         * Each vm_t is supposed to have its own page table.
58
         * Each vm_t is supposed to have its own page table.
59
         * It is either passed one or it has to allocate and set one up.
59
         * It is either passed one or it has to allocate and set one up.
60
         */
60
         */
-
 
61
        m->ptl0 = ptl0;
61
        if (!(m->ptl0 = ptl0)) {
62
        if (!m->ptl0) {
62
            pte_t *src_ptl0, *dst_ptl0;
63
            pte_t *src_ptl0, *dst_ptl0;
63
       
64
       
64
            src_ptl0 = (pte_t *) PA2KA(GET_PTL0_ADDRESS());
65
            src_ptl0 = (pte_t *) PA2KA((__address) GET_PTL0_ADDRESS());
65
            dst_ptl0 = (pte_t *) frame_alloc(FRAME_KA | FRAME_PANIC);
66
            dst_ptl0 = (pte_t *) frame_alloc(FRAME_KA | FRAME_PANIC);
66
            memsetb((__address) dst_ptl0, PAGE_SIZE, 0);
67
//          memsetb((__address) dst_ptl0, PAGE_SIZE, 0);
67
            memcopy((__address) &src_ptl0[KAS_START_INDEX], (__address) &dst_ptl0[KAS_START_INDEX], KAS_INDICES*sizeof(pte_t));
68
//          memcopy((__address) &src_ptl0[KAS_START_INDEX], (__address) &dst_ptl0[KAS_START_INDEX], KAS_INDICES*sizeof(pte_t));
-
 
69
            memcopy(PA2KA((__address) GET_PTL0_ADDRESS()), (__address) dst_ptl0, PAGE_SIZE);
68
            m->ptl0 = (pte_t *) KA2PA(dst_ptl0);
70
            m->ptl0 = (pte_t *) KA2PA((__address) dst_ptl0);
69
        }
71
        }
70
    }
72
    }
71
   
73
 
72
    return m;
74
    return m;
73
}
75
}