Subversion Repositories HelenOS-historic

Rev

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

Rev 687 Rev 689
Line 61... Line 61...
61
    __address newpt;
61
    __address newpt;
62
 
62
 
63
    ptl0 = (pte_t *) PA2KA(root ? root : (__address) GET_PTL0_ADDRESS());
63
    ptl0 = (pte_t *) PA2KA(root ? root : (__address) GET_PTL0_ADDRESS());
64
 
64
 
65
    if (GET_PTL1_FLAGS(ptl0, PTL0_INDEX(page)) & PAGE_NOT_PRESENT) {
65
    if (GET_PTL1_FLAGS(ptl0, PTL0_INDEX(page)) & PAGE_NOT_PRESENT) {
66
        newpt = frame_alloc(FRAME_KA, ONE_FRAME);
66
        newpt = frame_alloc(FRAME_KA, ONE_FRAME, NULL);
67
        memsetb(newpt, PAGE_SIZE, 0);
67
        memsetb(newpt, PAGE_SIZE, 0);
68
        SET_PTL1_ADDRESS(ptl0, PTL0_INDEX(page), KA2PA(newpt));
68
        SET_PTL1_ADDRESS(ptl0, PTL0_INDEX(page), KA2PA(newpt));
69
        SET_PTL1_FLAGS(ptl0, PTL0_INDEX(page), PAGE_PRESENT | PAGE_USER | PAGE_EXEC | PAGE_CACHEABLE | PAGE_WRITE);
69
        SET_PTL1_FLAGS(ptl0, PTL0_INDEX(page), PAGE_PRESENT | PAGE_USER | PAGE_EXEC | PAGE_CACHEABLE | PAGE_WRITE);
70
    }
70
    }
71
 
71
 
72
    ptl1 = (pte_t *) PA2KA(GET_PTL1_ADDRESS(ptl0, PTL0_INDEX(page)));
72
    ptl1 = (pte_t *) PA2KA(GET_PTL1_ADDRESS(ptl0, PTL0_INDEX(page)));
73
 
73
 
74
    if (GET_PTL2_FLAGS(ptl1, PTL1_INDEX(page)) & PAGE_NOT_PRESENT) {
74
    if (GET_PTL2_FLAGS(ptl1, PTL1_INDEX(page)) & PAGE_NOT_PRESENT) {
75
        newpt = frame_alloc(FRAME_KA, ONE_FRAME);
75
        newpt = frame_alloc(FRAME_KA, ONE_FRAME, NULL);
76
        memsetb(newpt, PAGE_SIZE, 0);
76
        memsetb(newpt, PAGE_SIZE, 0);
77
        SET_PTL2_ADDRESS(ptl1, PTL1_INDEX(page), KA2PA(newpt));
77
        SET_PTL2_ADDRESS(ptl1, PTL1_INDEX(page), KA2PA(newpt));
78
        SET_PTL2_FLAGS(ptl1, PTL1_INDEX(page), PAGE_PRESENT | PAGE_USER | PAGE_EXEC | PAGE_CACHEABLE | PAGE_WRITE);
78
        SET_PTL2_FLAGS(ptl1, PTL1_INDEX(page), PAGE_PRESENT | PAGE_USER | PAGE_EXEC | PAGE_CACHEABLE | PAGE_WRITE);
79
    }
79
    }
80
 
80
 
81
    ptl2 = (pte_t *) PA2KA(GET_PTL2_ADDRESS(ptl1, PTL1_INDEX(page)));
81
    ptl2 = (pte_t *) PA2KA(GET_PTL2_ADDRESS(ptl1, PTL1_INDEX(page)));
82
 
82
 
83
    if (GET_PTL3_FLAGS(ptl2, PTL2_INDEX(page)) & PAGE_NOT_PRESENT) {
83
    if (GET_PTL3_FLAGS(ptl2, PTL2_INDEX(page)) & PAGE_NOT_PRESENT) {
84
        newpt = frame_alloc(FRAME_KA, ONE_FRAME);
84
        newpt = frame_alloc(FRAME_KA, ONE_FRAME, NULL);
85
        memsetb(newpt, PAGE_SIZE, 0);
85
        memsetb(newpt, PAGE_SIZE, 0);
86
        SET_PTL3_ADDRESS(ptl2, PTL2_INDEX(page), KA2PA(newpt));
86
        SET_PTL3_ADDRESS(ptl2, PTL2_INDEX(page), KA2PA(newpt));
87
        SET_PTL3_FLAGS(ptl2, PTL2_INDEX(page), PAGE_PRESENT | PAGE_USER | PAGE_EXEC | PAGE_CACHEABLE | PAGE_WRITE);
87
        SET_PTL3_FLAGS(ptl2, PTL2_INDEX(page), PAGE_PRESENT | PAGE_USER | PAGE_EXEC | PAGE_CACHEABLE | PAGE_WRITE);
88
    }
88
    }
89
 
89