Skip to content

Commit

Permalink
ostest/smpcall: add smp call from interrupt test
Browse files Browse the repository at this point in the history
Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
  • Loading branch information
XuNeo authored and xiaoxiang781216 committed Oct 1, 2024
1 parent 34e70e7 commit 9cc9a83
Showing 1 changed file with 24 additions and 0 deletions.
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

0 comments on commit 9cc9a83

Please sign in to comment.