Subversion Repositories HelenOS

Rev

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

Rev 2089 Rev 2106
Line 70... Line 70...
70
void pt_mapping_insert(as_t *as, uintptr_t page, uintptr_t frame, int flags)
70
void pt_mapping_insert(as_t *as, uintptr_t page, uintptr_t frame, int flags)
71
{
71
{
72
    pte_t *ptl0, *ptl1, *ptl2, *ptl3;
72
    pte_t *ptl0, *ptl1, *ptl2, *ptl3;
73
    pte_t *newpt;
73
    pte_t *newpt;
74
 
74
 
75
    ptl0 = (pte_t *) PA2KA((uintptr_t) as->page_table);
75
    ptl0 = (pte_t *) PA2KA((uintptr_t) as->genarch.page_table);
76
 
76
 
77
    if (GET_PTL1_FLAGS(ptl0, PTL0_INDEX(page)) & PAGE_NOT_PRESENT) {
77
    if (GET_PTL1_FLAGS(ptl0, PTL0_INDEX(page)) & PAGE_NOT_PRESENT) {
78
        newpt = (pte_t *)frame_alloc(ONE_FRAME, FRAME_KA);
78
        newpt = (pte_t *)frame_alloc(ONE_FRAME, FRAME_KA);
79
        memsetb((uintptr_t)newpt, PAGE_SIZE, 0);
79
        memsetb((uintptr_t)newpt, PAGE_SIZE, 0);
80
        SET_PTL1_ADDRESS(ptl0, PTL0_INDEX(page), KA2PA(newpt));
80
        SET_PTL1_ADDRESS(ptl0, PTL0_INDEX(page), KA2PA(newpt));
Line 126... Line 126...
126
 
126
 
127
    /*
127
    /*
128
     * First, remove the mapping, if it exists.
128
     * First, remove the mapping, if it exists.
129
     */
129
     */
130
 
130
 
131
    ptl0 = (pte_t *) PA2KA((uintptr_t) as->page_table);
131
    ptl0 = (pte_t *) PA2KA((uintptr_t) as->genarch.page_table);
132
 
132
 
133
    if (GET_PTL1_FLAGS(ptl0, PTL0_INDEX(page)) & PAGE_NOT_PRESENT)
133
    if (GET_PTL1_FLAGS(ptl0, PTL0_INDEX(page)) & PAGE_NOT_PRESENT)
134
        return;
134
        return;
135
 
135
 
136
    ptl1 = (pte_t *) PA2KA(GET_PTL1_ADDRESS(ptl0, PTL0_INDEX(page)));
136
    ptl1 = (pte_t *) PA2KA(GET_PTL1_ADDRESS(ptl0, PTL0_INDEX(page)));
Line 242... Line 242...
242
 */
242
 */
243
pte_t *pt_mapping_find(as_t *as, uintptr_t page)
243
pte_t *pt_mapping_find(as_t *as, uintptr_t page)
244
{
244
{
245
    pte_t *ptl0, *ptl1, *ptl2, *ptl3;
245
    pte_t *ptl0, *ptl1, *ptl2, *ptl3;
246
 
246
 
247
    ptl0 = (pte_t *) PA2KA((uintptr_t) as->page_table);
247
    ptl0 = (pte_t *) PA2KA((uintptr_t) as->genarch.page_table);
248
 
248
 
249
    if (GET_PTL1_FLAGS(ptl0, PTL0_INDEX(page)) & PAGE_NOT_PRESENT)
249
    if (GET_PTL1_FLAGS(ptl0, PTL0_INDEX(page)) & PAGE_NOT_PRESENT)
250
        return NULL;
250
        return NULL;
251
 
251
 
252
    ptl1 = (pte_t *) PA2KA(GET_PTL1_ADDRESS(ptl0, PTL0_INDEX(page)));
252
    ptl1 = (pte_t *) PA2KA(GET_PTL1_ADDRESS(ptl0, PTL0_INDEX(page)));