From c348a9eec63750a35930d29ba6d33b7b36efb9fb Mon Sep 17 00:00:00 2001
From: yilmazt <turker.yilmaz@eurecom.fr>
Date: Fri, 4 Oct 2019 16:48:13 +0200
Subject: [PATCH] common thread-related minor functions in new .h file

---
 executables/nr-gnb.c                      | 21 ++++++------
 executables/nr-ru.c                       | 17 ++++-----
 executables/nr-softmodem.c                | 10 +++---
 executables/nr-softmodem.h                |  1 -
 executables/nr-uesoftmodem.c              |  2 ++
 executables/softmodem-common.h            | 42 -----------------------
 executables/thread-common.h               | 42 +++++++++++++++++++++++
 openair1/PHY/LTE_TRANSPORT/dlsch_coding.c |  3 +-
 openair1/SIMULATION/LTE_PHY/dlsim.c       | 14 ++++----
 openair1/SIMULATION/LTE_PHY/ulsim.c       |  3 +-
 openair2/ENB_APP/enb_config.c             |  8 ++---
 openair2/GNB_APP/gnb_config.c             |  5 +--
 targets/RT/USER/lte-enb.c                 |  6 ++--
 targets/RT/USER/lte-ru.c                  |  6 ++--
 targets/RT/USER/lte-softmodem-common.c    |  1 +
 targets/RT/USER/lte-uesoftmodem.c         |  1 -
 16 files changed, 92 insertions(+), 90 deletions(-)
 create mode 100644 executables/thread-common.h

diff --git a/executables/nr-gnb.c b/executables/nr-gnb.c
index e86eaf2ada2..28876a33d41 100644
--- a/executables/nr-gnb.c
+++ b/executables/nr-gnb.c
@@ -99,10 +99,10 @@
 
 
 #if defined(ENABLE_ITTI)
-  extern volatile int             start_gNB;
-  extern volatile int             start_UE;
+  extern volatile int start_gNB;
+  extern volatile int start_UE;
 #endif
-extern volatile int                    oai_exit;
+extern volatile int oai_exit;
 
 extern openair0_config_t openair0_cfg[MAX_CARDS];
 
@@ -110,7 +110,7 @@ extern int transmission_mode;
 
 uint16_t sl_ahead=4;
 uint16_t sf_ahead=4;
-//pthread_t                       main_gNB_thread;
+//pthread_t main_gNB_thread;
 
 time_stats_t softmodem_stats_mt; // main thread
 time_stats_t softmodem_stats_hw; //  hw acquisition
@@ -133,13 +133,14 @@ extern double cpuf;
 void init_gNB(int,int);
 void stop_gNB(int nb_inst);
 
-int wakeup_txfh(PHY_VARS_gNB *gNB,gNB_L1_rxtx_proc_t *proc,int frame_tx,int slot_tx,uint64_t timestamp_tx);
-int wakeup_tx(PHY_VARS_gNB *gNB,int frame_rx,int slot_rx,int frame_tx,int slot_tx,uint64_t timestamp_tx);
-extern PARALLEL_CONF_t get_thread_parallel_conf(void);
-extern WORKER_CONF_t   get_thread_worker_conf(void);
+int wakeup_txfh(PHY_VARS_gNB *gNB, gNB_L1_rxtx_proc_t *proc, int frame_tx, int slot_tx, uint64_t timestamp_tx);
+int wakeup_tx(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx, int frame_tx, int slot_tx, uint64_t timestamp_tx);
+#include "executables/thread-common.h"
+//extern PARALLEL_CONF_t get_thread_parallel_conf(void);
+//extern WORKER_CONF_t   get_thread_worker_conf(void);
 
 
-void wakeup_prach_gNB(PHY_VARS_gNB *gNB,RU_t *ru,int frame,int subframe);
+void wakeup_prach_gNB(PHY_VARS_gNB *gNB, RU_t *ru, int frame, int subframe);
 
 extern uint8_t nfapi_mode;
 extern void oai_subframe_ind(uint16_t sfn, uint16_t sf);
@@ -149,7 +150,7 @@ extern void add_subframe(uint16_t *frameP, uint16_t *subframeP, int offset);
 #define TICK_TO_US(ts) (ts.trials==0?0:ts.diff/ts.trials)
 
 
