Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions testing/ostest/smp_call.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
****************************************************************************/
Expand All @@ -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");

Expand Down Expand Up @@ -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);
Expand Down