Subversion Repositories HelenOS-historic

Compare Revisions

Ignore whitespace Rev 756 → Rev 755

/kernel/trunk/generic/src/mm/page.c
48,6 → 48,7
void page_init(void)
{
page_arch_init();
page_mapping_insert(AS_KERNEL, 0x0, 0x0, PAGE_NOT_PRESENT, 0);
}
 
/** Map memory structure
67,7 → 68,7
cnt = length/PAGE_SIZE + (length%PAGE_SIZE>0);
 
for (i = 0; i < cnt; i++)
page_mapping_insert(AS_KERNEL, s + i*PAGE_SIZE, s + i*PAGE_SIZE, PAGE_NOT_CACHEABLE);
page_mapping_insert(AS_KERNEL, s + i*PAGE_SIZE, s + i*PAGE_SIZE, PAGE_NOT_CACHEABLE, 0);
 
}
 
76,19 → 77,18
* Map virtual address 'page' to physical address 'frame'
* using 'flags'. Allocate and setup any missing page tables.
*
* The address space must be locked and interrupts must be disabled.
*
* @param as Address space to wich page belongs..
* @param as Address space to wich page belongs. Must be locked prior the call.
* @param page Virtual address of the page to be mapped.
* @param frame Physical address of memory frame to which the mapping is done.
* @param flags Flags to be used for mapping.
* @param root Explicit PTL0 address.
*/
void page_mapping_insert(as_t *as, __address page, __address frame, int flags)
void page_mapping_insert(as_t *as, __address page, __address frame, int flags, __address root)
{
ASSERT(page_operations);
ASSERT(page_operations->mapping_insert);
page_operations->mapping_insert(as, page, frame, flags);
page_operations->mapping_insert(as, page, frame, flags, root);
}
 
/** Find mapping for virtual page
95,17 → 95,16
*
* Find mapping for virtual page.
*
* The address space must be locked and interrupts must be disabled.
*
* @param as Address space to wich page belongs.
* @param as Address space to wich page belongs must be locked prior the call.
* @param page Virtual page.
* @param root PTL0 address if non-zero.
*
* @return NULL if there is no such mapping; requested mapping otherwise.
*/
pte_t *page_mapping_find(as_t *as, __address page)
pte_t *page_mapping_find(as_t *as, __address page, __address root)
{
ASSERT(page_operations);
ASSERT(page_operations->mapping_find);
 
return page_operations->mapping_find(as, page);
return page_operations->mapping_find(as, page, root);
}