Subversion Repositories HelenOS-historic

Compare Revisions

Ignore whitespace Rev 1759 → Rev 1760

/kernel/trunk/genarch/src/fb/fb.c
394,10 → 394,8
else
order = fnzb(pages-1)+1;
 
pfn_t frame = frame_alloc_rc(order,FRAME_ATOMIC,&rc);
if (!rc)
dbbuffer = (void *)PA2KA(PFN2ADDR(frame));
else
dbbuffer = frame_alloc_rc(order,FRAME_ATOMIC | FRAME_KA, &rc);
if (!dbbuffer)
printf("Failed to allocate scroll buffer.\n");
dboffset = 0;
 
/kernel/trunk/genarch/src/mm/page_pt.c
71,13 → 71,13
void pt_mapping_insert(as_t *as, __address page, __address frame, int flags)
{
pte_t *ptl0, *ptl1, *ptl2, *ptl3;
__address newpt;
pte_t *newpt;
 
ptl0 = (pte_t *) PA2KA((__address) as->page_table);
 
if (GET_PTL1_FLAGS(ptl0, PTL0_INDEX(page)) & PAGE_NOT_PRESENT) {
newpt = PA2KA(PFN2ADDR(frame_alloc(ONE_FRAME, FRAME_KA)));
memsetb(newpt, PAGE_SIZE, 0);
newpt = (pte_t *)frame_alloc(ONE_FRAME, FRAME_KA);
memsetb((__address)newpt, PAGE_SIZE, 0);
SET_PTL1_ADDRESS(ptl0, PTL0_INDEX(page), KA2PA(newpt));
SET_PTL1_FLAGS(ptl0, PTL0_INDEX(page), PAGE_PRESENT | PAGE_USER | PAGE_EXEC | PAGE_CACHEABLE | PAGE_WRITE);
}
85,8 → 85,8
ptl1 = (pte_t *) PA2KA(GET_PTL1_ADDRESS(ptl0, PTL0_INDEX(page)));
 
if (GET_PTL2_FLAGS(ptl1, PTL1_INDEX(page)) & PAGE_NOT_PRESENT) {
newpt = PA2KA(PFN2ADDR(frame_alloc(ONE_FRAME, FRAME_KA)));
memsetb(newpt, PAGE_SIZE, 0);
newpt = (pte_t *)frame_alloc(ONE_FRAME, FRAME_KA);
memsetb((__address)newpt, PAGE_SIZE, 0);
SET_PTL2_ADDRESS(ptl1, PTL1_INDEX(page), KA2PA(newpt));
SET_PTL2_FLAGS(ptl1, PTL1_INDEX(page), PAGE_PRESENT | PAGE_USER | PAGE_EXEC | PAGE_CACHEABLE | PAGE_WRITE);
}
94,8 → 94,8
ptl2 = (pte_t *) PA2KA(GET_PTL2_ADDRESS(ptl1, PTL1_INDEX(page)));
 
if (GET_PTL3_FLAGS(ptl2, PTL2_INDEX(page)) & PAGE_NOT_PRESENT) {
newpt = PA2KA(PFN2ADDR(frame_alloc(ONE_FRAME, FRAME_KA)));
memsetb(newpt, PAGE_SIZE, 0);
newpt = (pte_t *)frame_alloc(ONE_FRAME, FRAME_KA);
memsetb((__address)newpt, PAGE_SIZE, 0);
SET_PTL3_ADDRESS(ptl2, PTL2_INDEX(page), KA2PA(newpt));
SET_PTL3_FLAGS(ptl2, PTL2_INDEX(page), PAGE_PRESENT | PAGE_USER | PAGE_EXEC | PAGE_CACHEABLE | PAGE_WRITE);
}
165,7 → 165,7
* PTL3 is empty.
* Release the frame and remove PTL3 pointer from preceding table.
*/
frame_free(ADDR2PFN(KA2PA((__address) ptl3)));
frame_free(KA2PA((__address) ptl3));
if (PTL2_ENTRIES)
memsetb((__address) &ptl2[PTL2_INDEX(page)], sizeof(pte_t), 0);
else if (PTL1_ENTRIES)
194,7 → 194,7
* PTL2 is empty.
* Release the frame and remove PTL2 pointer from preceding table.
*/
frame_free(ADDR2PFN(KA2PA((__address) ptl2)));
frame_free(KA2PA((__address) ptl2));
if (PTL1_ENTRIES)
memsetb((__address) &ptl1[PTL1_INDEX(page)], sizeof(pte_t), 0);
else
223,7 → 223,7
* PTL1 is empty.
* Release the frame and remove PTL1 pointer from preceding table.
*/
frame_free(ADDR2PFN(KA2PA((__address) ptl1)));
frame_free(KA2PA((__address) ptl1));
memsetb((__address) &ptl0[PTL0_INDEX(page)], sizeof(pte_t), 0);
}
}
/kernel/trunk/genarch/src/mm/as_pt.c
73,7 → 73,7
pte_t *src_ptl0, *dst_ptl0;
ipl_t ipl;
 
dst_ptl0 = (pte_t *) PA2KA(PFN2ADDR(frame_alloc(ONE_FRAME, FRAME_KA | FRAME_PANIC)));
dst_ptl0 = (pte_t *) frame_alloc(ONE_FRAME, FRAME_KA | FRAME_PANIC);
 
if (flags & FLAG_AS_KERNEL) {
memsetb((__address) dst_ptl0, PAGE_SIZE, 0);
108,7 → 108,7
*/
void ptl0_destroy(pte_t *page_table)
{
frame_free(ADDR2PFN((__address) page_table));
frame_free((__address)page_table);
}
 
/** Lock page tables.