mirror of
https://github.com/apache/nuttx.git
synced 2026-05-29 04:19:37 +08:00
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:
committed by
Masayuki Ishikawa
parent
869aee6a78
commit
b982c1747b
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user