Commit eaa83242 authored by Florian Kaltenberger's avatar Florian Kaltenberger

first try to add a function to the usrp_lib to set the thread priority

parent c91a1fc4
...@@ -98,7 +98,7 @@ typedef int(*devfunc_t)(openair0_device *, openair0_config_t *, eth_params_t *); ...@@ -98,7 +98,7 @@ typedef int(*devfunc_t)(openair0_device *, openair0_config_t *, eth_params_t *);
/* look for the interface library and load it */ /* look for the interface library and load it */
int load_lib(openair0_device *device, openair0_config_t *openair0_cfg, eth_params_t * cfg, uint8_t flag) { int load_lib(openair0_device *device, openair0_config_t *openair0_cfg, eth_params_t * cfg, uint8_t flag) {
loader_shlibfunc_t shlib_fdesc[1]; loader_shlibfunc_t shlib_fdesc[2];
int ret=0; int ret=0;
char *libname; char *libname;
if (flag == RAU_LOCAL_RADIO_HEAD) { if (flag == RAU_LOCAL_RADIO_HEAD) {
...@@ -107,15 +107,17 @@ int load_lib(openair0_device *device, openair0_config_t *openair0_cfg, eth_param ...@@ -107,15 +107,17 @@ int load_lib(openair0_device *device, openair0_config_t *openair0_cfg, eth_param
else else
libname=OAI_RF_LIBNAME; libname=OAI_RF_LIBNAME;
shlib_fdesc[0].fname="device_init"; shlib_fdesc[0].fname="device_init";
shlib_fdesc[1].fname="uhd_set_thread_priority";
} else { } else {
libname=OAI_TP_LIBNAME; libname=OAI_TP_LIBNAME;
shlib_fdesc[0].fname="transport_init"; shlib_fdesc[0].fname="transport_init";
} }
ret=load_module_shlib(libname,shlib_fdesc,1,NULL); ret=load_module_shlib(libname,shlib_fdesc,2,NULL);
if (ret < 0) { if (ret < 0) {
LOG_E(HW,"Library %s couldn't be loaded\n",libname); LOG_E(HW,"Library %s couldn't be loaded\n",libname);
} else { } else {
ret=((devfunc_t)shlib_fdesc[0].fptr)(device,openair0_cfg,cfg); ret=((devfunc_t)shlib_fdesc[0].fptr)(device,openair0_cfg,cfg);
uhd_set_thread_priority_fun = (set_prio_func_t)shlib_fdesc[1].fptr;
} }
return ret; return ret;
} }
......
...@@ -445,6 +445,10 @@ int openair0_set_rx_frequencies(openair0_device *device, openair0_config_t *open ...@@ -445,6 +445,10 @@ int openair0_set_rx_frequencies(openair0_device *device, openair0_config_t *open
#define gettid() syscall(__NR_gettid) #define gettid() syscall(__NR_gettid)
/*@}*/ /*@}*/
void uhd_set_thread_priority(void);
typedef void(*set_prio_func_t)(void);
set_prio_func_t uhd_set_thread_priority_fun;
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
......
...@@ -1461,5 +1461,10 @@ extern "C" { ...@@ -1461,5 +1461,10 @@ extern "C" {
#endif #endif
return 0; return 0;
} }
void uhd_set_thread_priority(void) {
uhd::set_thread_priority_safe(1.0);
}
} }
/*@}*/ /*@}*/
...@@ -1285,6 +1285,7 @@ static void* ru_thread_tx( void* param ) { ...@@ -1285,6 +1285,7 @@ static void* ru_thread_tx( void* param ) {
wait_on_condition(&proc->mutex_FH1,&proc->cond_FH1,&proc->instance_cnt_FH1,"ru_thread_tx"); wait_on_condition(&proc->mutex_FH1,&proc->cond_FH1,&proc->instance_cnt_FH1,"ru_thread_tx");
uhd_set_thread_priority_fun();
while (!oai_exit) { while (!oai_exit) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment