mirror of
https://github.com/apache/nuttx.git
synced 2026-06-04 14:53:47 +08:00
mm/kmap: Finalize kmap implementation for RISC-V
After this, RISC-V fully supports the kmap interface. Due to the current design limitations of having only a single L2 table per process, the kernel kmap area cannot be mapped via any user page directory, as they do not contain the page tables to address that range. So a "kernel address environment" is added, which can do the mapping. The mapping is reflected to every process as only the root page directory (L1) is copied to users, which means every change to L2 / L3 tables will be seen by every user.
This commit is contained in:
+7
-1
@@ -279,10 +279,16 @@ static void kmm_map_unlock(void)
|
||||
|
||||
void kmm_map_initialize(void)
|
||||
{
|
||||
/* Initialize the architecture specific part */
|
||||
|
||||
DEBUGVERIFY(up_addrenv_kmap_init());
|
||||
|
||||
/* Then, the local vmap */
|
||||
|
||||
g_kmm_map_vpages = gran_initialize((FAR void *)CONFIG_ARCH_KMAP_VBASE,
|
||||
CONFIG_ARCH_KMAP_NPAGES << MM_PGSHIFT,
|
||||
MM_PGSHIFT, MM_PGSHIFT);
|
||||
DEBUGVERIFY(g_kmm_map_vpages);
|
||||
DEBUGASSERT(g_kmm_map_vpages != NULL);
|
||||
mm_map_initialize(&g_kmm_map, true);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user