sched/addrenv: Miscellaneous clean-up and fixes

- Remove the temporary "saved" variable when temporarily changing MMU
  mappings to access another process's memory. The fact that it has an
  address environment is enough to make the choice
- Restore nxflat_addrenv_restore-macro. It was accidentally lost when
  the address environment handling was re-factored.
This commit is contained in:
Ville Juven
2023-04-13 13:37:20 +03:00
committed by Masayuki Ishikawa
parent 869aee6a78
commit b982c1747b
4 changed files with 22 additions and 13 deletions
+1 -4
View File
@@ -203,19 +203,16 @@ size_t up_check_tcbstack(struct tcb_s *tcb)
size_t size;
#ifdef CONFIG_ARCH_ADDRENV
bool saved = false;
if (tcb->addrenv_own != NULL)
{
addrenv_select(tcb->addrenv_own);
saved = true;
}
#endif
size = arm_stack_check(tcb->stack_base_ptr, tcb->adj_stack_size);
#ifdef CONFIG_ARCH_ADDRENV
if (saved)
if (tcb->addrenv_own != NULL)
{
addrenv_restore();
}
+1 -4
View File
@@ -159,12 +159,9 @@ size_t up_check_tcbstack(struct tcb_s *tcb)
size_t size;
#ifdef CONFIG_ARCH_ADDRENV
bool saved = false;
if (tcb->addrenv_own != NULL)
{
addrenv_select(tcb->addrenv_own);
saved = true;
}
#endif
@@ -172,7 +169,7 @@ size_t up_check_tcbstack(struct tcb_s *tcb)
tcb->adj_stack_size);
#ifdef CONFIG_ARCH_ADDRENV
if (saved)
if (tcb->addrenv_own != NULL)
{
addrenv_restore();
}