You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by ma...@apache.org on 2023/08/11 04:10:11 UTC

[nuttx] 01/01: Revert "sim: Fix sim stack smashing problem"

This is an automated email from the ASF dual-hosted git repository.

masayuki pushed a commit to branch revert-10128-master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit 99385996a187d04cc8850b75783e5187ade7f787
Author: Masayuki Ishikawa <ma...@gmail.com>
AuthorDate: Fri Aug 11 13:10:05 2023 +0900

    Revert "sim: Fix sim stack smashing problem"
    
    This reverts commit 6d6e1aea3b13b56f8f815355951287290f1e274d.
---
 arch/sim/src/sim/sim_initialstate.c | 24 +-----------------------
 1 file changed, 1 insertion(+), 23 deletions(-)

diff --git a/arch/sim/src/sim/sim_initialstate.c b/arch/sim/src/sim/sim_initialstate.c
index 76d967d28f..6b3f6968df 100644
--- a/arch/sim/src/sim/sim_initialstate.c
+++ b/arch/sim/src/sim/sim_initialstate.c
@@ -32,26 +32,8 @@
 
 #include <nuttx/arch.h>
 
-#include "sched/sched.h"
 #include "sim_internal.h"
 
-/****************************************************************************
- * Private Functions
- ****************************************************************************/
-
-static void pre_start(void)
-{
-  struct tcb_s *tcb = this_task();
-
-  /* Enable signal delivery */
-
-  up_irq_restore(0);
-
-  /* Then call the real start function */
-
-  tcb->start();
-}
-
 /****************************************************************************
  * Public Functions
  ****************************************************************************/
@@ -111,11 +93,7 @@ void up_initial_state(struct tcb_s *tcb)
 #endif
                                    + tcb->adj_stack_size;
 
-  /* Mask the interrupt until switching to the new task */
-
-  memset(&tcb->xcp.regs[JB_FLAG], 0xff, sizeof(xcpt_reg_t) * 2);
-
-  tcb->xcp.regs[JB_PC] = (xcpt_reg_t)pre_start;
+  tcb->xcp.regs[JB_PC] = (xcpt_reg_t)tcb->start;
 
 #ifdef CONFIG_SIM_ASAN
   __asan_unpoison_memory_region(tcb->stack_alloc_ptr, tcb->adj_stack_size);