EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  <20202021  2022  2023  2024  Index 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  <20202021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: [Bug 1812084] Re: Build failure on RTEMS 4.10.2
From: Heinz Junkes via Core-talk <core-talk at aps.anl.gov>
To: core-talk at aps.anl.gov
Date: Tue, 12 May 2020 18:11:25 -0000
Ok, I would now try to replace the "internal" direct accesses with API accesses (advice of the RTEMS developers).
Current_priority can be read with: rtems_task_set_priority
The real_priority can be read with a pthread call : pthread_getschedparam
I guess that the BSP has to be generated with --enable-posix.
The question to Andrew: Did the BSPs at APS used to be created with --enable-posix?

Here are my intended calls:

diff --git a/src/libCom/osi/os/RTEMS/osdThread.c b/src/libCom/osi/os/RTEMS/osdThread.c
index c19279ecf..ebeabfa6b 100644
--- a/src/libCom/osi/os/RTEMS/osdThread.c
+++ b/src/libCom/osi/os/RTEMS/osdThread.c
@@ -39,6 +39,8 @@
#include "osdInterrupt.h"
#include "epicsExit.h"

+#include <pthread.h>
+
epicsShareFunc void osdThreadHooksRun(epicsThreadId id);
epicsShareFunc void osdThreadHooksRunMain(epicsThreadId id);

@@ -622,6 +624,26 @@ showInternalTaskInfo (rtems_id tid)
     * that priority should be displayed, not the value truncated to
     * the EPICS range.
     */
+    /* one should not use "internal" RTEMS structures
+     * only calls by API should be used */
+    rtems_status_code sc;
+
+    rtems_task_priority myCurrentPrio, myRealPrio;
+    struct sched_param sp;
+    int policy;
+
+    sc = pthread_getschedparam(tid, &policy, &sp);
+    if (sc != 0) {
+        fprintf(epicsGetStdout(),"%-30s",  "  *** RTEMS task gone! ***");
+        return;
+    }
+    myRealPrio = sp.sched_priority;
+    sc = rtems_task_set_priority(tid,0,&myCurrentPrio);
+    if (sc != 0) {
+        fprintf(epicsGetStdout(),"%-30s",  "  *** RTEMS task gone! ***");
+        return;
+    }
+
    epicsPri = 199-thread.real_priority;
    if (epicsPri < 0)
        fprintf(epicsGetStdout(),"   <0");

-- 
You received this bug notification because you are a member of EPICS
Core Developers, which is subscribed to EPICS Base.
Matching subscriptions: epics-core-list-subscription
https://bugs.launchpad.net/bugs/1812084

Title:
  Build failure on RTEMS 4.10.2

Status in EPICS Base:
  Confirmed
Status in EPICS Base 3.15 series:
  Confirmed
Status in EPICS Base 7.0 series:
  Confirmed

Bug description:
  Michael Westfall reported:

  When compiling base R3.14.12.7 for RTEMS 4.10.2, I get the following
  error:

  /gem_swdev1/targetOS/RTEMS/rtems-4.10/bin/powerpc-rtems4.10-gcc --pipe -B/gem_swdev1/targetOS/RTEMS/rtems-4.10/powerpc-rtems4.10/beatnik/lib/ -specs bsp_specs -qrtems   -fasm -c   -mcpu=7400 -D__ppc_generic                   -DUNIX      -O2 -g -g   -Wall       -DMY_DO_BOOTP=NULL -DHAVE_MOTLOAD -DRTEMS_NETWORK_CONFIG_MBUF_SPACE=2048 -DRTEMS_NETWORK_CONFIG_CLUSTER_SPACE=5120     -MMD -I. -I../O.Common -I. -I../../../src/libCom/osi/os/RTEMS -I../../../src/libCom/osi/os/posix -I../../../src/libCom/osi/os/default -I.. -I../../../src/libCom/bucketLib -I../../../src/libCom/ring -I../../../src/libCom/calc -I../../../src/libCom/cvtFast -I../../../src/libCom/cppStd -I../../../src/libCom/cxxTemplates -I../../../src/libCom/dbmf -I../../../src/libCom/ellLib -I../../../src/libCom/env -I../../../src/libCom/error -I../../../src/libCom/fdmgr -I../../../src/libCom/freeList -I../../../src/libCom/gpHash -I../../../src/libCom/iocsh -I../../../src/libCom/logClient -I../../../src/libCom/macLib -I../../../src/libCom/misc -I../../../src/libCom/osi -I../../../src/libCom/taskwd -I../../../src/libCom/timer -I../../../src/libCom/tsDefs -I/gem_swdev1/epics/R3.14.12.7/base/include/os/RTEMS -I/gem_swdev1/epics/R3.14.12.7/base/include         ../../../src/libCom/osi/os/RTEMS/osdThread.c
  ../../../src/libCom/osi/os/RTEMS/osdThread.c: In function 'showInternalTaskInfo':
  ../../../src/libCom/osi/os/RTEMS/osdThread.c:617: error: 'Thread_Control' has no member named 'real_priority'
  ../../../src/libCom/osi/os/RTEMS/osdThread.c:624: error: 'Thread_Control' has no member named 'current_priority'
  ../../../src/libCom/osi/os/RTEMS/osdThread.c:624: error: 'Thread_Control' has no member named 'real_priority'
  ../../../src/libCom/osi/os/RTEMS/osdThread.c:625: error: 'Thread_Control' has no member named 'current_priority'
  ../../../src/libCom/osi/os/RTEMS/osdThread.c:627: error: 'Thread_Control' has no member named 'real_priority'
  ../../../src/libCom/osi/os/RTEMS/osdThread.c:627: error: 'Thread_Control' has no member named 'current_priority'
  make[3]: *** [osdThread.o] Error 1

To manage notifications about this bug go to:
https://bugs.launchpad.net/epics-base/+bug/1812084/+subscriptions

Navigate by Date:
Prev: Build failed: EPICS Base base-3.15-606 AppVeyor via Core-talk
Next: [Bug 1812084] Re: Build failure on RTEMS 4.10.2 mdavidsaver via Core-talk
Index: 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  <20202021  2022  2023  2024 
Navigate by Thread:
Prev: Build failed: EPICS Base base-3.15-606 AppVeyor via Core-talk
Next: [Bug 1812084] Re: Build failure on RTEMS 4.10.2 mdavidsaver via Core-talk
Index: 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  <20202021  2022  2023  2024 
ANJ, 12 May 2020 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·