fix warnings introduced by changes in _Assert_Exit_ macro

parent fcc41355
...@@ -595,7 +595,7 @@ function main() { ...@@ -595,7 +595,7 @@ function main() {
echo_info "Compiling UE specific part" echo_info "Compiling UE specific part"
if [ $UE_ip -eq 1 ] if [ "$UE_ip" = 1 ]
then then
echo_info "Building ue_ip module" echo_info "Building ue_ip module"
compilations $BUILD_DIR ue_ip compilations $BUILD_DIR ue_ip
......
...@@ -30,19 +30,20 @@ ...@@ -30,19 +30,20 @@
#include <platform_types.h> #include <platform_types.h>
#include "backtrace.h" #include "backtrace.h"
#define EXIT_NORMAL 0 #define OAI_EXIT_NORMAL 0
#define EXIT_ASSERT 1 #define OAI_EXIT_ASSERT 1
#define _Assert_Exit_ \ #define _Assert_Exit_ \
if (getenv("gdbStacks")) { \ if (getenv("gdbStacks")) { \
char tmp[1000]; \ char tmp [1000]; \
sprintf(tmp, "gdb -ex='set confirm off' -ex 'thread apply all bt' -ex q -p %d < /dev/null", getpid()); \ sprintf(tmp,"gdb -ex='set confirm off' -ex 'thread apply all bt' -ex q -p %d < /dev/null", getpid()); \
__attribute__((unused)) int dummy = system(tmp); \ __attribute__((unused)) int dummy=system(tmp); \
} \ } \
fprintf(stderr, "\nExiting execution\n"); \ fprintf(stderr, "\nExiting execution\n"); \
fflush(stdout); \ fflush(stdout); \
fflush(stderr); \ fflush(stderr); \
exit_function(__FILE__, __FUNCTION__, __LINE__, "_Assert_Exit_", EXIT_ASSERT); exit_function(__FILE__, __FUNCTION__, __LINE__, "_Assert_Exit_", OAI_EXIT_ASSERT); \
abort(); // to avoid gcc warnings - never executed unless app-specific exit_function() does not exit() nor abort()
#define _Assert_(cOND, aCTION, fORMAT, aRGS...) \ #define _Assert_(cOND, aCTION, fORMAT, aRGS...) \
do { \ do { \
......
...@@ -86,7 +86,7 @@ int32_t uplink_frequency_offset[MAX_NUM_CCs][4]; ...@@ -86,7 +86,7 @@ int32_t uplink_frequency_offset[MAX_NUM_CCs][4];
void nfapi_setmode(nfapi_mode_t nfapi_mode) { return; } void nfapi_setmode(nfapi_mode_t nfapi_mode) { return; }
void exit_function(const char *file, const char *function, const int line, const char *s) { void exit_function(const char *file, const char *function, const int line, const char *s, const int assert) {
if (s != NULL) { if (s != NULL) {
printf("%s:%d %s() Exiting OAI softmodem: %s\n",file,line, function, s); printf("%s:%d %s() Exiting OAI softmodem: %s\n",file,line, function, s);
......
...@@ -40,6 +40,12 @@ RRC_release_list_t rrc_release_info; ...@@ -40,6 +40,12 @@ RRC_release_list_t rrc_release_info;
void exit_function(const char *file, const char *function, const int line, const char *s, const int assert) void exit_function(const char *file, const char *function, const int line, const char *s, const int assert)
{ {
if (assert) {
abort();
} else {
sleep(1); // allow other threads to exit first
exit(EXIT_SUCCESS);
}
} }
nfapi_mode_t nfapi_mod = -1; nfapi_mode_t nfapi_mod = -1;
......
...@@ -288,7 +288,7 @@ void exit_function(const char *file, const char *function, const int line, const ...@@ -288,7 +288,7 @@ void exit_function(const char *file, const char *function, const int line, const
if (assert) { if (assert) {
abort(); abort();
} else { } else {
sleep(1); // allow lte-softmodem threads to exit first sleep(1); // allow nr-softmodem threads to exit first
exit(EXIT_SUCCESS); exit(EXIT_SUCCESS);
} }
} }
......
...@@ -215,7 +215,7 @@ void signal_handler(int sig) { ...@@ -215,7 +215,7 @@ void signal_handler(int sig) {
softmodem_printresources(sig,(telnet_printfunc_t)printf); softmodem_printresources(sig,(telnet_printfunc_t)printf);
if (sig != SOFTMODEM_RTSIGNAL) { if (sig != SOFTMODEM_RTSIGNAL) {
printf("Linux signal %s...\n",strsignal(sig)); printf("Linux signal %s...\n",strsignal(sig));
exit_function(__FILE__, __FUNCTION__, __LINE__, "softmodem starting exit procedure\n", EXIT_NORMAL); exit_function(__FILE__, __FUNCTION__, __LINE__, "softmodem starting exit procedure\n", OAI_EXIT_NORMAL);
} }
} }
} }
......
...@@ -281,7 +281,7 @@ typedef struct protocol_ctxt_s { ...@@ -281,7 +281,7 @@ typedef struct protocol_ctxt_s {
#define CHECK_CTXT_ARGS(CTXT_Pp) #define CHECK_CTXT_ARGS(CTXT_Pp)
#define exit_fun(msg) exit_function(__FILE__, __FUNCTION__, __LINE__, "exit_fun", EXIT_NORMAL) #define exit_fun(msg) exit_function(__FILE__, __FUNCTION__, __LINE__, "exit_fun", OAI_EXIT_NORMAL)
#ifdef __cplusplus #ifdef __cplusplus
extern "C" extern "C"
{ {
......
...@@ -789,7 +789,7 @@ static int trx_usrp_read(openair0_device *device, openair0_timestamp *ptimestamp ...@@ -789,7 +789,7 @@ static int trx_usrp_read(openair0_device *device, openair0_timestamp *ptimestamp
recPlay->nbSamplesBlocks++; recPlay->nbSamplesBlocks++;
LOG_D(HW,"recorded %d samples, for TS %lu, shift in buffer %ld nbBytes %d nbSamplesBlocks %d\n", nsamps, hdr->ts, recPlay->currentPtr-(uint8_t *)recPlay->ms_sample, (int)hdr->nbBytes, (int)recPlay->nbSamplesBlocks); LOG_D(HW,"recorded %d samples, for TS %lu, shift in buffer %ld nbBytes %d nbSamplesBlocks %d\n", nsamps, hdr->ts, recPlay->currentPtr-(uint8_t *)recPlay->ms_sample, (int)hdr->nbBytes, (int)recPlay->nbSamplesBlocks);
} else } else
exit_function(__FILE__, __FUNCTION__, __LINE__, "Recording reaches max iq limit\n", EXIT_NORMAL); exit_function(__FILE__, __FUNCTION__, __LINE__, "Recording reaches max iq limit\n", OAI_EXIT_NORMAL);
} }
read_count++; read_count++;
LOG_D(HW,"usrp_lib: returning %d samples at ts %lu read_count %d\n", samples_received, *ptimestamp, read_count); LOG_D(HW,"usrp_lib: returning %d samples at ts %lu read_count %d\n", samples_received, *ptimestamp, read_count);
......
...@@ -268,7 +268,7 @@ static int trx_iqplayer_read(openair0_device *device, openair0_timestamp *ptimes ...@@ -268,7 +268,7 @@ static int trx_iqplayer_read(openair0_device *device, openair0_timestamp *ptimes
if (s->wrap_count == device->openair0_cfg->recplay_conf->u_sf_loops) { if (s->wrap_count == device->openair0_cfg->recplay_conf->u_sf_loops) {
LOG_W(HW, "iqplayer device terminating subframes replay after %u iteration\n", LOG_W(HW, "iqplayer device terminating subframes replay after %u iteration\n",
device->openair0_cfg->recplay_conf->u_sf_loops); device->openair0_cfg->recplay_conf->u_sf_loops);
exit_function(__FILE__, __FUNCTION__, __LINE__,"replay ended, triggering process termination\n", EXIT_NORMAL); exit_function(__FILE__, __FUNCTION__, __LINE__,"replay ended, triggering process termination\n", OAI_EXIT_NORMAL);
} }
if (s->wrap_count > 0) { if (s->wrap_count > 0) {
......
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