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

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit 850cfb545a9d2c099076dee3c503bfdd90456c04
Author: Ville Juven <ville.ju...@unikie.com>
AuthorDate: Tue Apr 8 13:33:53 2025 +0300

    Revert "includes/nuttx: fix _SCHED_GET(T/P/PP)ID definition issue"
    
    This reverts commit 9369b75ee540b0aa11340e85a73b0c342cfb5bce.
    
    Signed-off-by: Ville Juven <ville.ju...@unikie.com>
---
 include/nuttx/sched.h | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/include/nuttx/sched.h b/include/nuttx/sched.h
index 9846269e43..ce0ee8ce51 100644
--- a/include/nuttx/sched.h
+++ b/include/nuttx/sched.h
@@ -155,9 +155,6 @@
  */
 
 #if !defined(CONFIG_BUILD_FLAT) && defined(__KERNEL__)
-#  define _SCHED_GETTID()            nxsched_gettid()
-#  define _SCHED_GETPID()            nxsched_getpid()
-#  define _SCHED_GETPPID()           nxsched_getppid()
 #  define _SCHED_GETPARAM(t,p)       nxsched_get_param(t,p)
 #  define _SCHED_SETPARAM(t,p)       nxsched_set_param(t,p)
 #  define _SCHED_GETSCHEDULER(t)     nxsched_get_scheduler(t)
@@ -167,9 +164,6 @@
 #  define _SCHED_ERRNO(r)            (-(r))
 #  define _SCHED_ERRVAL(r)           (r)
 #else
-#  define _SCHED_GETTID()            gettid()
-#  define _SCHED_GETPID()            getpid()
-#  define _SCHED_GETPPID()           getppid()
 #  define _SCHED_GETPARAM(t,p)       sched_getparam(t,p)
 #  define _SCHED_SETPARAM(t,p)       sched_setparam(t,p)
 #  define _SCHED_GETSCHEDULER(t)     sched_getscheduler(t)
@@ -180,6 +174,16 @@
 #  define _SCHED_ERRVAL(r)           (-errno)
 #endif
 
+#if defined(CONFIG_BUILD_FLAT) || defined(__KERNEL__)
+#  define _SCHED_GETTID()            nxsched_gettid()
+#  define _SCHED_GETPID()            nxsched_getpid()
+#  define _SCHED_GETPPID()           nxsched_getppid()
+#else
+#  define _SCHED_GETTID()            gettid()
+#  define _SCHED_GETPID()            getpid()
+#  define _SCHED_GETPPID()           getppid()
+#endif
+
 #define TCB_PID_OFF                  offsetof(struct tcb_s, pid)
 #define TCB_STATE_OFF                offsetof(struct tcb_s, task_state)
 #define TCB_PRI_OFF                  offsetof(struct tcb_s, sched_priority)

Reply via email to