mirror of
https://github.com/apache/nuttx.git
synced 2026-06-07 17:33:08 +08:00
kmm_map.c: Fix user page mapping
User pages are mapped from the currently active address environment. If the process is running on a borrowed address environment, then the mapping should be created from there. This happens during (new) process creation only.
This commit is contained in:
committed by
Petro Karashchenko
parent
b2f9926a1b
commit
a444435f8b
+2
-2
@@ -82,7 +82,7 @@ static int get_user_pages(FAR void **pages, size_t npages, uintptr_t vaddr)
|
||||
|
||||
for (i = 0; i < npages; i++, vaddr += MM_PGSIZE)
|
||||
{
|
||||
page = up_addrenv_find_page(&tcb->addrenv_own->addrenv, vaddr);
|
||||
page = up_addrenv_find_page(&tcb->addrenv_curr->addrenv, vaddr);
|
||||
if (!page)
|
||||
{
|
||||
/* Something went wrong, get out */
|
||||
@@ -182,7 +182,7 @@ static FAR void *map_single_user_page(uintptr_t vaddr)
|
||||
|
||||
/* Find the page associated with this virtual address */
|
||||
|
||||
page = up_addrenv_find_page(&tcb->addrenv_own->addrenv, vaddr);
|
||||
page = up_addrenv_find_page(&tcb->addrenv_curr->addrenv, vaddr);
|
||||
if (!page)
|
||||
{
|
||||
return NULL;
|
||||
|
||||
Reference in New Issue
Block a user