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

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit 55822753befa042392db87a7a30185a6a0caa2c9
Author: buxiasen <[email protected]>
AuthorDate: Wed Dec 4 18:20:20 2024 +0800

    arm-v6/7/8m: sigaction should use running_task
    
    Nested irq possible cause readytorun not match with regs
    
    Signed-off-by: buxiasen <[email protected]>
---
 arch/arm/src/armv6-m/arm_schedulesigaction.c | 5 ++---
 arch/arm/src/armv7-m/arm_schedulesigaction.c | 5 ++---
 arch/arm/src/armv8-m/arm_schedulesigaction.c | 5 ++---
 3 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/arch/arm/src/armv6-m/arm_schedulesigaction.c 
b/arch/arm/src/armv6-m/arm_schedulesigaction.c
index 9eeda2acb3..7020982141 100644
--- a/arch/arm/src/armv6-m/arm_schedulesigaction.c
+++ b/arch/arm/src/armv6-m/arm_schedulesigaction.c
@@ -80,14 +80,13 @@
 
 void up_schedule_sigaction(struct tcb_s *tcb)
 {
-  sinfo("tcb=%p, rtcb=%p current_regs=%p\n", tcb, this_task(),
-        this_task()->xcp.regs);
+  FAR struct tcb_s *rtcb = running_task();
 
   /* First, handle some special cases when the signal is
    * being delivered to the currently executing task.
    */
 
-  if (tcb == this_task() && !up_interrupt_context())
+  if (tcb == rtcb && !up_interrupt_context())
     {
       /* In this case just deliver the signal now.
        * REVISIT:  Signal handle will run in a critical section!
diff --git a/arch/arm/src/armv7-m/arm_schedulesigaction.c 
b/arch/arm/src/armv7-m/arm_schedulesigaction.c
index 8d4749ca2a..8987c36b3c 100644
--- a/arch/arm/src/armv7-m/arm_schedulesigaction.c
+++ b/arch/arm/src/armv7-m/arm_schedulesigaction.c
@@ -81,14 +81,13 @@
 
 void up_schedule_sigaction(struct tcb_s *tcb)
 {
-  sinfo("tcb=%p, rtcb=%p current_regs=%p\n", tcb, this_task(),
-        this_task()->xcp.regs);
+  FAR struct tcb_s *rtcb = running_task();
 
   /* First, handle some special cases when the signal is
    * being delivered to the currently executing task.
    */
 
-  if (tcb == this_task() && !up_interrupt_context())
+  if (tcb == rtcb && !up_interrupt_context())
     {
       /* In this case just deliver the signal now.
        * REVISIT:  Signal handle will run in a critical section!
diff --git a/arch/arm/src/armv8-m/arm_schedulesigaction.c 
b/arch/arm/src/armv8-m/arm_schedulesigaction.c
index ea12ca1e48..230f374eae 100644
--- a/arch/arm/src/armv8-m/arm_schedulesigaction.c
+++ b/arch/arm/src/armv8-m/arm_schedulesigaction.c
@@ -81,14 +81,13 @@
 
 void up_schedule_sigaction(struct tcb_s *tcb)
 {
-  sinfo("tcb=%p, rtcb=%p current_regs=%p\n", tcb, this_task(),
-        this_task()->xcp.regs);
+  FAR struct tcb_s *rtcb = running_task();
 
   /* First, handle some special cases when the signal is
    * being delivered to the currently executing task.
    */
 
-  if (tcb == this_task() && !up_interrupt_context())
+  if (tcb == rtcb && !up_interrupt_context())
     {
       /* In this case just deliver the signal now.
        * REVISIT:  Signal handle will run in a critical section!

Reply via email to