group/group_addrenv: Move address environment from group -> tcb

Detach the address environment handling from the group structure to the
tcb. This is preparation to fix rare cases where the system (MMU) is left
without a valid page directory, e.g. when a process exits.
This commit is contained in:
Ville Juven
2023-01-27 10:28:19 +02:00
committed by Xiang Xiao
parent ca95d592d3
commit 5713d85df0
34 changed files with 369 additions and 205 deletions
+3 -7
View File
@@ -239,18 +239,14 @@ int exec_module(FAR const struct binary_s *binp,
#endif
#ifdef CONFIG_ARCH_ADDRENV
/* Assign the address environment to the new task group */
/* Attach the address environment to the new task */
ret = up_addrenv_clone(&binp->addrenv, &tcb->cmn.group->tg_addrenv);
ret = addrenv_attach((FAR struct tcb_s *)tcb, &binp->addrenv);
if (ret < 0)
{
berr("ERROR: up_addrenv_clone() failed: %d\n", ret);
berr("ERROR: addrenv_attach() failed: %d\n", ret);
goto errout_with_tcbinit;
}
/* Mark that this group has an address environment */
tcb->cmn.group->tg_flags |= GROUP_FLAG_ADDRENV;
#endif
#ifdef CONFIG_BINFMT_CONSTRUCTORS