Fix #582, USER_MODE flag removed

This commit is contained in:
bruno mongazon
2018-01-11 16:50:50 +01:00
parent a2d16b34dd
commit afcc9aabd8
125 changed files with 69 additions and 1074 deletions
-6
View File
@@ -38,11 +38,7 @@
***************************************************************************/
#define LIST2_C
#include "list.h"
#ifdef USER_MODE
#include "assertions.h"
#else
#define NULL 0
#endif
#include <string.h>
@@ -336,9 +332,7 @@ list2_display (list2_t * listP)
nb_elements++;
}
msg (" found nb_elements %d nb_elements %d\n", nb_elements, listP->nb_elements);
#ifdef USER_MODE
AssertFatal(nb_elements == listP->nb_elements, "Bad count of elements %d != %d", nb_elements, listP->nb_elements);
#endif
}
}*/
}
-16
View File
@@ -42,10 +42,8 @@
# include "intertask_interface.h"
#endif
#ifdef USER_MODE
# include <pthread.h>
# include <string.h>
#endif
#ifdef RTAI
# include <rtai.h>
# include <rtai_fifos.h>
@@ -164,24 +162,14 @@ void log_getconfig(log_t *g_log) {
int logInit (void)
{
#ifdef USER_MODE
#ifndef RTAI
int i;
#endif
g_log = calloc(1, sizeof(log_t));
#else
g_log = kmalloc(sizeof(log_t), GFP_KERNEL);
#endif
if (g_log == NULL) {
#ifdef USER_MODE
perror ("cannot allocated memory for log generation module \n");
exit(EXIT_FAILURE);
#else
printk("cannot allocated memory for log generation module \n");
return(-1);
#endif
}
@@ -519,11 +507,7 @@ int logInit (void)
rtf_create (FIFO_PRINTF_NO, FIFO_PRINTF_SIZE);
#endif
#ifdef USER_MODE
printf("log init done\n");
#else
printk("log init done\n");
#endif
return 0;
}
-25
View File
@@ -32,7 +32,6 @@
# define __LOG_H__
/*--- INCLUDES ---------------------------------------------------------------*/
#ifdef USER_MODE
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
@@ -53,9 +52,6 @@
#define _GNU_SOURCE
#endif
#include <pthread.h>
#else
#include "rtai_fifos.h"
#endif
/*----------------------------------------------------------------------------*/
@@ -282,20 +278,11 @@ void *log_thread_function(void * list);
* @ingroup _macro
* @brief Macro used to call tr_log_full_ex with file, function and line information
* @{*/
#ifdef USER_MODE
//#define logIt(component, level, format, args...) do {logRecord(__FILE__, __FUNCTION__, __LINE__, component, level, format, ##args);} while(0);
#ifdef LOG_NO_THREAD
#define logIt(component, level, format, args...) logRecord_mt(__FILE__, __FUNCTION__, __LINE__, component, level, format, ##args)
#else //default
#define logIt(component, level, format, args...) logRecord(__FILE__, __FUNCTION__, __LINE__, component, level, format, ##args)
#endif
#else
#ifdef LOG_NO_THREAD
#define logIt(component, level, format, args...) logRecord_mt(NULL, __FUNCTION__, __LINE__, component, level, format, ##args)
#else // default
#define logIt(component, level, format, args...) logRecord(NULL, __FUNCTION__, __LINE__, component, level, format, ##args)
#endif
#endif
/* @}*/
/*----------------macro definitions for reading log configuration from the config module */
@@ -326,7 +313,6 @@ void *log_thread_function(void * list);
* @{*/
// debugging macros
#ifdef USER_MODE
# if T_TRACER
# include "T.h"
# define LOG_I(c, x...) T(T_LEGACY_ ## c ## _INFO, T_PRINTF(x))
@@ -364,17 +350,6 @@ void *log_thread_function(void * list);
# define LOG_T(c, x...) logIt(c, LOG_TRACE, x)
# endif /*DISABLE_LOG_X*/
# endif /* T_TRACER */
#else /* USER_MODE */
# define LOG_G(c, x...) printk(x)
# define LOG_A(c, x...) printk(x)
# define LOG_C(c, x...) printk(x)
# define LOG_E(c, x...) printk(x)
# define LOG_W(c, x...) printk(x)
# define LOG_N(c, x...) printk(x)
# define LOG_I(c, x...) printk(x)
# define LOG_D(c, x...) printk(x)
# define LOG_T(c, x...) printk(x)
#endif
/* @}*/
+1 -9
View File
@@ -29,11 +29,7 @@
#include "rtos_header.h"
#include "platform_types.h"
#ifdef USER_MODE
# include <sys/time.h>
#else
#include <rtai_sched.h>
#endif
#include <sys/time.h>
/* Random generators */
@@ -47,7 +43,6 @@ static int seed;
void
init_uniform (void)
{
#ifdef USER_MODE
struct timeval tv;
struct timezone tz;
@@ -61,9 +56,6 @@ init_uniform (void)
#warning TO DO seed = rgId
//seed += rgId;
#endif
#else
seed = rt_get_time_ns();
#endif
}
+1 -3
View File
@@ -54,7 +54,7 @@ static pthread_mutex_t mtex = PTHREAD_MUTEX_INITIALIZER;
//#define DEBUG_MEM_MNGT_ALLOC_SIZE
//#define DEBUG_MEM_MNGT_ALLOC
//-----------------------------------------------------------------------------
#if defined(USER_MODE) && defined(DEBUG_MEM_MNGT_ALLOC)
#if defined(DEBUG_MEM_MNGT_ALLOC)
uint32_t counters[14] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
#endif
//-----------------------------------------------------------------------------
@@ -269,10 +269,8 @@ get_free_mem_block (uint32_t sizeP, const char* caller)
#ifdef DEBUG_MEM_MNGT_ALLOC
LOG_E (RLC,"[MEM_MNGT][ERROR][MINOR] memory pool %d is empty trying next pool alloc count = %d\n", pool_selected, counters[pool_selected]);
#ifdef USER_MODE
// display_mem_load ();
// check_mem_area ((void *)&mem_block_var);
#endif
#endif
} while (pool_selected++ < 12);
-13
View File
@@ -31,9 +31,7 @@
#ifndef __MEM_BLOCK_H__
# define __MEM_BLOCK_H__
#ifdef USER_MODE
#include <stdint.h>
#endif
#ifdef MEM_BLOCK_C
# define public_mem_block(x) x
# define private_mem_block(x) x
@@ -63,19 +61,8 @@ public_mem_block(mem_block_t *copy_mem_block (mem_block_t * leP, mem_block_t * d
public_mem_block(void display_mem_load (void);)
public_mem_block(void check_mem_area (void);)
# ifdef USER_MODE
private_mem_block(void check_free_mem_block (mem_block_t * leP);)
# endif
#ifdef USER_MODE
//# define MEM_SCALE MAX_MOBILES_PER_ENB*NB_RB_MAX
# define MEM_SCALE MAX_MOBILES_PER_ENB
#else
# ifdef NODE_RG
# define MEM_SCALE 2
# else
# define MEM_SCALE 1
# endif
#endif
// definition of the size of the allocated memory area
# define MEM_MNGT_MB0_BLOCK_SIZE 64
// 64
-4
View File
@@ -49,9 +49,7 @@
//
#endif
//-----------------------------------------------------------------------------
#ifdef USER_MODE
uint32_t counters[11] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
#endif
//-----------------------------------------------------------------------------
/*
* initialize all ures
@@ -227,10 +225,8 @@ get_free_mem_block (uint16_t sizeP, __func__)
#ifdef DEBUG_MEM_MNGT_ALLOC
msg ("[MEM_MNGT][ERROR][MINOR] memory pool %d is empty trying next pool alloc count = %d\n", pool_selected, counters[pool_selected]);
# ifdef USER_MODE
display_mem_load ();
check_mem_area (mem);
# endif
#endif
} while (pool_selected++ < 9);
+1 -1
View File
@@ -7,7 +7,7 @@ OPENAIR2_TOP = ../../../openair2
OPENAIR3_TOP = ../../../openair3
OPENAIR3 = $(OPENAIR3_DIR)
CFLAGS += -DPHYSIM -DNODE_RG -DUSER_MODE -DPC_TARGET -DPC_DSP -DNB_ANTENNAS_RX=2 -DNB_ANTENNAS_TXRX=2 -DNB_ANTENNAS_TX=2 -DMAX_MODULES=1 -I/usr/include/X11 #-Wno-packed-bitfield-compat
CFLAGS += -DPHYSIM -DNODE_RG -DPC_TARGET -DPC_DSP -DNB_ANTENNAS_RX=2 -DNB_ANTENNAS_TXRX=2 -DNB_ANTENNAS_TX=2 -DMAX_MODULES=1 -I/usr/include/X11 #-Wno-packed-bitfield-compat
CFLAGS += -m32 -DOPENAIR_LTE -DOPENAIR2 #-DOFDMA_ULSCH -DIFFT_FPGA -DIFFT_FPGA_UE
+1 -1
View File
@@ -60,7 +60,7 @@ OPENAIR2_TOP = ../../../openair2
OPENAIR3_TOP = ../../../openair3
OPENAIR3 = $(OPENAIR3_DIR)
CFLAGS += -DPHYSIM -DNODE_RG -DUSER_MODE -DPC_TARGET -DPC_DSP -DNB_ANTENNAS_RX=2 -DNB_ANTENNAS_TXRX=2 -DNB_ANTENNAS_TX=2 -DMAX_MODULES=1 -I/usr/include/X11 #-Wno-packed-bitfield-compat
CFLAGS += -DPHYSIM -DNODE_RG -DPC_TARGET -DPC_DSP -DNB_ANTENNAS_RX=2 -DNB_ANTENNAS_TXRX=2 -DNB_ANTENNAS_TX=2 -DMAX_MODULES=1 -I/usr/include/X11 #-Wno-packed-bitfield-compat
CFLAGS += -DOPENAIR_LTE -DOPENAIR2 #-DOFDMA_ULSCH -DIFFT_FPGA -DIFFT_FPGA_UE
+1 -1
View File
@@ -62,7 +62,7 @@ OPENAIR2_TOP = ../../../openair2
OPENAIR3_TOP = ../../../openair3
OPENAIR3 = $(OPENAIR3_DIR)
CFLAGS += -DPHYSIM -DNODE_RG -DUSER_MODE -DPC_TARGET -DPC_DSP -DNB_ANTENNAS_RX=2 -DNB_ANTENNAS_TXRX=2 -DNB_ANTENNAS_TX=2 -DMAX_MODULES=1 -I/usr/include/X11 #-Wno-packed-bitfield-compat
CFLAGS += -DPHYSIM -DNODE_RG -DPC_TARGET -DPC_DSP -DNB_ANTENNAS_RX=2 -DNB_ANTENNAS_TXRX=2 -DNB_ANTENNAS_TX=2 -DMAX_MODULES=1 -I/usr/include/X11 #-Wno-packed-bitfield-compat
CFLAGS += -DOPENAIR_LTE -DOPENAIR2 #-DOFDMA_ULSCH -DIFFT_FPGA -DIFFT_FPGA_UE
+1 -1
View File
@@ -8,7 +8,7 @@ OBJsumo = omg.c common.c sumo.c client_traci_OMG.c socket_traci_OMG.c storage_tr
OBJ = omg.c common.c static.c job.c rwp.c rwalk.c trace.c steadystaterwp.c sumo.c grid.c mobility_parser.c hashtable.c client_traci_OMG.c socket_traci_OMG.c storage_traci_OMG.c id_manager.c
CFLAGS += -DSTANDALONE -DUSER_MODE -g
CFLAGS += -DSTANDALONE -g
.PHONY: help staticOMG rwpOMG clean
+1 -10
View File
@@ -28,14 +28,5 @@
***************************************************************************/
#ifndef __PRINT_H__
# define __PRINT_H__
# ifdef USER_MODE
# define msg printf
# else
# ifdef FIFO_PRINTF
# include "fifo_printf_proto_extern.h"
# define msg fifo_printf
# else
# define msg fifo_printf_null
# endif
# endif
# define msg printf
#endif