Merge branch 'develop' into feature-merge-f68

This commit is contained in:
Robert Schmidt
2018-02-08 18:05:28 +01:00
401 changed files with 79094 additions and 33801 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
}
}*/
}
+332 -105
View File
@@ -42,17 +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>
# define FIFO_PRINTF_MAX_STRING_SIZE 1000
# define FIFO_PRINTF_NO 62
# define FIFO_PRINTF_SIZE 65536
#endif
#include "common/config/config_userapi.h"
// main log variables
log_t *g_log;
@@ -92,9 +83,7 @@ int log_list_head = 0;
int log_shutdown;
#endif
#ifndef RTAI
static int gfd;
#endif
static char *log_level_highlight_start[] = {LOG_RED, LOG_RED, LOG_RED, LOG_RED, LOG_ORANGE, LOG_BLUE, "", ""}; /*!< \brief Optional start-format strings for highlighting */
static char *log_level_highlight_end[] = {LOG_RESET, LOG_RESET, LOG_RESET, LOG_RESET, LOG_RESET,LOG_RESET, "",""}; /*!< \brief Optional end-format strings for highlighting */
@@ -164,24 +153,12 @@ 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
}
@@ -485,7 +462,6 @@ int logInit (void)
g_log->level = LOG_TRACE;
g_log->flag = LOG_LOW;
#ifndef RTAI
g_log->config.remote_ip = 0;
g_log->config.remote_level = LOG_EMERG;
g_log->config.facility = LOG_LOCAL7;
@@ -513,21 +489,343 @@ int logInit (void)
}
}
#else
g_log->syslog = 0;
g_log->filelog = 0;
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;
}
void nfapi_log(char *file, char *func, int line, int comp, int level, const char* format, va_list args)
{
//logRecord_mt(file,func,line, pthread_self(), comp, level, format, ##args)
int len = 0;
log_component_t *c;
char *log_start;
char *log_end;
/* The main difference with the version above is the use of this local log_buffer.
* The other difference is the return value of snprintf which was not used
* correctly. It was not a big problem because in practice MAX_LOG_TOTAL is
* big enough so that the buffer is never full.
*/
char log_buffer[MAX_LOG_TOTAL];
/* for no gcc warnings */
(void)log_start;
(void)log_end;
c = &g_log->log_component[comp];
// do not apply filtering for LOG_F
// only log messages which are enabled and are below the global log level and component's level threshold
if ((level != LOG_FILE) && ((level > c->level) || (level > g_log->level))) {
/* if ((level != LOG_FILE) &&
((level > c->level) ||
(level > g_log->level) ||
( c->level > g_log->level))) {
*/
return;
}
//VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_LOG_RECORD, VCD_FUNCTION_IN);
// adjust syslog level for TRACE messages
if (g_log->syslog) {
if (g_log->level > LOG_DEBUG) {
g_log->level = LOG_DEBUG;
}
}
// make sure that for log trace the extra info is only printed once, reset when the level changes
if ((level == LOG_FILE) || (c->flag == LOG_NONE) || (level == LOG_TRACE)) {
log_start = log_buffer;
len = vsnprintf(log_buffer, MAX_LOG_TOTAL, format, args);
if (len > MAX_LOG_TOTAL) len = MAX_LOG_TOTAL;
log_end = log_buffer + len;
} else {
if ( (g_log->flag & FLAG_COLOR) || (c->flag & FLAG_COLOR) ) {
len += snprintf(&log_buffer[len], MAX_LOG_TOTAL - len, "%s",
log_level_highlight_start[level]);
if (len > MAX_LOG_TOTAL) len = MAX_LOG_TOTAL;
}
log_start = log_buffer + len;
if ( (g_log->flag & FLAG_COMP) || (c->flag & FLAG_COMP) ) {
len += snprintf(&log_buffer[len], MAX_LOG_TOTAL - len, "[%s]",
g_log->log_component[comp].name);
if (len > MAX_LOG_TOTAL) len = MAX_LOG_TOTAL;
}
if ( (g_log->flag & FLAG_LEVEL) || (c->flag & FLAG_LEVEL) ) {
len += snprintf(&log_buffer[len], MAX_LOG_TOTAL - len, "[%s]",
g_log->level2string[level]);
if (len > MAX_LOG_TOTAL) len = MAX_LOG_TOTAL;
}
if ( (g_log->flag & FLAG_THREAD) || (c->flag & FLAG_THREAD) ) {
# define THREAD_NAME_LEN 128
char threadname[THREAD_NAME_LEN];
if (pthread_getname_np(pthread_self(), threadname, THREAD_NAME_LEN) != 0)
{
perror("pthread_getname_np : ");
} else {
len += snprintf(&log_buffer[len], MAX_LOG_TOTAL - len, "[%s]", threadname);
if (len > MAX_LOG_TOTAL) len = MAX_LOG_TOTAL;
}
# undef THREAD_NAME_LEN
}
if ( (g_log->flag & FLAG_FUNCT) || (c->flag & FLAG_FUNCT) ) {
len += snprintf(&log_buffer[len], MAX_LOG_TOTAL - len, "[%s] ",
func);
if (len > MAX_LOG_TOTAL) len = MAX_LOG_TOTAL;
}
if ( (g_log->flag & FLAG_FILE_LINE) || (c->flag & FLAG_FILE_LINE) ) {
len += snprintf(&log_buffer[len], MAX_LOG_TOTAL - len, "[%s:%d]",
file, line);
if (len > MAX_LOG_TOTAL) len = MAX_LOG_TOTAL;
}
//len += snprintf(&log_buffer[len], MAX_LOG_TOTAL - len, "[%08lx]", thread_id);
//if (len > MAX_LOG_TOTAL) len = MAX_LOG_TOTAL;
len += vsnprintf(&log_buffer[len], MAX_LOG_TOTAL - len, format, args);
if (len > MAX_LOG_TOTAL) len = MAX_LOG_TOTAL;
log_end = log_buffer + len;
if ( (g_log->flag & FLAG_COLOR) || (c->flag & FLAG_COLOR) ) {
len += snprintf(&log_buffer[len], MAX_LOG_TOTAL - len, "%s",
log_level_highlight_end[level]);
if (len > MAX_LOG_TOTAL) len = MAX_LOG_TOTAL;
}
}
va_end(args);
// OAI printf compatibility
if ((g_log->onlinelog == 1) && (level != LOG_FILE))
#ifdef RTAI
if (len > MAX_LOG_TOTAL) {
rt_printk ("[OPENAIR] FIFO_PRINTF WROTE OUTSIDE ITS MEMORY BOUNDARY : ERRORS WILL OCCUR\n");
}
if (len > 0) {
rtf_put (FIFO_PRINTF_NO, log_buffer, len);
}
#else
fwrite(log_buffer, len, 1, stdout);
#endif
#ifndef RTAI
if (g_log->syslog) {
syslog(g_log->level, "%s", log_buffer);
}
if (g_log->filelog) {
if (write(gfd, log_buffer, len) < len) {
// TODO assert ?
}
}
if ((g_log->log_component[comp].filelog) && (level == LOG_FILE)) {
if (write(g_log->log_component[comp].fd, log_buffer, len) < len) {
// TODO assert ?
}
}
#else
// online print messges
if ((g_log->log_component[comp].filelog) && (level == LOG_FILE)) {
printf(log_buffer);
}
#endif
#if defined(ENABLE_ITTI)
if (level <= LOG_DEBUG) {
task_id_t origin_task_id = TASK_UNKNOWN;
MessagesIds messages_id;
MessageDef *message_p;
size_t message_string_size;
char *message_msg_p;
message_string_size = log_end - log_start;
#if !defined(DISABLE_ITTI_DETECT_SUB_TASK_ID)
/* Try to identify sub task ID from log information (comp, log_instance_type) */
switch (comp) {
case PHY:
switch (log_instance_type) {
case LOG_INSTANCE_ENB:
origin_task_id = TASK_PHY_ENB;
break;
case LOG_INSTANCE_UE:
origin_task_id = TASK_PHY_UE;
break;
default:
break;
}
break;
case MAC:
switch (log_instance_type) {
case LOG_INSTANCE_ENB:
origin_task_id = TASK_MAC_ENB;
break;
case LOG_INSTANCE_UE:
origin_task_id = TASK_MAC_UE;
default:
break;
}
break;
case RLC:
switch (log_instance_type) {
case LOG_INSTANCE_ENB:
origin_task_id = TASK_RLC_ENB;
break;
case LOG_INSTANCE_UE:
origin_task_id = TASK_RLC_UE;
default:
break;
}
break;
case PDCP:
switch (log_instance_type) {
case LOG_INSTANCE_ENB:
origin_task_id = TASK_PDCP_ENB;
break;
case LOG_INSTANCE_UE:
origin_task_id = TASK_PDCP_UE;
default:
break;
}
break;
default:
break;
}
#endif
switch (level) {
case LOG_EMERG:
case LOG_ALERT:
case LOG_CRIT:
case LOG_ERR:
messages_id = ERROR_LOG;
break;
case LOG_WARNING:
messages_id = WARNING_LOG;
break;
case LOG_NOTICE:
messages_id = NOTICE_LOG;
break;
case LOG_INFO:
messages_id = INFO_LOG;
break;
default:
messages_id = DEBUG_LOG;
break;
}
message_p = itti_alloc_new_message_sized(origin_task_id, messages_id, message_string_size);
switch (level) {
case LOG_EMERG:
case LOG_ALERT:
case LOG_CRIT:
case LOG_ERR:
message_msg_p = (char *) &message_p->ittiMsg.error_log;
break;
case LOG_WARNING:
message_msg_p = (char *) &message_p->ittiMsg.warning_log;
break;
case LOG_NOTICE:
message_msg_p = (char *) &message_p->ittiMsg.notice_log;
break;
case LOG_INFO:
message_msg_p = (char *) &message_p->ittiMsg.info_log;
break;
default:
message_msg_p = (char *) &message_p->ittiMsg.debug_log;
break;
}
memcpy(message_msg_p, log_start, message_string_size);
itti_send_msg_to_task(TASK_UNKNOWN, INSTANCE_DEFAULT, message_p);
}
#endif
#if 0
LOG_params log_params;
int len;
len = vsnprintf(log_params.l_buff_info, MAX_LOG_INFO-1, format, args);
//2 first parameters must be passed as 'const' to the thread function
log_params.file = strdup(file);
log_params.func = strdup(func);
log_params.line = line;
log_params.comp = PHY;//comp;
log_params.level = 6; // INFO - level;
log_params.format = format;
log_params.len = len;
if (pthread_mutex_lock(&log_lock) != 0) {
return;
}
log_list_tail++;
log_list[log_list_tail - 1] = log_params;
if (log_list_tail >= 1000) {
log_list_tail = 0;
}
if (log_list_nb_elements < 1000) {
log_list_nb_elements++;
}
if(pthread_cond_signal(&log_notify) != 0) {
pthread_mutex_unlock(&log_lock);
return;
}
if(pthread_mutex_unlock(&log_lock) != 0) {
return;
}
#endif
}
//log record: add to a list
void logRecord(const char *file, const char *func, int line, int comp,
int level, const char *format, ...)
@@ -650,23 +948,9 @@ void logRecord_thread_safe(const char *file, const char *func,
// OAI printf compatibility
if ((g_log->onlinelog == 1) && (level != LOG_FILE)) {
#ifdef RTAI
if (len > MAX_LOG_TOTAL) {
rt_printk ("[OPENAIR] FIFO_PRINTF WROTE OUTSIDE ITS MEMORY BOUNDARY : ERRORS WILL OCCUR\n");
}
if (len > 0) {
rtf_put (FIFO_PRINTF_NO, log_buffer, len);
}
#else
fprintf(stdout, "%s", log_buffer);
#endif
}
#ifndef RTAI
if (g_log->syslog) {
syslog(g_log->level, "%s", log_buffer);
}
@@ -683,8 +967,6 @@ void logRecord_thread_safe(const char *file, const char *func,
}
}
#endif
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_LOG_RECORD,
VCD_FUNCTION_OUT);
}
@@ -834,20 +1116,7 @@ void logRecord_mt(const char *file, const char *func, int line, int comp,
// OAI printf compatibility
if ((g_log->onlinelog == 1) && (level != LOG_FILE))
#ifdef RTAI
if (len > MAX_LOG_TOTAL) {
rt_printk ("[OPENAIR] FIFO_PRINTF WROTE OUTSIDE ITS MEMORY BOUNDARY : ERRORS WILL OCCUR\n");
}
if (len > 0) {
rtf_put (FIFO_PRINTF_NO, c->log_buffer, len);
}
#else
fwrite(c->log_buffer, len, 1, stdout);
#endif
#ifndef RTAI
if (g_log->syslog) {
syslog(g_log->level, "%s", c->log_buffer);
@@ -865,15 +1134,6 @@ void logRecord_mt(const char *file, const char *func, int line, int comp,
}
}
#else
// online print messges
if ((g_log->log_component[comp].filelog) && (level == LOG_FILE)) {
printf(c->log_buffer);
}
#endif
#if defined(ENABLE_ITTI)
if (level <= LOG_DEBUG) {
@@ -1132,20 +1392,7 @@ void logRecord_mt(const char *file, const char *func, int line, int comp,
// OAI printf compatibility
if ((g_log->onlinelog == 1) && (level != LOG_FILE))
#ifdef RTAI
if (len > MAX_LOG_TOTAL) {
rt_printk ("[OPENAIR] FIFO_PRINTF WROTE OUTSIDE ITS MEMORY BOUNDARY : ERRORS WILL OCCUR\n");
}
if (len > 0) {
rtf_put (FIFO_PRINTF_NO, log_buffer, len);
}
#else
fwrite(log_buffer, len, 1, stdout);
#endif
#ifndef RTAI
if (g_log->syslog) {
syslog(g_log->level, "%s", log_buffer);
@@ -1163,15 +1410,6 @@ void logRecord_mt(const char *file, const char *func, int line, int comp,
}
}
#else
// online print messges
if ((g_log->log_component[comp].filelog) && (level == LOG_FILE)) {
printf(log_buffer);
}
#endif
#if defined(ENABLE_ITTI)
if (level <= LOG_DEBUG) {
@@ -1398,16 +1636,11 @@ void set_component_filelog(int comp)
{
if (g_log->log_component[comp].filelog == 0) {
g_log->log_component[comp].filelog = 1;
#ifndef RTAI
if (g_log->log_component[comp].fd == 0) {
g_log->log_component[comp].fd = open(g_log->log_component[comp].filelog_name,
O_WRONLY | O_CREAT | O_TRUNC, 0666);
}
#else
#endif
}
}
@@ -1463,9 +1696,6 @@ int is_newline( char *str, int size)
void logClean (void)
{
#ifdef RTAI
rtf_destroy (FIFO_PRINTF_NO);
#else
int i;
if (g_log->syslog) {
@@ -1481,9 +1711,6 @@ void logClean (void)
close(g_log->log_component[i].fd);
}
}
#endif
}
#if defined(ENABLE_ITTI)
-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
/* @}*/
+11 -13
View File
@@ -48,10 +48,6 @@
#include "vcd_signal_dumper.h"
#if defined(ENABLE_RTAI_CLOCK)
#include "rtai_lxrt.h"
#endif
#define VCDSIGNALDUMPER_VERSION_MAJOR 0
#define VCDSIGNALDUMPER_VERSION_MINOR 1
@@ -399,6 +395,17 @@ const char* eurecomFunctionsNames[] = {
"compress_if",
"decompress_if",
"nfapi_subframe",
"generate_pcfich",
"generate_dci0",
"generate_dlsch",
"generate_phich",
"pdcch_scrambling",
"pdcch_modulation",
"pdcch_interleaving",
"pdcch_tx",
};
struct vcd_module_s vcd_modules[] = {
@@ -412,8 +419,6 @@ static inline unsigned long long int vcd_get_time(void);
#if defined(ENABLE_USE_CPU_EXECUTION_TIME)
struct timespec g_time_start;
#elif defined(ENABLE_RTAI_CLOCK)
RTIME start;
#endif
@@ -609,8 +614,6 @@ void vcd_signal_dumper_init(char *filename)
#if defined(ENABLE_USE_CPU_EXECUTION_TIME)
clock_gettime(CLOCK_MONOTONIC, &g_time_start);
#elif defined(ENABLE_RTAI_CLOCK)
start=rt_get_time_ns();
#endif
vcd_signal_dumper_create_header();
@@ -663,9 +666,6 @@ static inline void vcd_signal_dumper_print_time_since_start(void)
secondsSinceStart = (long long unsigned int)time.tv_sec - (long long unsigned int)g_time_start.tv_sec;
/* Write time in nanoseconds */
fprintf(vcd_fd, "#%llu\n", nanosecondsSinceStart + (secondsSinceStart * 1000000000UL));
#elif defined(ENABLE_RTAI_CLOCK)
/* Write time in nanoseconds */
fprintf(vcd_fd, "#%llu\n",rt_get_time_ns()-start);
#endif
}
}
@@ -679,8 +679,6 @@ static inline unsigned long long int vcd_get_time(void)
return (long long unsigned int)((time.tv_nsec - g_time_start.tv_nsec)) +
((long long unsigned int)time.tv_sec - (long long unsigned int)g_time_start.tv_sec) * 1000000000UL;
#elif defined(ENABLE_RTAI_CLOCK)
return rt_get_time_ns() - start;
#endif
}
+10
View File
@@ -376,6 +376,16 @@ typedef enum {
VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_COMPR_IF,
VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_DECOMPR_IF,
VCD_SIGNAL_DUMPER_FUNCTIONS_NFAPI,
VCD_SIGNAL_DUMPER_FUNCTIONS_GENERATE_PCFICH,
VCD_SIGNAL_DUMPER_FUNCTIONS_GENERATE_DCI0,
VCD_SIGNAL_DUMPER_FUNCTIONS_GENERATE_DLSCH,
VCD_SIGNAL_DUMPER_FUNCTIONS_GENERATE_PHICH,
VCD_SIGNAL_DUMPER_FUNCTIONS_PDCCH_SCRAMBLING,
VCD_SIGNAL_DUMPER_FUNCTIONS_PDCCH_MODULATION,
VCD_SIGNAL_DUMPER_FUNCTIONS_PDCCH_INTERLEAVING,
VCD_SIGNAL_DUMPER_FUNCTIONS_PDCCH_TX,
VCD_SIGNAL_DUMPER_FUNCTIONS_END
} vcd_signal_dump_functions;
+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
}
-9
View File
@@ -29,21 +29,12 @@
* @ingroup util
*/
#ifndef RTAI_ENABLED
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <math.h>
#include "oml.h"
#else
#include <asm/io.h>
#include <asm/rtai.h>
#include <rtai.h>
#include <rtai_sched.h>
#define time(x) (unsigned int)(rt_get_time_ns())
#endif
unsigned int s0[MAX_NUM_COMPS], s1[MAX_NUM_COMPS], s2[MAX_NUM_COMPS], b[MAX_NUM_COMPS], r[MAX_NUM_COMPS];
+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 -3
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 -DNB_ANTENNAS_RX=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
@@ -22,8 +22,6 @@ ifdef PDCP_USE_NETLINK
CFLAGS += -DPDCP_USE_NETLINK -DLINUX -DDEBUG_CONTROL
endif
CFLAGS += -DPHY_ABSTRACTION
#ifdef OCG
CFLAGS += -I/usr/include/libxml2 -lxml2
#endif
+1 -3
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 -DNB_ANTENNAS_RX=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
@@ -75,8 +75,6 @@ ifdef PDCP_USE_NETLINK
CFLAGS += -DPDCP_USE_NETLINK -DLINUX -DDEBUG_CONTROL
endif
CFLAGS += -DPHY_ABSTRACTION
include $(OPENAIR1_DIR)/PHY/Makefile.inc
include $(OPENAIR1_DIR)/SCHED/Makefile.inc
include $(OPENAIR2_DIR)/LAYER2/Makefile.inc
+1 -3
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 -DNB_ANTENNAS_RX=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
@@ -77,8 +77,6 @@ ifdef PDCP_USE_NETLINK
CFLAGS += -DPDCP_USE_NETLINK -DLINUX -DDEBUG_CONTROL
endif
CFLAGS += -DPHY_ABSTRACTION
include $(OPENAIR1_DIR)/PHY/Makefile.inc
include $(OPENAIR1_DIR)/SCHED/Makefile.inc
include $(OPENAIR2_DIR)/LAYER2/Makefile.inc
+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
-10
View File
@@ -410,18 +410,8 @@ static int MAC_LTE_PCAP_WritePDU(MAC_Context_Info_t *context,
/* PCAP Header */
/* TODO: Timestamp might want to be relative to a more sensible
base time... */
#if defined(RTAI)
{
unsigned long long int current_ns;
current_ns = rt_get_time_ns();
packet_header.ts_sec = current_ns / 1000000000UL;
packet_header.ts_usec = current_ns % 1000;
}
#else
packet_header.ts_sec = context->subframesSinceCaptureStart / 1000;
packet_header.ts_usec = (context->subframesSinceCaptureStart % 1000) * 1000;
#endif
packet_header.incl_len = offset + length;
packet_header.orig_len = offset + length;
+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