-static inline int rxtx(PHY_VARS_gNB *gNB,int frame_rx, int slot_rx, int frame_tx, int slot_tx, char *thread_name) {
+static inline int rxtx(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx, int frame_tx, int slot_tx, char *thread_name) {
   start_meas(&softmodem_stats_rxtx_sf);
 
   // *******************************************************************
diff --git a/executables/nr-ru.c b/executables/nr-ru.c
index 977b06e9207..5309ec6fc8a 100644
--- a/executables/nr-ru.c
+++ b/executables/nr-ru.c
@@ -114,27 +114,22 @@ static int DEFENBS[] = {0};
 #include "T.h"
 #include "nfapi_interface.h"
 
-extern volatile int                    oai_exit;
+extern volatile int oai_exit;
 
 
 extern void  nr_phy_free_RU(RU_t *);
 extern void  nr_phy_config_request(NR_PHY_Config_t *gNB);
-
-extern PARALLEL_CONF_t get_thread_parallel_conf(void);
-extern WORKER_CONF_t   get_thread_worker_conf(void);
+#include "executables/thread-common.h"
+//extern PARALLEL_CONF_t get_thread_parallel_conf(void);
+//extern WORKER_CONF_t   get_thread_worker_conf(void);
 
 void init_NR_RU(char *);
 void stop_RU(int nb_ru);
 void do_ru_sync(RU_t *ru);
 
-void configure_ru(int idx,
-                  void *arg);
-
-void configure_rru(int idx,
-                   void *arg);
-
+void configure_ru(int idx, void *arg);
+void configure_rru(int idx, void *arg);
 int attach_rru(RU_t *ru);
-
 int connect_rau(RU_t *ru);
 
 extern uint16_t sl_ahead;
diff --git a/executables/nr-softmodem.c b/executables/nr-softmodem.c
index d25cc20fb63..128c199a07e 100644
--- a/executables/nr-softmodem.c
+++ b/executables/nr-softmodem.c
@@ -84,6 +84,8 @@ unsigned short config_frames[4] = {2,9,11,13};
 #include "PHY/TOOLS/nr_phy_scope.h"
 #include "stats.h"
 #include "nr-softmodem.h"
+#include "executables/softmodem-common.h"
+#include "executables/thread-common.h"
 #include "NB_IoT_interface.h"
 
 short nr_mod_table[NR_MOD_TABLE_SIZE_SHORT] = {0,0,16384,16384,-16384,-16384,16384,16384,16384,-16384,-16384,16384,-16384,-16384,7327,7327,7327,21981,21981,7327,21981,21981,7327,-7327,7327,-21981,21981,-7327,21981,-21981,-7327,7327,-7327,21981,-21981,7327,-21981,21981,-7327,-7327,-7327,-21981,-21981,-7327,-21981,-21981,10726,10726,10726,3576,3576,10726,3576,3576,10726,17876,10726,25027,3576,17876,3576,25027,17876,10726,17876,3576,25027,10726,25027,3576,17876,17876,17876,25027,25027,17876,25027,25027,10726,-10726,10726,-3576,3576,-10726,3576,-3576,10726,-17876,10726,-25027,3576,-17876,3576,-25027,17876,-10726,17876,-3576,25027,-10726,25027,-3576,17876,-17876,17876,-25027,25027,-17876,25027,-25027,-10726,10726,-10726,3576,-3576,10726,-3576,3576,-10726,17876,-10726,25027,-3576,17876,-3576,25027,-17876,10726,-17876,3576,-25027,10726,-25027,3576,-17876,17876,-17876,25027,-25027,17876,-25027,25027,-10726,-10726,-10726,-3576,-3576,-10726,-3576,-3576,-10726,-17876,-10726,-25027,-3576,-17876,-3576,-25027,-17876,-10726,-17876,-3576,-25027,-10726,-25027,-3576,-17876,-17876,-17876,-25027,-25027,-17876,-25027,-25027,8886,8886,8886,12439,12439,8886,12439,12439,8886,5332,8886,1778,12439,5332,12439,1778,5332,8886,5332,12439,1778,8886,1778,12439,5332,5332,5332,1778,1778,5332,1778,1778,8886,19547,8886,15993,12439,19547,12439,15993,8886,23101,8886,26655,12439,23101,12439,26655,5332,19547,5332,15993,1778,19547,1778,15993,5332,23101,5332,26655,1778,23101,1778,26655,19547,8886,19547,12439,15993,8886,15993,12439,19547,5332,19547,1778,15993,5332,15993,1778,23101,8886,23101,12439,26655,8886,26655,12439,23101,5332,23101,1778,26655,5332,26655,1778,19547,19547,19547,15993,15993,19547,15993,15993,19547,23101,19547,26655,15993,23101,15993,26655,23101,19547,23101,15993,26655,19547,26655,15993,23101,23101,23101,26655,26655,23101,26655,26655,8886,-8886,8886,-12439,12439,-8886,12439,-12439,8886,-5332,8886,-1778,12439,-5332,12439,-1778,5332,-8886,5332,-12439,1778,-8886,1778,-12439,5332,-5332,5332,-1778,1778,-5332,1778,-1778,8886,-19547,8886,-15993,12439,-19547,12439,-15993,8886,-23101,8886,-26655,12439,-23101,12439,-26655,5332,-19547,5332,-15993,1778,-19547,1778,-15993,5332,-23101,5332,-26655,1778,-23101,1778,-26655,19547,-8886,19547,-12439,15993,-8886,15993,-12439,19547,-5332,19547,-1778,15993,-5332,15993,-1778,23101,-8886,23101,-12439,26655,-8886,26655,-12439,23101,-5332,23101,-1778,26655,-5332,26655,-1778,19547,-19547,19547,-15993,15993,-19547,15993,-15993,19547,-23101,19547,-26655,15993,-23101,15993,-26655,23101,-19547,23101,-15993,26655,-19547,26655,-15993,23101,-23101,23101,-26655,26655,-23101,26655,-26655,-8886,8886,-8886,12439,-12439,8886,-12439,12439,-8886,5332,-8886,1778,-12439,5332,-12439,1778,-5332,8886,-5332,12439,-1778,8886,-1778,12439,-5332,5332,-5332,1778,-1778,5332,-1778,1778,-8886,19547,-8886,15993,-12439,19547,-12439,15993,-8886,23101,-8886,26655,-12439,23101,-12439,26655,-5332,19547,-5332,15993,-1778,19547,-1778,15993,-5332,23101,-5332,26655,-1778,23101,-1778,26655,-19547,8886,-19547,12439,-15993,8886,-15993,12439,-19547,5332,-19547,1778,-15993,5332,-15993,1778,-23101,8886,-23101,12439,-26655,8886,-26655,12439,-23101,5332,-23101,1778,-26655,5332,-26655,1778,-19547,19547,-19547,15993,-15993,19547,-15993,15993,-19547,23101,-19547,26655,-15993,23101,-15993,26655,-23101,19547,-23101,15993,-26655,19547,-26655,15993,-23101,23101,-23101,26655,-26655,23101,-26655,26655,-8886,-8886,-8886,-12439,-12439,-8886,-12439,-12439,-8886,-5332,-8886,-1778,-12439,-5332,-12439,-1778,-5332,-8886,-5332,-12439,-1778,-8886,-1778,-12439,-5332,-5332,-5332,-1778,-1778,-5332,-1778,-1778,-8886,-19547,-8886,-15993,-12439,-19547,-12439,-15993,-8886,-23101,-8886,-26655,-12439,-23101,-12439,-26655,-5332,-19547,-5332,-15993,-1778,-19547,-1778,-15993,-5332,-23101,-5332,-26655,-1778,-23101,-1778,-26655,-19547,-8886,-19547,-12439,-15993,-8886,-15993,-12439,-19547,-5332,-19547,-1778,-15993,-5332,-15993,-1778,-23101,-8886,-23101,-12439,-26655,-8886,-26655,-12439,-23101,-5332,-23101,-1778,-26655,-5332,-26655,-1778,-19547,-19547,-19547,-15993,-15993,-19547,-15993,-15993,-19547,-23101,-19547,-26655,-15993,-23101,-15993,-26655,-23101,-19547,-23101,-15993,-26655,-19547,-26655,-15993,-23101,-23101,-23101,-26655,-26655,-23101,-26655,-26655};
@@ -189,7 +191,7 @@ int transmission_mode=1;
 int emulate_rf = 0;
 int numerology = 0;
 
-typedef struct {
+/*typedef struct {
   uint64_t       optmask;
   THREAD_STRUCT  thread_struct;
   char           rf_config_file[1024];
@@ -203,12 +205,12 @@ typedef struct {
   unsigned int   start_msc;
   uint32_t       clock_source;
   int            hw_timing_advance;
-} softmodem_params_t;
+} softmodem_params_t;*/
 static softmodem_params_t softmodem_params;
 
 static char *parallel_config = NULL;
 static char *worker_config = NULL;
-static THREAD_STRUCT thread_struct;
+/*static THREAD_STRUCT thread_struct;
 
 void set_parallel_conf(char *parallel_conf) {
   if(strcmp(parallel_conf,"PARALLEL_SINGLE_THREAD")==0)           thread_struct.parallel_conf = PARALLEL_SINGLE_THREAD;
@@ -228,7 +230,7 @@ PARALLEL_CONF_t get_thread_parallel_conf(void) {
 }
 WORKER_CONF_t get_thread_worker_conf(void) {
 	return thread_struct.worker_conf;
-}
+}*/
 
 /* struct for ethernet specific parameters given in eNB conf file */
 eth_params_t *eth_params;
diff --git a/executables/nr-softmodem.h b/executables/nr-softmodem.h
index 6a40300f9ee..8856c920597 100644
--- a/executables/nr-softmodem.h
+++ b/executables/nr-softmodem.h
@@ -2,7 +2,6 @@
 #define NR_SOFTMODEM_H
 
 #include <executables/nr-softmodem-common.h>
-#include <executables/softmodem-common.h>
 
 #include "flexran_agent.h"
 #include "PHY/defs_gNB.h"
diff --git a/executables/nr-uesoftmodem.c b/executables/nr-uesoftmodem.c
index cffb5d9b035..4b11fc5ce76 100644
--- a/executables/nr-uesoftmodem.c
+++ b/executables/nr-uesoftmodem.c
@@ -105,6 +105,8 @@ char title[255];
 static pthread_t                forms_thread; //xforms
 
 #include <executables/nr-uesoftmodem.h>
+#include "executables/softmodem-common.h"
+#include "executables/thread-common.h"
 
 RAN_CONTEXT_t RC;
 volatile int             start_eNB = 0;
diff --git a/executables/softmodem-common.h b/executables/softmodem-common.h
index 4776c0714b0..f6ba3a6beb8 100644
--- a/executables/softmodem-common.h
+++ b/executables/softmodem-common.h
@@ -1,44 +1,6 @@
 #ifndef SOFTMODEM_COMMON_H
 #define SOFTMODEM_COMMON_H
 
-//#include "threads_t.h"
-
-THREAD_STRUCT thread_struct;
-
-static inline void set_parallel_conf(char *parallel_conf) {
-  mapping config[]= {
-    FOREACH_PARALLEL(GENERATE_ENUMTXT)
-    {NULL,-1}
-  };
-  thread_struct.parallel_conf = (PARALLEL_CONF_t)map_str_to_int(config, parallel_conf);
-  if (thread_struct.parallel_conf == -1 ) {
-    LOG_E(ENB_APP,"Impossible value: %s\n", parallel_conf);
-    thread_struct.parallel_conf = PARALLEL_SINGLE_THREAD;
-  }
-  printf("[CONFIG] parallel_conf is set to %d\n", thread_struct.parallel_conf);
-}
-
-static inline void set_worker_conf(char *worker_conf) {
-  mapping config[]={
-    FOREACH_WORKER(GENERATE_ENUMTXT)
-    {NULL, -1}
-  };
-  thread_struct.worker_conf = (WORKER_CONF_t)map_str_to_int(config, worker_conf);
-  if (thread_struct.worker_conf == -1 ) {
-    LOG_E(ENB_APP,"Impossible value: %s\n", worker_conf);
-    thread_struct.worker_conf = WORKER_DISABLE ;
-  }
-  printf("[CONFIG] worker_conf is set to %d\n", thread_struct.worker_conf);
-}
-
-static inline PARALLEL_CONF_t get_thread_parallel_conf(void) {
-  return thread_struct.parallel_conf;
-}
-
-static inline WORKER_CONF_t get_thread_worker_conf(void) {
-  return thread_struct.worker_conf;
-}
-
 typedef struct {
   uint64_t       optmask;
   THREAD_STRUCT  thread_struct;
@@ -57,8 +19,4 @@ typedef struct {
   uint32_t       send_dmrs_sync;
 } softmodem_params_t;
 
-
-
-
-
 #endif
diff --git a/executables/thread-common.h b/executables/thread-common.h
new file mode 100644
index 00000000000..6f3af3cfc00
--- /dev/null
+++ b/executables/thread-common.h
@@ -0,0 +1,42 @@
+#ifndef THREAD_COMMON_H
+#define THREAD_COMMON_H
+
+#include "PHY/defs_common.h"
+
+THREAD_STRUCT thread_struct;
+
+static inline void set_parallel_conf(char *parallel_conf) {
+  mapping config[]= {
+    FOREACH_PARALLEL(GENERATE_ENUMTXT)
+    {NULL,-1}
+  };
+  thread_struct.parallel_conf = (PARALLEL_CONF_t)map_str_to_int(config, parallel_conf);
+  if (thread_struct.parallel_conf == -1 ) {
+    LOG_E(ENB_APP,"Impossible value: %s\n", parallel_conf);
+    thread_struct.parallel_conf = PARALLEL_SINGLE_THREAD;
+  }
+  printf("[CONFIG] parallel_conf is set to %d\n", thread_struct.parallel_conf);
+}
+
+static inline void set_worker_conf(char *worker_conf) {
+  mapping config[]={
+    FOREACH_WORKER(GENERATE_ENUMTXT)
+    {NULL, -1}
+  };
+  thread_struct.worker_conf = (WORKER_CONF_t)map_str_to_int(config, worker_conf);
+  if (thread_struct.worker_conf == -1 ) {
+    LOG_E(ENB_APP,"Impossible value: %s\n", worker_conf);
+    thread_struct.worker_conf = WORKER_DISABLE ;
+  }
+  printf("[CONFIG] worker_conf is set to %d\n", thread_struct.worker_conf);
+}
+
+static inline PARALLEL_CONF_t get_thread_parallel_conf(void) {
+  return thread_struct.parallel_conf;
+}
+
+static inline WORKER_CONF_t get_thread_worker_conf(void) {
+  return thread_struct.worker_conf;
+}
+
+#endif
diff --git a/openair1/PHY/LTE_TRANSPORT/dlsch_coding.c b/openair1/PHY/LTE_TRANSPORT/dlsch_coding.c
index 80e7b6f8cdb..280b92f8df4 100644
--- a/openair1/PHY/LTE_TRANSPORT/dlsch_coding.c
+++ b/openair1/PHY/LTE_TRANSPORT/dlsch_coding.c
@@ -57,7 +57,8 @@
          uint64_t runtime,
          uint64_t deadline,
          uint64_t period);*/
-extern WORKER_CONF_t get_thread_worker_conf(void);
+//extern WORKER_CONF_t get_thread_worker_conf(void);
+#include "executables/thread-common.h"
 extern volatile int oai_exit;
 
 
diff --git a/openair1/SIMULATION/LTE_PHY/dlsim.c b/openair1/SIMULATION/LTE_PHY/dlsim.c
index 4cc6d502493..c0b1200e1ab 100644
--- a/openair1/SIMULATION/LTE_PHY/dlsim.c
+++ b/openair1/SIMULATION/LTE_PHY/dlsim.c
@@ -84,11 +84,11 @@ double t_tx_min = 1000000000; /*!< \brief initial min process time for tx */
 double t_rx_min = 1000000000; /*!< \brief initial min process time for rx */
 int n_tx_dropped = 0; /*!< \brief initial max process time for tx */
 int n_rx_dropped = 0; /*!< \brief initial max process time for rx */
-
-THREAD_STRUCT thread_struct;
+#include "executables/thread-common.h"
+//THREAD_STRUCT thread_struct;
 //static THREAD_STRUCT thread_struct;
 
-void set_parallel_conf_dlsim(char *parallel_conf) {
+/*void set_parallel_conf_dlsim(char *parallel_conf) {
   if(strcmp(parallel_conf,"PARALLEL_SINGLE_THREAD")==0)           thread_struct.parallel_conf = PARALLEL_SINGLE_THREAD;
   else if(strcmp(parallel_conf,"PARALLEL_RU_L1_SPLIT")==0)        thread_struct.parallel_conf = PARALLEL_RU_L1_SPLIT;
   else if(strcmp(parallel_conf,"PARALLEL_RU_L1_TRX_SPLIT")==0)    thread_struct.parallel_conf = PARALLEL_RU_L1_TRX_SPLIT;
@@ -101,7 +101,7 @@ void set_worker_conf_dlsim(char *worker_conf) {
 
   printf("[CONFIG] worker conf is set to %d\n",thread_struct.worker_conf);
 }
-/*PARALLEL_CONF_t get_thread_parallel_conf(void) {
+PARALLEL_CONF_t get_thread_parallel_conf(void) {
 	return thread_struct.parallel_conf;
 }
 WORKER_CONF_t get_thread_worker_conf(void) {
@@ -641,7 +641,7 @@ int main(int argc, char **argv) {
   memset((void *)&TX_req,0,sizeof(TX_req));
   DL_req.dl_config_request_body.dl_config_pdu_list = dl_config_pdu_list;
   TX_req.tx_request_body.tx_pdu_list = tx_pdu_list;
-  set_parallel_conf_dlsim("PARALLEL_SINGLE_THREAD");
+  set_parallel_conf("PARALLEL_SINGLE_THREAD");
   cpuf = cpu_freq_GHz;
   //signal(SIGSEGV, handler);
   //signal(SIGABRT, handler);
@@ -891,7 +891,7 @@ int main(int argc, char **argv) {
         break;
 
       case 'Q':
-        set_parallel_conf_dlsim(optarg);
+        set_parallel_conf(optarg);
         break;
 
       default:
@@ -912,7 +912,7 @@ int main(int argc, char **argv) {
   if (help)
     exit(0);
   if (thread_struct.parallel_conf != PARALLEL_SINGLE_THREAD)
-    set_worker_conf_dlsim("WORKER_ENABLE");
+    set_worker_conf("WORKER_ENABLE");
 
   if (transmission_mode>1) pa=dBm3;
 
diff --git a/openair1/SIMULATION/LTE_PHY/ulsim.c b/openair1/SIMULATION/LTE_PHY/ulsim.c
index be69e96897b..a7567e1b276 100644
--- a/openair1/SIMULATION/LTE_PHY/ulsim.c
+++ b/openair1/SIMULATION/LTE_PHY/ulsim.c
@@ -96,7 +96,8 @@ nfapi_tx_request_pdu_t tx_pdu_list[MAX_NUM_TX_REQUEST_PDU];
 nfapi_tx_request_t TX_req;
 Sched_Rsp_t sched_resp;
 
-THREAD_STRUCT thread_struct;
+#include "executables/thread-common.h"
+//THREAD_STRUCT thread_struct;
 
 void
 fill_nfapi_ulsch_config_request(nfapi_ul_config_request_pdu_t *ul_config_pdu,
diff --git a/openair2/ENB_APP/enb_config.c b/openair2/ENB_APP/enb_config.c
index a0527d5d7b8..f02da496c93 100644
--- a/openair2/ENB_APP/enb_config.c
+++ b/openair2/ENB_APP/enb_config.c
@@ -55,11 +55,11 @@
 #include "RRC_config_tools.h"
 #include "enb_paramdef.h"
 #include "proto_agent.h"
-
-extern void set_parallel_conf(char *parallel_conf);
+#include "executables/thread-common.h"
+/*extern void set_parallel_conf(char *parallel_conf);
 extern void set_worker_conf(char *worker_conf);
-//extern PARALLEL_CONF_t get_thread_parallel_conf(void);
-//extern WORKER_CONF_t   get_thread_worker_conf(void);
+extern PARALLEL_CONF_t get_thread_parallel_conf(void);
+extern WORKER_CONF_t   get_thread_worker_conf(void);*/
 extern uint32_t to_earfcn_DL(int eutra_bandP, uint32_t dl_CarrierFreq, uint32_t bw);
 extern uint32_t to_earfcn_UL(int eutra_bandP, uint32_t ul_CarrierFreq, uint32_t bw);
 extern char *parallel_config;
diff --git a/openair2/GNB_APP/gnb_config.c b/openair2/GNB_APP/gnb_config.c
index 25cfa3c5166..ff8f1d220e8 100644
--- a/openair2/GNB_APP/gnb_config.c
+++ b/openair2/GNB_APP/gnb_config.c
@@ -77,10 +77,11 @@
 #include "NR_EUTRA-MBSFN-SubframeConfig.h"
 
 extern uint16_t sf_ahead;
-extern void set_parallel_conf(char *parallel_conf);
+#include "executables/thread-common.h"
+/*extern void set_parallel_conf(char *parallel_conf);
 extern void set_worker_conf(char *worker_conf);
 extern PARALLEL_CONF_t get_thread_parallel_conf(void);
-extern WORKER_CONF_t   get_thread_worker_conf(void);
+extern WORKER_CONF_t   get_thread_worker_conf(void);*/
 extern int config_check_band_frequencies(int ind, int16_t band, uint32_t downlink_frequency,
                                          int32_t uplink_frequency_offset, uint32_t  frame_type);
 
diff --git a/targets/RT/USER/lte-enb.c b/targets/RT/USER/lte-enb.c
index 6634ae51d29..f06e44505bc 100644
--- a/targets/RT/USER/lte-enb.c
+++ b/targets/RT/USER/lte-enb.c
@@ -118,9 +118,9 @@ extern int oaisim_flag;
 
 //uint16_t sf_ahead=4;
 extern uint16_t sf_ahead;
-
-extern PARALLEL_CONF_t get_thread_parallel_conf(void);
-extern WORKER_CONF_t   get_thread_worker_conf(void);
+#include "executables/thread-common.h"
+//extern PARALLEL_CONF_t get_thread_parallel_conf(void);
+//extern WORKER_CONF_t   get_thread_worker_conf(void);
 
 //pthread_t                       main_eNB_thread;
 
diff --git a/targets/RT/USER/lte-ru.c b/targets/RT/USER/lte-ru.c
index 569167296ef..cff9057d1b4 100644
--- a/targets/RT/USER/lte-ru.c
+++ b/targets/RT/USER/lte-ru.c
@@ -104,9 +104,9 @@ extern volatile int oai_exit;
 extern int emulate_rf;
 extern int numerology;
 extern clock_source_t clock_source;
-
-extern PARALLEL_CONF_t get_thread_parallel_conf(void);
-extern WORKER_CONF_t   get_thread_worker_conf(void);
+#include "executables/thread-common.h"
+//extern PARALLEL_CONF_t get_thread_parallel_conf(void);
+//extern WORKER_CONF_t   get_thread_worker_conf(void);
 extern void phy_init_RU(RU_t *);
 
 void stop_RU(int nb_ru);
diff --git a/targets/RT/USER/lte-softmodem-common.c b/targets/RT/USER/lte-softmodem-common.c
index df7d900fa02..877357fffb6 100644
--- a/targets/RT/USER/lte-softmodem-common.c
+++ b/targets/RT/USER/lte-softmodem-common.c
@@ -34,6 +34,7 @@
 #include "UTIL/OPT/opt.h"
 #include "common/config/config_userapi.h"
 #include "common/utils/load_module_shlib.h"
+#include "executables/thread-common.h"
 #include <dlfcn.h>
 static softmodem_params_t softmodem_params;
 char *parallel_config=NULL;
diff --git a/targets/RT/USER/lte-uesoftmodem.c b/targets/RT/USER/lte-uesoftmodem.c
index 661b6003052..19b78f81788 100644
--- a/targets/RT/USER/lte-uesoftmodem.c
+++ b/targets/RT/USER/lte-uesoftmodem.c
@@ -89,7 +89,6 @@
 #include "lte-softmodem.h"
 
 
-
 /* temporary compilation wokaround (UE/eNB split */
 uint16_t sf_ahead;
 
-- 
GitLab