Skip to content

Commit 9cc9a83

Browse files
XuNeoxiaoxiang781216
authored andcommitted
ostest/smpcall: add smp call from interrupt test
Signed-off-by: xuxingliang <[email protected]>
1 parent 34e70e7 commit 9cc9a83

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

testing/ostest/smp_call.c

+24
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,12 @@ static int smp_call_func(void *arg)
4141
return OK;
4242
}
4343

44+
static void wdg_wdentry(wdparm_t arg)
45+
{
46+
nxsched_smp_call((1 << CONFIG_SMP_NCPUS) - 1, smp_call_func,
47+
(FAR void *)arg, false);
48+
}
49+
4450
/****************************************************************************
4551
* Public Functions
4652
****************************************************************************/
@@ -53,6 +59,10 @@ void smp_call_test(void)
5359
int cpu;
5460
int value;
5561
int status;
62+
struct wdog_s wdog =
63+
{
64+
0
65+
};
5666

5767
printf("smp_call_test: Test start\n");
5868

@@ -102,6 +112,20 @@ void smp_call_test(void)
102112
}
103113
}
104114

115+
printf("smp_call_test: Call in interrupt, wait\n");
116+
117+
memset(&wdog, 0, sizeof(wdog));
118+
wd_start(&wdog, 0, wdg_wdentry, (wdparm_t)&sem);
119+
for (cpu = 0; cpu < cpucnt; cpu++)
120+
{
121+
status = sem_wait(&sem);
122+
if (status != 0)
123+
{
124+
printf("smp_call_test: smp call in interrupt error\n");
125+
ASSERT(false);
126+
}
127+
}
128+
105129
printf("smp_call_test: Call multi cpu, wait\n");
106130

107131
nxsched_smp_call(cpuset, smp_call_func, &sem, true);

0 commit comments

Comments
 (0)