You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by ac...@apache.org on 2024/09/05 12:35:22 UTC

(nuttx) branch master updated: smp: smp call handler add up_cpu_paused_[save|restore]

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

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


The following commit(s) were added to refs/heads/master by this push:
     new a65adcd9db smp: smp call handler add up_cpu_paused_[save|restore]
a65adcd9db is described below

commit a65adcd9dbb37b85f0a5f1b7f7e5fc047107ff5b
Author: hujun5 <hu...@xiaomi.com>
AuthorDate: Mon Aug 12 09:16:36 2024 +0800

    smp: smp call handler add up_cpu_paused_[save|restore]
    
    reason:
    Since smp call handler may lead to context switching,
    we need to update the context information by calling up_cpu_paused_[save|restore].
    
    Signed-off-by: hujun5 <hu...@xiaomi.com>
---
 sched/sched/sched_smp.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sched/sched/sched_smp.c b/sched/sched/sched_smp.c
index 1b3483c71c..88ac43bfad 100644
--- a/sched/sched/sched_smp.c
+++ b/sched/sched/sched_smp.c
@@ -121,6 +121,7 @@ int nxsched_smp_call_handler(int irq, FAR void *context,
 
   call_queue = &g_smp_call_queue[cpu];
 
+  up_cpu_paused_save();
   sq_for_every_safe(call_queue, curr, next)
     {
       FAR struct smp_call_data_s *call_data =
@@ -154,6 +155,7 @@ int nxsched_smp_call_handler(int irq, FAR void *context,
       flags = enter_critical_section();
     }
 
+  up_cpu_paused_restore();
   leave_critical_section(flags);
   return OK;
 }