From 6d65e9f38ee1677bddd2bae66e42d6f4da621e36 Mon Sep 17 00:00:00 2001 From: Masayuki Ishikawa Date: Thu, 22 Jul 2021 22:53:48 +0900 Subject: [PATCH] arch: sim: Add NuttX symbols to make SMP work correctly Summary: - I noticed that sim:smp does not work correctly on macOS due to the recent changes - Actually, it can not receive the IPI host signal, so if a new task is scheduled on CPU1/2/3, it hangs. - Finally, I found that sim_cpu_start() calls pthread_attr_init() which locates not on the host OS but on the NuttX - This commit fixes this issue by adding the symbol names to nuttx-names.in Impact: - sim in SMP mode - NOTE: stack usage for CPU1/2/3 IDLE is still incorrect on macOS Testing: - Tested with ostest on Ubuntu 18.04 (x86_64) and macOS 11.4 (x86_64) Signed-off-by: Masayuki Ishikawa --- arch/sim/src/nuttx-names.in | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/sim/src/nuttx-names.in b/arch/sim/src/nuttx-names.in index 9d405fddc27..1a72b10f228 100644 --- a/arch/sim/src/nuttx-names.in +++ b/arch/sim/src/nuttx-names.in @@ -61,6 +61,9 @@ NXSYMBOLS(opendir) NXSYMBOLS(perror) NXSYMBOLS(poll) NXSYMBOLS(posix_memalign) +NXSYMBOLS(pthread_attr_init) +NXSYMBOLS(pthread_attr_setstack) +NXSYMBOLS(pthread_attr_destroy) NXSYMBOLS(pthread_cond_destroy) NXSYMBOLS(pthread_cond_init) NXSYMBOLS(pthread_cond_signal)