You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by gn...@apache.org on 2020/01/30 11:44:01 UTC

[incubator-nuttx-apps] branch master updated: Revert "examples: hello: Show CPU index when running in SMP mode"

This is an automated email from the ASF dual-hosted git repository.

gnutt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx-apps.git


The following commit(s) were added to refs/heads/master by this push:
     new 4e509c8  Revert "examples: hello: Show CPU index when running in SMP mode"
4e509c8 is described below

commit 4e509c8659521d49299d18efd607d4c96631c943
Author: Gregory Nutt <gn...@nuttx.org>
AuthorDate: Thu Jan 30 05:41:13 2020 -0600

    Revert "examples: hello: Show CPU index when running in SMP mode"
    
    Cannot call up_cpu_index() or any other nonstandard OS application interface.  This not only breaks the portable POSIX OS interface but also would break any PROTECTED or KERNEL mode SMP implementation.
    
    If you want to do something like this in user space, the appropriate thing to do would be to extend prctl().  That is non-posix, but is at least Linux-like and will work in all build modes.
    
    This reverts commit 715517b1a0c2c5215f87fc17d34bb72263094583.
---
 examples/hello/hello_main.c | 10 ----------
 1 file changed, 10 deletions(-)

diff --git a/examples/hello/hello_main.c b/examples/hello/hello_main.c
index a533eff..953597a 100644
--- a/examples/hello/hello_main.c
+++ b/examples/hello/hello_main.c
@@ -40,10 +40,6 @@
 #include <nuttx/config.h>
 #include <stdio.h>
 
-#ifdef CONFIG_SMP
-#  include <nuttx/arch.h>
-#endif
-
 /****************************************************************************
  * Public Functions
  ****************************************************************************/
@@ -54,12 +50,6 @@
 
 int main(int argc, FAR char *argv[])
 {
-#ifdef CONFIG_SMP
-  uint32_t cpu = up_cpu_index();
-
-  printf("Hello, World from CPU%d !!\n", cpu);
-#else
   printf("Hello, World!!\n");
-#endif
   return 0;
 }