Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-RAN
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Michael Black
OpenXG-RAN
Commits
d76ac327
Commit
d76ac327
authored
Jul 03, 2018
by
laurent
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove public/protected macros in lists, mem_blocks
parent
45599fe4
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
92 additions
and
143 deletions
+92
-143
openair2/UTIL/CLI/cli_if.h
openair2/UTIL/CLI/cli_if.h
+4
-20
openair2/UTIL/FIFO/pad_list.h
openair2/UTIL/FIFO/pad_list.h
+29
-44
openair2/UTIL/LISTS/list.h
openair2/UTIL/LISTS/list.h
+27
-57
openair2/UTIL/MEM/mem_block.h
openair2/UTIL/MEM/mem_block.h
+32
-22
No files found.
openair2/UTIL/CLI/cli_if.h
View file @
d76ac327
...
...
@@ -38,30 +38,14 @@
extern
"C"
{
#endif
# ifdef COMPONENT_CLI
# ifdef COMPONENT_CLI_IF
# define private_cli_if(x) x
# define friend_cli_if(x) x
# define public_cli_if(x) x
# else
# define private_cli_if(x)
# define friend_cli_if(x) extern x
# define public_cli_if(x) extern x
# endif
# else
# define private_cli_if(x)
# define friend_cli_if(x)
# define public_cli_if(x) extern x
# endif
/** @defgroup _cli_if Interfaces of CLI
* @{*/
public_cli_if
(
void
cli_init
(
void
);
)
public_cli_if
(
int
cli_server_init
(
cli_handler_t
handler
);
)
public_cli_if
(
void
cli_server_cleanup
(
void
);)
public_cli_if
(
void
cli_server_recv
(
const
void
*
data
,
socklen_t
len
);)
void
cli_init
(
void
);
int
cli_server_init
(
cli_handler_t
handler
);
void
cli_server_cleanup
(
void
);
void
cli_server_recv
(
const
void
*
data
,
socklen_t
len
);
/* @}*/
#ifdef __cplusplus
...
...
openair2/UTIL/FIFO/pad_list.h
View file @
d76ac327
...
...
@@ -32,21 +32,6 @@
#include "types.h"
//-----------------------------------------------------------------------------
# ifdef list_C
# define private_list(x) x
# define public_list(x) x
# else
# define private_list(x)
# define public_list(x) extern x
# endif
# ifdef LIST2_C
# define private_list2(x) x
# define public_list2(x) x
# else
# define private_list2(x)
# define public_list2(x) extern x
# endif
//-----------------------------------------------------------------------------
typedef
struct
Job_List_s
{
Job_elt_t
*
head
;
...
...
@@ -67,36 +52,36 @@ typedef struct Packet_OTG_List_s {
}
Packet_OTG_List_t
;
//-----------------------------------------------------------------------------
public_list
(
void
job_list_init
(
Job_List_t
*
);)
public_list
(
void
job_list_free
(
Job_List_t
*
listP
);)
public_list
(
Job_elt_t
*
job_list_get_head
(
Job_List_t
*
);)
public_list
(
Job_elt_t
*
job_list_remove_head
(
Job_List_t
*
);)
public_list
(
Job_elt_t
*
job_list_remove_element
(
Job_elt_t
*
,
Job_List_t
*
);)
public_list
(
void
job_list_add_head
(
Job_elt_t
*
,
Job_List_t
*
);)
public_list
(
void
job_list_add_tail_eurecom
(
Job_elt_t
*
,
Job_List_t
*
);)
public_list
(
void
job_list_add_list
(
Job_List_t
*
,
Job_List_t
*
);)
public_list
(
void
job_list_display
(
Job_List_t
*
);)
void
job_list_init
(
Job_List_t
*
);
void
job_list_free
(
Job_List_t
*
listP
);
Job_elt_t
*
job_list_get_head
(
Job_List_t
*
);
Job_elt_t
*
job_list_remove_head
(
Job_List_t
*
);
Job_elt_t
*
job_list_remove_element
(
Job_elt_t
*
,
Job_List_t
*
);
void
job_list_add_head
(
Job_elt_t
*
,
Job_List_t
*
);
void
job_list_add_tail_eurecom
(
Job_elt_t
*
,
Job_List_t
*
);
void
job_list_add_list
(
Job_List_t
*
,
Job_List_t
*
);
void
job_list_display
(
Job_List_t
*
);
public_list
(
void
event_list_init
(
Event_List_t
*
);)
public_list
(
void
event_list_free
(
Event_List_t
*
listP
);)
public_list
(
Event_elt_t
*
event_list_get_head
(
Event_List_t
*
);)
public_list
(
Event_elt_t
*
event_list_remove_head
(
Event_List_t
*
);)
public_list
(
Event_elt_t
*
event_list_remove_element
(
Event_elt_t
*
,
Event_List_t
*
);)
public_list
(
void
event_list_add_head
(
Event_elt_t
*
,
Event_List_t
*
);)
public_list
(
void
event_list_add_element
(
Event_elt_t
*
,
Event_elt_t
*
,
Event_List_t
*
);)
public_list
(
void
event_list_add_tail_eurecom
(
Event_elt_t
*
,
Event_List_t
*
);)
public_list
(
void
event_list_add_list
(
Event_List_t
*
,
Event_List_t
*
);)
public_list
(
void
event_list_display
(
Event_List_t
*
);)
void
event_list_init
(
Event_List_t
*
);
void
event_list_free
(
Event_List_t
*
listP
);
Event_elt_t
*
event_list_get_head
(
Event_List_t
*
);
Event_elt_t
*
event_list_remove_head
(
Event_List_t
*
);
Event_elt_t
*
event_list_remove_element
(
Event_elt_t
*
,
Event_List_t
*
);
void
event_list_add_head
(
Event_elt_t
*
,
Event_List_t
*
);
void
event_list_add_element
(
Event_elt_t
*
,
Event_elt_t
*
,
Event_List_t
*
);
void
event_list_add_tail_eurecom
(
Event_elt_t
*
,
Event_List_t
*
);
void
event_list_add_list
(
Event_List_t
*
,
Event_List_t
*
);
void
event_list_display
(
Event_List_t
*
);
public_list
(
void
pkt_list_init
(
Packet_OTG_List_t
*
);)
public_list
(
void
pkt_list_free
(
Packet_OTG_List_t
*
listP
);)
public_list
(
Packet_otg_elt_t
*
pkt_list_get_head
(
Packet_OTG_List_t
*
);)
public_list
(
Packet_otg_elt_t
*
pkt_list_remove_head
(
Packet_OTG_List_t
*
);)
public_list
(
Packet_otg_elt_t
*
pkt_list_remove_element
(
Packet_otg_elt_t
*
,
Packet_OTG_List_t
*
);)
public_list
(
void
pkt_list_add_head
(
Packet_otg_elt_t
*
,
Packet_OTG_List_t
*
);)
public_list
(
void
pkt_list_add_element
(
Packet_otg_elt_t
*
,
Packet_otg_elt_t
*
,
Packet_OTG_List_t
*
);)
public_list
(
void
pkt_list_add_tail_eurecom
(
Packet_otg_elt_t
*
,
Packet_OTG_List_t
*
);)
public_list
(
void
pkt_list_add_list
(
Packet_OTG_List_t
*
,
Packet_OTG_List_t
*
);)
public_list
(
void
pkt_list_display
(
Packet_OTG_List_t
*
);)
void
pkt_list_init
(
Packet_OTG_List_t
*
);
void
pkt_list_free
(
Packet_OTG_List_t
*
listP
);
Packet_otg_elt_t
*
pkt_list_get_head
(
Packet_OTG_List_t
*
);
Packet_otg_elt_t
*
pkt_list_remove_head
(
Packet_OTG_List_t
*
);
Packet_otg_elt_t
*
pkt_list_remove_element
(
Packet_otg_elt_t
*
,
Packet_OTG_List_t
*
);
void
pkt_list_add_head
(
Packet_otg_elt_t
*
,
Packet_OTG_List_t
*
);
void
pkt_list_add_element
(
Packet_otg_elt_t
*
,
Packet_otg_elt_t
*
,
Packet_OTG_List_t
*
);
void
pkt_list_add_tail_eurecom
(
Packet_otg_elt_t
*
,
Packet_OTG_List_t
*
);
void
pkt_list_add_list
(
Packet_OTG_List_t
*
,
Packet_OTG_List_t
*
);
void
pkt_list_display
(
Packet_OTG_List_t
*
);
#endif
openair2/UTIL/LISTS/list.h
View file @
d76ac327
...
...
@@ -39,66 +39,36 @@
#ifndef __LIST_H__
# define __LIST_H__
# include "UTIL/MEM/mem_block.h"
//-----------------------------------------------------------------------------
# ifdef LIST_C
# define private_list(x) x
# define public_list(x) x
# else
# define private_list(x)
# define public_list(x) extern x
# endif
# ifdef LIST2_C
# define private_list2(x) x
# define public_list2(x) x
# else
# define private_list2(x)
# define public_list2(x) extern x
# endif
//-----------------------------------------------------------------------------
#include "platform_constants.h"
#include<linux/types.h>
#include<stdlib.h>
#include<sys/queue.h>
#
define LIST_NAME_MAX_CHAR 32
#
include "UTIL/MEM/mem_block.h"
typedef
struct
{
struct
mem_block_t
*
head
;
struct
mem_block_t
*
tail
;
int
nb_elements
;
char
name
[
LIST_NAME_MAX_CHAR
];
}
list2_t
;
//-----------------------------------------------------------------------------
typedef
struct
{
struct
mem_block_t
*
head
;
struct
mem_block_t
*
tail
;
int
nb_elements
;
char
name
[
LIST_NAME_MAX_CHAR
];
}
list_t
;
//-----------------------------------------------------------------------------
public_list
(
void
list_init
(
list_t
*
,
char
*
);)
public_list
(
void
list_free
(
list_t
*
listP
);)
public_list
(
mem_block_t
*
list_get_head
(
list_t
*
);)
public_list
(
mem_block_t
*
list_remove_head
(
list_t
*
);)
public_list
(
mem_block_t
*
list_remove_element
(
mem_block_t
*
,
list_t
*
);)
public_list
(
void
list_add_head
(
mem_block_t
*
,
list_t
*
);)
public_list
(
void
list_add_tail_eurecom
(
mem_block_t
*
,
list_t
*
);)
public_list
(
void
list_add_list
(
list_t
*
,
list_t
*
);)
public_list
(
void
list_display
(
list_t
*
);)
void
list_init
(
list_t
*
,
char
*
);
void
list_free
(
list_t
*
listP
);
mem_block_t
*
list_get_head
(
list_t
*
);
mem_block_t
*
list_remove_head
(
list_t
*
);
mem_block_t
*
list_remove_element
(
mem_block_t
*
,
list_t
*
);
void
list_add_head
(
mem_block_t
*
,
list_t
*
);
void
list_add_tail_eurecom
(
mem_block_t
*
,
list_t
*
);
void
list_add_list
(
list_t
*
,
list_t
*
);
void
list_display
(
list_t
*
);
//-----------------------------------------------------------------------------
public_list2
(
void
list2_init
(
list2_t
*
,
char
*
);)
public_list2
(
void
list2_free
(
list2_t
*
);)
public_list2
(
mem_block_t
*
list2_get_head
(
list2_t
*
);)
public_list2
(
mem_block_t
*
list2_get_tail
(
list2_t
*
);)
public_list2
(
mem_block_t
*
list2_remove_element
(
mem_block_t
*
,
list2_t
*
);)
public_list2
(
mem_block_t
*
list2_remove_head
(
list2_t
*
);)
public_list2
(
mem_block_t
*
list2_remove_tail
(
list2_t
*
);)
public_list2
(
void
list2_add_head
(
mem_block_t
*
,
list2_t
*
);)
public_list2
(
void
list2_add_tail
(
mem_block_t
*
,
list2_t
*
);)
public_list2
(
void
list2_add_list
(
list2_t
*
,
list2_t
*
);)
public_list2
(
void
list2_display
(
list2_t
*
);)
void
list2_init
(
list2_t
*
,
char
*
);
void
list2_free
(
list2_t
*
);
mem_block_t
*
list2_get_head
(
list2_t
*
);
mem_block_t
*
list2_get_tail
(
list2_t
*
);
mem_block_t
*
list2_remove_element
(
mem_block_t
*
,
list2_t
*
);
mem_block_t
*
list2_remove_head
(
list2_t
*
);
mem_block_t
*
list2_remove_tail
(
list2_t
*
);
void
list2_add_head
(
mem_block_t
*
,
list2_t
*
);
void
list2_add_tail
(
mem_block_t
*
,
list2_t
*
);
void
list2_add_list
(
list2_t
*
,
list2_t
*
);
void
list2_display
(
list2_t
*
);
//-----------------------------------------------------------------------------
/* The following lists are used for sorting numbers */
#ifndef LINUX_LIST
...
...
@@ -126,11 +96,11 @@ struct list {
};
#endif
//-----------------------------------------------------------------------------
public_list2
(
void
push_front
(
struct
list
*
,
double
);
)
public_list2
(
void
initialize
(
struct
list
*
);
)
public_list2
(
void
del
(
struct
list
*
);
)
public_list2
(
void
totable
(
double
*
,
struct
list
*
);)
public_list2
(
int
compare
(
const
void
*
a
,
const
void
*
b
);)
public_list2
(
int32_t
calculate_median
(
struct
list
*
loc_list
);)
void
push_front
(
struct
list
*
,
double
);
void
initialize
(
struct
list
*
);
void
del
(
struct
list
*
);
void
totable
(
double
*
,
struct
list
*
);
int
compare
(
const
void
*
a
,
const
void
*
b
);
int32_t
calculate_median
(
struct
list
*
loc_list
);
#endif
openair2/UTIL/MEM/mem_block.h
View file @
d76ac327
...
...
@@ -32,13 +32,7 @@
# define __MEM_BLOCK_H__
#include <stdint.h>
#ifdef MEM_BLOCK_C
# define public_mem_block(x) x
# define private_mem_block(x) x
#else
# define public_mem_block(x) extern x
# define private_mem_block(x)
#endif
#include "openair2/COMMON/platform_constants.h"
//-----------------------------------------------------------------------------
typedef
struct
mem_block_t
{
...
...
@@ -47,21 +41,20 @@ typedef struct mem_block_t {
unsigned
char
pool_id
;
unsigned
char
*
data
;
}
mem_block_t
;
#include "UTIL/LISTS/list.h"
//-----------------------------------------------------------------------------
public_mem_block
(
void
*
pool_buffer_init
(
void
);)
public_mem_block
(
void
*
pool_buffer_clean
(
void
*
arg
);)
public_mem_block
(
void
free_mem_block
(
mem_block_t
*
leP
,
const
char
*
caller
);)
public_mem_block
(
mem_block_t
*
get_free_mem_block
(
uint32_t
sizeP
,
const
char
*
caller
);)
public_mem_block
(
mem_block_t
*
get_free_copy_mem_block
(
void
);)
public_mem_block
(
mem_block_t
*
get_free_copy_mem_block_up
(
void
);)
public_mem_block
(
mem_block_t
*
copy_mem_block
(
mem_block_t
*
leP
,
mem_block_t
*
destP
);)
public_mem_block
(
void
display_mem_load
(
void
);)
public_mem_block
(
void
check_mem_area
(
void
);)
private_mem_block
(
void
check_free_mem_block
(
mem_block_t
*
leP
);)
void
*
pool_buffer_init
(
void
);
void
*
pool_buffer_clean
(
void
*
arg
);
void
free_mem_block
(
mem_block_t
*
leP
,
const
char
*
caller
);
mem_block_t
*
get_free_mem_block
(
uint32_t
sizeP
,
const
char
*
caller
);
mem_block_t
*
get_free_copy_mem_block
(
void
);
mem_block_t
*
get_free_copy_mem_block_up
(
void
);
mem_block_t
*
copy_mem_block
(
mem_block_t
*
leP
,
mem_block_t
*
destP
);
void
display_mem_load
(
void
);
void
check_mem_area
(
void
);
void
check_free_mem_block
(
mem_block_t
*
leP
);
# define MEM_SCALE MAX_MOBILES_PER_ENB
// definition of the size of the allocated memory area
# define MEM_MNGT_MB0_BLOCK_SIZE 64
...
...
@@ -139,9 +132,26 @@ private_mem_block(void check_free_mem_block (mem_block_t * leP);)
# define MEM_MNGT_NB_ELEMENTS MEM_MNGT_MB0_NB_BLOCKS + MEM_MNGT_MB1_NB_BLOCKS + MEM_MNGT_MB2_NB_BLOCKS + MEM_MNGT_MB3_NB_BLOCKS + MEM_MNGT_MB4_NB_BLOCKS + MEM_MNGT_MB5_NB_BLOCKS + MEM_MNGT_MB6_NB_BLOCKS + MEM_MNGT_MB7_NB_BLOCKS + MEM_MNGT_MB8_NB_BLOCKS + MEM_MNGT_MB9_NB_BLOCKS + MEM_MNGT_MB10_NB_BLOCKS + MEM_MNGT_MB11_NB_BLOCKS + MEM_MNGT_MB12_NB_BLOCKS + MEM_MNGT_MBCOPY_NB_BLOCKS
# define MEM_MNGT_POOL_ID_COPY 13
#define LIST_NAME_MAX_CHAR 32
typedef
struct
{
struct
mem_block_t
*
head
;
struct
mem_block_t
*
tail
;
int
nb_elements
;
char
name
[
LIST_NAME_MAX_CHAR
];
}
list2_t
;
//-----------------------------------------------------------------------------
typedef
struct
{
struct
mem_block_t
*
head
;
struct
mem_block_t
*
tail
;
int
nb_elements
;
char
name
[
LIST_NAME_MAX_CHAR
];
}
list_t
;
private_mem_block
(
typedef
struct
{
typedef
struct
{
//-----------------------------------------------------------
// basic memory management
//-----------------------------------------------------------
...
...
@@ -161,9 +171,9 @@ private_mem_block(typedef struct {
mem_block_t
mem_blocks
[
MEM_MNGT_NB_ELEMENTS
];
list_t
mem_lists
[
14
];
}
mem_pool
;
)
}
mem_pool
;
private_mem_block
(
mem_pool
mem_block_var
;)
mem_pool
mem_block_var
;
#endif
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment