mirror of
https://github.com/drasko/codezero.git
synced 2026-09-25 14:50:21 +02:00
Brought mm0 initialization up to init_execve()
Changes: It is now possible to use do_mmap() from within mm0. - pager_new_virtual()/delete_virtual() return addresses that are disjoint from find_unmapped_area() used by mmap() interface for anonymous or not-fixed areas. - find_unmapped_area() now uses task->map_start task->map_end instead of task->start and task->end. task->start/end are still valid task space addresses for mmap(), but finding a new address is limited to map_start/map_end. - We have both interfaces because mmap() is only useful for backed-files. When the pager needs to access a user memory range for example, that is not backed by a file and thus we need to use pager_new_virtual() instead of mmap() for mapping.
This commit is contained in:
+17
-11
@@ -40,21 +40,27 @@ static struct pager_virtual_address_id_pool {
|
||||
.bitlimit = ADDRESS_POOL_256MB * 32,
|
||||
};
|
||||
|
||||
/* For supplying contiguous virtual addresses to pager */
|
||||
/* For supplying contiguous virtual addresses to pager
|
||||
*
|
||||
* MM0:
|
||||
* task->start
|
||||
* Text
|
||||
* Data
|
||||
* Bss
|
||||
* Stack
|
||||
* mmap area start
|
||||
* mmap area end
|
||||
*
|
||||
* pager address pool
|
||||
*
|
||||
* task->end
|
||||
*/
|
||||
int pager_address_pool_init(void)
|
||||
{
|
||||
/*
|
||||
* Initialise id pool for pager virtual address
|
||||
* allocation. This spans from end of pager image
|
||||
* until the end of the virtual address range
|
||||
* allocated for the pager
|
||||
*/
|
||||
address_pool_init_with_idpool(&pager_vaddr_pool,
|
||||
address_pool_init_with_idpool(&pager_vaddr_pool,
|
||||
(struct id_pool *)
|
||||
&pager_virtual_address_id_pool,
|
||||
page_align_up((unsigned long)__end + PAGE_SIZE),
|
||||
/* FIXME: Fix this! Same as mm0's map_start and map_end */
|
||||
(unsigned long)0xF0000000);
|
||||
PAGER_MMAP_END, 0xF0000000);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user