Rev 793 | Rev 826 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 793 | Rev 814 | ||
---|---|---|---|
Line 63... | Line 63... | ||
63 | __address newpt; |
63 | __address newpt; |
64 | 64 | ||
65 | ptl0 = (pte_t *) PA2KA((__address) as->page_table); |
65 | ptl0 = (pte_t *) PA2KA((__address) as->page_table); |
66 | 66 | ||
67 | if (GET_PTL1_FLAGS(ptl0, PTL0_INDEX(page)) & PAGE_NOT_PRESENT) { |
67 | if (GET_PTL1_FLAGS(ptl0, PTL0_INDEX(page)) & PAGE_NOT_PRESENT) { |
68 | newpt = frame_alloc(ONE_FRAME, FRAME_KA); |
68 | newpt = PA2KA(PFN2ADDR(frame_alloc(ONE_FRAME, FRAME_KA))); |
69 | memsetb(newpt, PAGE_SIZE, 0); |
69 | memsetb(newpt, PAGE_SIZE, 0); |
70 | SET_PTL1_ADDRESS(ptl0, PTL0_INDEX(page), KA2PA(newpt)); |
70 | SET_PTL1_ADDRESS(ptl0, PTL0_INDEX(page), KA2PA(newpt)); |
71 | SET_PTL1_FLAGS(ptl0, PTL0_INDEX(page), PAGE_PRESENT | PAGE_USER | PAGE_EXEC | PAGE_CACHEABLE | PAGE_WRITE); |
71 | SET_PTL1_FLAGS(ptl0, PTL0_INDEX(page), PAGE_PRESENT | PAGE_USER | PAGE_EXEC | PAGE_CACHEABLE | PAGE_WRITE); |
72 | } |
72 | } |
73 | 73 | ||
74 | ptl1 = (pte_t *) PA2KA(GET_PTL1_ADDRESS(ptl0, PTL0_INDEX(page))); |
74 | ptl1 = (pte_t *) PA2KA(GET_PTL1_ADDRESS(ptl0, PTL0_INDEX(page))); |
75 | 75 | ||
76 | if (GET_PTL2_FLAGS(ptl1, PTL1_INDEX(page)) & PAGE_NOT_PRESENT) { |
76 | if (GET_PTL2_FLAGS(ptl1, PTL1_INDEX(page)) & PAGE_NOT_PRESENT) { |
77 | newpt = frame_alloc(ONE_FRAME, FRAME_KA); |
77 | newpt = PA2KA(PFN2ADDR(frame_alloc(ONE_FRAME, FRAME_KA))); |
78 | memsetb(newpt, PAGE_SIZE, 0); |
78 | memsetb(newpt, PAGE_SIZE, 0); |
79 | SET_PTL2_ADDRESS(ptl1, PTL1_INDEX(page), KA2PA(newpt)); |
79 | SET_PTL2_ADDRESS(ptl1, PTL1_INDEX(page), KA2PA(newpt)); |
80 | SET_PTL2_FLAGS(ptl1, PTL1_INDEX(page), PAGE_PRESENT | PAGE_USER | PAGE_EXEC | PAGE_CACHEABLE | PAGE_WRITE); |
80 | SET_PTL2_FLAGS(ptl1, PTL1_INDEX(page), PAGE_PRESENT | PAGE_USER | PAGE_EXEC | PAGE_CACHEABLE | PAGE_WRITE); |
81 | } |
81 | } |
82 | 82 | ||
83 | ptl2 = (pte_t *) PA2KA(GET_PTL2_ADDRESS(ptl1, PTL1_INDEX(page))); |
83 | ptl2 = (pte_t *) PA2KA(GET_PTL2_ADDRESS(ptl1, PTL1_INDEX(page))); |
84 | 84 | ||
85 | if (GET_PTL3_FLAGS(ptl2, PTL2_INDEX(page)) & PAGE_NOT_PRESENT) { |
85 | if (GET_PTL3_FLAGS(ptl2, PTL2_INDEX(page)) & PAGE_NOT_PRESENT) { |
86 | newpt = frame_alloc(ONE_FRAME, FRAME_KA); |
86 | newpt = PA2KA(PFN2ADDR(frame_alloc(ONE_FRAME, FRAME_KA))); |
87 | memsetb(newpt, PAGE_SIZE, 0); |
87 | memsetb(newpt, PAGE_SIZE, 0); |
88 | SET_PTL3_ADDRESS(ptl2, PTL2_INDEX(page), KA2PA(newpt)); |
88 | SET_PTL3_ADDRESS(ptl2, PTL2_INDEX(page), KA2PA(newpt)); |
89 | SET_PTL3_FLAGS(ptl2, PTL2_INDEX(page), PAGE_PRESENT | PAGE_USER | PAGE_EXEC | PAGE_CACHEABLE | PAGE_WRITE); |
89 | SET_PTL3_FLAGS(ptl2, PTL2_INDEX(page), PAGE_PRESENT | PAGE_USER | PAGE_EXEC | PAGE_CACHEABLE | PAGE_WRITE); |
90 | } |
90 | } |
91 | 91 |