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-apps.git
The following commit(s) were added to refs/heads/master by this push:
new 9cc9a830e ostest/smpcall: add smp call from interrupt test
9cc9a830e is described below
commit 9cc9a830ebcc5f509bd3f63a5c4a8a856d02da74
Author: xuxingliang <[email protected]>
AuthorDate: Thu Jul 18 22:18:18 2024 +0800
ostest/smpcall: add smp call from interrupt test
Signed-off-by: xuxingliang <[email protected]>
---
testing/ostest/smp_call.c | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/testing/ostest/smp_call.c b/testing/ostest/smp_call.c
index aa3b74039..4d3de1c69 100644
--- a/testing/ostest/smp_call.c
+++ b/testing/ostest/smp_call.c
@@ -41,6 +41,12 @@ static int smp_call_func(void *arg)
return OK;
}
+static void wdg_wdentry(wdparm_t arg)
+{
+ nxsched_smp_call((1 << CONFIG_SMP_NCPUS) - 1, smp_call_func,
+ (FAR void *)arg, false);
+}
+
/****************************************************************************
* Public Functions
****************************************************************************/
@@ -53,6 +59,10 @@ void smp_call_test(void)
int cpu;
int value;
int status;
+ struct wdog_s wdog =
+ {
+ 0
+ };
printf("smp_call_test: Test start\n");
@@ -102,6 +112,20 @@ void smp_call_test(void)
}
}
+ printf("smp_call_test: Call in interrupt, wait\n");
+
+ memset(&wdog, 0, sizeof(wdog));
+ wd_start(&wdog, 0, wdg_wdentry, (wdparm_t)&sem);
+ for (cpu = 0; cpu < cpucnt; cpu++)
+ {
+ status = sem_wait(&sem);
+ if (status != 0)
+ {
+ printf("smp_call_test: smp call in interrupt error\n");
+ ASSERT(false);
+ }
+ }
+
printf("smp_call_test: Call multi cpu, wait\n");
nxsched_smp_call(cpuset, smp_call_func, &sem, true);