You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2020/09/04 10:30:19 UTC

[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a change in pull request #1709: arch/sim: Fix the up_cpu_start initialisation on OSX with SMP config enabled

xiaoxiang781216 commented on a change in pull request #1709:
URL: https://github.com/apache/incubator-nuttx/pull/1709#discussion_r483530463



##########
File path: arch/sim/src/sim/up_simsmp.c
##########
@@ -53,7 +54,11 @@
 struct sim_cpuinfo_s
 {
   int cpu;    /* CPU number */
+#ifdef CONFIG_HOST_MACOS
+  sem_t *done;
+#else
   sem_t done; /* For synchronization */

Review comment:
       should we switch to named semp for all platform? it's hard to maintain two codebase.

##########
File path: arch/sim/src/sim/up_simsmp.c
##########
@@ -324,11 +344,22 @@ int up_cpu_start(int cpu)
   /* Initialize the CPU info */
 
   cpuinfo.cpu = cpu;
-  ret = sem_init(&cpuinfo.done, 0, 0);
+
+#ifdef CONFIG_HOST_MACOS
+  done_sema = sem_open(g_sema_name_done, O_CREAT, 0644, 0);

Review comment:
       The name need different for each cpu and for multiple nuttx instance

##########
File path: arch/sim/src/nuttx-names.in
##########
@@ -149,6 +149,9 @@ NXSYMBOLS(sched_yield)
 NXSYMBOLS(seekdir)
 NXSYMBOLS(select)
 NXSYMBOLS(sem_destroy)
+NXSYMBOLS(sem_open)
+NXSYMBOLS(sem_close)
+NXSYMBOLS(sem_unlink)

Review comment:
       let's order the list.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org