Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
B
Beam Positoning Monitor - Software
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
Beam Positoning Monitor - Software
Commits
fd890421
Commit
fd890421
authored
Apr 17, 2015
by
Lucas Russo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
various: update files to reference new libhutils library
parent
5d5cd6af
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
23 changed files
with
294 additions
and
179 deletions
+294
-179
Makefile
Makefile
+24
-5
Makefile
examples/Makefile
+1
-1
dev_io.c
src/hal/dev_io/dev_io.c
+3
-3
dev_io.mk
src/hal/dev_io/dev_io.mk
+3
-2
dev_io_core.c
src/hal/dev_io/dev_io_core.c
+5
-5
dev_io_core.h
src/hal/dev_io/dev_io_core.h
+1
-1
dev_mngr.c
src/hal/dev_mngr/dev_mngr.c
+3
-3
dev_mngr_core.c
src/hal/dev_mngr/dev_mngr_core.c
+3
-3
hal.mk
src/hal/hal.mk
+1
-1
dispatch_table.c
src/hal/hal_utils/dispatch_table.c
+93
-94
dispatch_table.h
src/hal/hal_utils/dispatch_table.h
+11
-11
hal_utils.mk
src/hal/hal_utils/hal_utils.mk
+7
-5
hal_utils_err.c
src/hal/hal_utils/hal_utils_err.c
+10
-10
hal_utils_err.h
src/hal/hal_utils/hal_utils_err.h
+13
-13
sm_ch_si57x.c
src/hal/sm_io/chips/sm_ch_si57x.c
+1
-1
sm_ch_si57x.h
src/hal/sm_io/chips/sm_ch_si57x.h
+1
-1
sm_io_afc_diag_exp.c
src/hal/sm_io/modules/afc_diag/sm_io_afc_diag_exp.c
+4
-4
sm_io.c
src/hal/sm_io/sm_io.c
+6
-6
sm_io_bootstrap.c
src/hal/sm_io/sm_io_bootstrap.c
+6
-6
Makefile
src/libs/libbpmclient/Makefile
+5
-2
Makefile
src/libs/liberrhand/Makefile
+23
-2
revision.c
src/revision/revision.c
+42
-0
revision.h
src/revision/revision.h
+28
-0
No files found.
Makefile
View file @
fd890421
...
...
@@ -58,6 +58,7 @@ DRIVER_OBJ = /lib/modules/$(PCIE_DRIVER_VER)/extra/pciDriver.ko
# Project libraries
LIBERRHAND_DIR
=
src/libs/liberrhand
LIBCONVC_DIR
=
src/libs/libconvc
LIBHUTILS_DIR
=
src/libs/libhutils
LIBBPMCLIENT_DIR
=
src/libs/libbpmclient
# General C flags
...
...
@@ -145,11 +146,12 @@ LIBS = -lm -lzmq -lczmq -lmdp -lpcidriver
# FIXME: make the project libraries easily interchangeable, specifying
# the lib only a single time
PROJECT_LIBS_NAME
=
liberrhand libconvc libbpmclient
PROJECT_LIBS
=
-lerrhand
-lconvc
-lbpmclient
PROJECT_LIBS_NAME
=
liberrhand libconvc lib
hutils lib
bpmclient
PROJECT_LIBS
=
-lerrhand
-lconvc
-l
hutils
-l
bpmclient
# General library flags -L<libdir>
LFLAGS
=
-Lsrc
/libs/liberrhand
-Lsrc
/libs/libconvc
-Lsrc
/libs/lbpmclient
LFLAGS
=
-Lsrc
/libs/liberrhand
-Lsrc
/libs/libconvc
-Lsrc
/libs/libhutils
\
-Lsrc
/libs/lbpmclient
# Specific platform objects
OBJS_PLATFORM
=
...
...
@@ -172,6 +174,7 @@ INCLUDE_DIRS = $(hal_INCLUDE_DIRS) \
-Iinclude
\
-Isrc
/libs/liberrhand
\
-Isrc
/libs/libconvc
\
-Isrc
/libs/libhutils
\
-Isrc
/libs/libbpmclient
\
-I
/usr/local/include
...
...
@@ -203,6 +206,7 @@ revision_SRCS = $(patsubst %.o,%.c,$(revision_OBJS))
pcie_driver pcie_driver_install pcie_driver_uninstall pcie_driver_clean pcie_driver_check
\
liberrhand liberrhand_install liberrhand_uninstall liberrhand_clean liberrhand_mrproper
\
libconvc libconvc_install libconvc_uninstall libconvc_clean libconvc_mrproper
\
libhutils libhutils_install libhutils_uninstall libhutils_clean libhutils_mrproper
\
libbpmclient libbpmclient_install libbpmclient_uninstall libbpmclient_clean libbpmclient_mrproper
\
libmdp libmdp_install libmdp_uninstall libmdp_clean libmdp_mrproper
\
libbsmp libbsmp_install libbsmp_uninstall libbsmp_clean libbsmp_mrproper
\
...
...
@@ -351,6 +355,21 @@ libconvc_clean:
libconvc_mrproper
:
$(MAKE)
-C
$(LIBCONVC_DIR)
mrproper
libhutils
:
$(MAKE)
-C
$(LIBHUTILS_DIR)
all
libhutils_install
:
$(MAKE)
-C
$(LIBHUTILS_DIR)
install
libhutils_uninstall
:
$(MAKE)
-C
$(LIBHUTILS_DIR)
uninstall
libhutils_clean
:
$(MAKE)
-C
$(LIBHUTILS_DIR)
clean
libhutils_mrproper
:
$(MAKE)
-C
$(LIBHUTILS_DIR)
mrproper
libbpmclient
:
$(MAKE)
-C
$(LIBBPMCLIENT_DIR)
all
...
...
@@ -425,9 +444,9 @@ cfg_clean:
cfg_mrproper
:
$(MAKE)
-C
cfg mrproper
install
:
hal_install deps_install libbpmclient_install cfg_install
install
:
hal_install deps_install lib
errhand_install libconvc_install lib
bpmclient_install cfg_install
uninstall
:
hal_uninstall deps_uninstall libbpmclient_uninstall cfg_uninstall
uninstall
:
hal_uninstall deps_uninstall lib
errhand_uninstall libconvc_uninstall lib
bpmclient_uninstall cfg_uninstall
clean
:
hal_clean deps_clean liberrhand_clean libconvc_clean libbpmclient_clean examples_clean tests_clean cfg_clean
...
...
examples/Makefile
View file @
fd890421
...
...
@@ -34,7 +34,7 @@ CFLAGS_PLATFORM = -Wall -Wextra -Werror
LDFLAGS_PLATFORM
=
# Libraries
LIBS
=
-lbpmclient
-lmdp
-lczmq
-lzmq
LIBS
=
-lbpmclient
-l
errhand
-l
mdp
-lczmq
-lzmq
# General library flags -L<libdir>
LFLAGS
=
...
...
src/hal/dev_io/dev_io.c
View file @
fd890421
...
...
@@ -194,7 +194,7 @@ int main (int argc, char *argv[])
char
*
argv_exec
[]
=
{
DEVIO_CFG_NAME
,
"-n"
,
devio_type_str
,
"-t"
,
dev_type
,
"-i"
,
dev_id_str
,
"-e"
,
dev_entry
,
"-b"
,
broker_endp
,
NULL
};
/* Spawn Config DEVIO */
child_devio_cfg_pid
=
h
al
utils_spawn_chld
(
DEVIO_CFG_NAME
,
argv_exec
);
child_devio_cfg_pid
=
hutils_spawn_chld
(
DEVIO_CFG_NAME
,
argv_exec
);
if
(
child_devio_cfg_pid
<
0
)
{
DBE_DEBUG
(
DBG_DEV_IO
|
DBG_LVL_FATAL
,
"[dev_io] Could not create "
...
...
@@ -236,7 +236,7 @@ int main (int argc, char *argv[])
/* Kill DEVIO cfg as we've already got our slot number */
kill
(
child_devio_cfg_pid
,
DEVIO_KILL_CFG_SIGNAL
);
/* Wait child */
h
al
utils_wait_chld
();
hutils_wait_chld
();
#endif
/* We don't need it anymore */
...
...
@@ -305,7 +305,7 @@ int main (int argc, char *argv[])
}
/* wait child */
h
al
utils_wait_chld
();
hutils_wait_chld
();
}
err_devio:
...
...
src/hal/dev_io/dev_io.mk
View file @
fd890421
dev_io_DIR = $(SRC_DIR)/hal/dev_io
dev_io_core_utils_OBJS = $(dev_io_DIR)/dev_io_utils.o
# Here we call <output_name>_core_OBJS as we need to add
# more objects to this target. This is done in the hal.mk
# makefile
dev_io_core_OBJS = $(dev_io_DIR)/dev_io_core.o \
$(dev_io_DIR)/dev_io_err.o \
$(dev_io_utils_OBJS)
$(dev_io_
core_
utils_OBJS)
dev_io_OBJS = $(dev_io_DIR)/dev_io.o
dev_io_INCLUDE_DIRS = $(dev_io_DIR) \
$(dev_io_utils_INCLUDE_DIRS) \
$(LIBBPMCLIENT_DIR)
dev_io_OUT = dev_io
...
...
src/hal/dev_io/dev_io_core.c
View file @
fd890421
...
...
@@ -17,7 +17,7 @@
#include "sm_io_thsafe_codes.h"
#include "sm_io_bootstrap.h"
#include "ll_io_utils.h"
#include "h
al_
utils.h"
#include "hutils.h"
/* Undef ASSERT_ALLOC to avoid conflicting with other ASSERT_ALLOC */
#ifdef ASSERT_TEST
...
...
@@ -139,9 +139,9 @@ devio_t * devio_new (char *name, char *endpoint_dev, llio_type_e type,
self
->
disp_table_thsafe_ops
=
disp_table_new
();
ASSERT_ALLOC
(
self
->
disp_table_thsafe_ops
,
err_disp_table_thsafe_ops_alloc
);
h
alutils_err_e
hal
utils_err
=
disp_table_insert_all
(
self
->
disp_table_thsafe_ops
,
h
utils_err_e
h
utils_err
=
disp_table_insert_all
(
self
->
disp_table_thsafe_ops
,
self
->
thsafe_server_ops
);
ASSERT_TEST
(
h
alutils_err
==
HAL
UTILS_SUCCESS
,
"Could not initialize dispatch table"
,
ASSERT_TEST
(
h
utils_err
==
H
UTILS_SUCCESS
,
"Could not initialize dispatch table"
,
err_disp_table_init
);
/* Finally, initialize mdp_worker with service being the BPM<board_number> */
...
...
@@ -261,9 +261,9 @@ devio_err_e devio_register_sm (devio_t *self, uint32_t smio_id, uint64_t base,
* alloc can fail */
DBE_DEBUG
(
DBG_DEV_IO
|
DBG_LVL_TRACE
,
"[dev_io_core:register_sm] Stringify hash ID
\n
"
);
char
*
inst_id_str
=
h
al
utils_stringify_dec_key
(
inst_id
);
char
*
inst_id_str
=
hutils_stringify_dec_key
(
inst_id
);
ASSERT_ALLOC
(
inst_id_str
,
err_inst_id_str_alloc
);
char
*
key
=
h
al
utils_concat_strings_no_sep
(
smio_mod_dispatch
[
i
].
name
,
char
*
key
=
hutils_concat_strings_no_sep
(
smio_mod_dispatch
[
i
].
name
,
inst_id_str
);
/* We don't need this anymore */
free
(
inst_id_str
);
...
...
src/hal/dev_io/dev_io_core.h
View file @
fd890421
...
...
@@ -11,7 +11,7 @@
#include "czmq.h"
#include "mdp.h"
#include "h
al_
utils.h"
#include "hutils.h"
#include "dispatch_table.h"
#include "dev_io_err.h"
#include "ll_io.h"
...
...
src/hal/dev_mngr/dev_mngr.c
View file @
fd890421
...
...
@@ -18,7 +18,7 @@
#include "dev_mngr.h"
#include "varg_macros.h"
#include "errhand.h"
#include "h
al_
utils.h"
#include "hutils.h"
#define DFLT_BIND_FOLDER "/tmp/bpm"
#define DFLT_BIND_ADDR "0"
...
...
@@ -237,8 +237,8 @@ int main (int argc, char *argv[])
}
#endif
dmngr_set_wait_clhd_handler
(
dmngr
,
&
h
al
utils_wait_chld
);
dmngr_set_spawn_clhd_handler
(
dmngr
,
&
h
al
utils_spawn_chld
);
dmngr_set_wait_clhd_handler
(
dmngr
,
&
hutils_wait_chld
);
dmngr_set_spawn_clhd_handler
(
dmngr
,
&
hutils_spawn_chld
);
err
=
dmngr_register_sig_handlers
(
dmngr
);
if
(
err
!=
DMNGR_SUCCESS
)
{
...
...
src/hal/dev_mngr/dev_mngr_core.c
View file @
fd890421
...
...
@@ -10,7 +10,7 @@
#include "dev_mngr_core.h"
#include "errhand.h"
#include "h
al_
utils.h"
#include "hutils.h"
/* Undef ASSERT_ALLOC to avoid conflicting with other ASSERT_ALLOC */
#ifdef ASSERT_TEST
...
...
@@ -425,9 +425,9 @@ dmngr_err_e dmngr_spawn_all_devios (dmngr_t *self, char *broker_endp,
/* Alloc and convert types */
dev_type_c
=
llio_type_to_str
(
devio_info
->
type
);
ASSERT_ALLOC
(
dev_type_c
,
err_dev_type_c_alloc
,
DMNGR_ERR_ALLOC
);
dev_id_c
=
h
al
utils_stringify_dec_key
(
devio_info
->
id
);
dev_id_c
=
hutils_stringify_dec_key
(
devio_info
->
id
);
ASSERT_ALLOC
(
dev_id_c
,
err_dev_id_c_alloc
,
DMNGR_ERR_ALLOC
);
smio_inst_id_c
=
h
al
utils_stringify_dec_key
(
devio_info
->
smio_inst_id
);
smio_inst_id_c
=
hutils_stringify_dec_key
(
devio_info
->
smio_inst_id
);
ASSERT_ALLOC
(
smio_inst_id_c
,
err_smio_inst_id_c_alloc
,
DMNGR_ERR_ALLOC
);
/* Argument options are "process name", "device type" and
...
...
src/hal/hal.mk
View file @
fd890421
...
...
@@ -16,7 +16,7 @@ hal_all_OUT += $(dev_mngr_all_OUT) $(dev_io_all_OUT)
dev_mngr_OBJS += $(dev_mngr_core_OBJS) $(debug_OBJS) \
$(hal_utils_OBJS) $(exp_ops_OBJS) \
$(thsafe_msg_zmq_OBJS) $(ll_io_utils_OBJS) \
$(dev_io
_utils_OBJS)
$(dev_io_core
_utils_OBJS)
# msg_OBJS already contains exp_ops_OBJS. So, there is no need to include
# it here twice
dev_io_OBJS += $(dev_io_core_OBJS) $(ll_io_OBJS) $(sm_io_OBJS) \
...
...
src/hal/hal_utils/dispatch_table.c
View file @
fd890421
This diff is collapsed.
Click to expand it.
src/hal/hal_utils/dispatch_table.h
View file @
fd890421
...
...
@@ -15,7 +15,7 @@
#define _DISPATCH_TABLE_H_
#include <czmq.h>
#include "h
al_utils_err
.h"
#include "h
utils
.h"
struct
_disp_table_t
{
/* Hash containg all the sm_io thsafe operations
...
...
@@ -89,31 +89,31 @@ typedef struct _disp_op_handler_t disp_op_handler_t;
/***************** Our methods *****************/
disp_table_t
*
disp_table_new
(
void
);
h
al
utils_err_e
disp_table_destroy
(
disp_table_t
**
self_p
);
hutils_err_e
disp_table_destroy
(
disp_table_t
**
self_p
);
h
al
utils_err_e
disp_table_insert
(
disp_table_t
*
self
,
const
disp_op_t
*
disp_op
);
h
al
utils_err_e
disp_table_insert_all
(
disp_table_t
*
self
,
hutils_err_e
disp_table_insert
(
disp_table_t
*
self
,
const
disp_op_t
*
disp_op
);
hutils_err_e
disp_table_insert_all
(
disp_table_t
*
self
,
const
disp_op_t
**
disp_ops
);
h
al
utils_err_e
disp_table_remove
(
disp_table_t
*
self
,
uint32_t
key
);
h
al
utils_err_e
disp_table_remove_all
(
disp_table_t
*
self
);
hutils_err_e
disp_table_remove
(
disp_table_t
*
self
,
uint32_t
key
);
hutils_err_e
disp_table_remove_all
(
disp_table_t
*
self
);
h
al
utils_err_e
disp_table_fill_desc
(
disp_table_t
*
self
,
disp_op_t
**
disp_ops
,
hutils_err_e
disp_table_fill_desc
(
disp_table_t
*
self
,
disp_op_t
**
disp_ops
,
const
disp_table_func_fp
*
func_fps
);
h
al
utils_err_e
disp_table_check_args
(
disp_table_t
*
self
,
uint32_t
key
,
hutils_err_e
disp_table_check_args
(
disp_table_t
*
self
,
uint32_t
key
,
void
*
args
,
void
**
ret
);
h
al
utils_err_e
disp_table_cleanup_args
(
disp_table_t
*
self
,
uint32_t
key
);
hutils_err_e
disp_table_cleanup_args
(
disp_table_t
*
self
,
uint32_t
key
);
const
disp_op_t
*
disp_table_lookup
(
disp_table_t
*
self
,
uint32_t
key
);
int
disp_table_call
(
disp_table_t
*
self
,
uint32_t
key
,
void
*
owner
,
void
*
args
,
void
*
ret
);
int
disp_table_check_call
(
disp_table_t
*
self
,
uint32_t
key
,
void
*
owner
,
void
*
args
,
void
**
ret
);
h
al
utils_err_e
disp_table_set_ret
(
disp_table_t
*
self
,
uint32_t
key
,
void
**
ret
);
hutils_err_e
disp_table_set_ret
(
disp_table_t
*
self
,
uint32_t
key
,
void
**
ret
);
/*********************** Disp Op Handler functions ****************************/
disp_op_handler_t
*
disp_op_handler_new
(
void
);
h
al
utils_err_e
disp_op_handler_destroy
(
disp_op_handler_t
**
self_p
);
hutils_err_e
disp_op_handler_destroy
(
disp_op_handler_t
**
self_p
);
#endif
src/hal/hal_utils/hal_utils.mk
View file @
fd890421
...
...
@@ -2,11 +2,13 @@ hal_utils_DIR = $(SRC_DIR)/hal/hal_utils
# We depend on "msg.c" fucntions to determine which message
# we are dealing with
hal_utils_OBJS = $(hal_utils_DIR)/hal_utils.o \
$(hal_utils_DIR)/hal_math.o \
$(hal_utils_DIR)/hal_utils_err.o \
$(hal_utils_DIR)/dispatch_table.o \
$(msg_DIR)/msg.o
#hal_utils_OBJS = $(hal_utils_DIR)/hal_utils.o \
# $(hal_utils_DIR)/hal_math.o \
# $(hal_utils_DIR)/hal_utils_err.o \
# $(hal_utils_DIR)/dispatch_table.o \
# $(msg_DIR)/msg.o
hal_utils_OBJS = $(hal_utils_DIR)/dispatch_table.o \
$(msg_DIR)/msg.o
hal_utils_INCLUDE_DIRS = $(hal_utils_DIR)
src/hal/hal_utils/hal_utils_err.c
View file @
fd890421
...
...
@@ -10,19 +10,19 @@
#include "hal_utils_err.h"
static
const
char
*
h
alutils_err
[
HAL
UTILS_ERR_END
]
=
static
const
char
*
h
utils_err
[
H
UTILS_ERR_END
]
=
{
[
H
AL
UTILS_SUCCESS
]
=
"Success"
,
[
H
AL
UTILS_ERR_ALLOC
]
=
"Could not allocate memory"
,
[
H
AL
UTILS_ERR_NULL_POINTER
]
=
"Null pointer received"
,
[
H
AL
UTILS_ERR_NO_FUNC_REG
]
=
"No function registered"
,
[
H
AL
UTILS_ERR_INV_LESS_ARGS
]
=
"Less arguments than specified passed"
,
[
H
AL
UTILS_ERR_INV_MORE_ARGS
]
=
"More arguments than specified passed"
,
[
H
AL
UTILS_ERR_INV_SIZE_ARG
]
=
"Invalid size of argument size"
[
HUTILS_SUCCESS
]
=
"Success"
,
[
HUTILS_ERR_ALLOC
]
=
"Could not allocate memory"
,
[
HUTILS_ERR_NULL_POINTER
]
=
"Null pointer received"
,
[
HUTILS_ERR_NO_FUNC_REG
]
=
"No function registered"
,
[
HUTILS_ERR_INV_LESS_ARGS
]
=
"Less arguments than specified passed"
,
[
HUTILS_ERR_INV_MORE_ARGS
]
=
"More arguments than specified passed"
,
[
HUTILS_ERR_INV_SIZE_ARG
]
=
"Invalid size of argument size"
};
/* Convert enumeration type to string */
const
char
*
h
alutils_err_str
(
hal
utils_err_e
err
)
const
char
*
h
utils_err_str
(
h
utils_err_e
err
)
{
return
h
al
utils_err
[
err
];
return
hutils_err
[
err
];
}
src/hal/hal_utils/hal_utils_err.h
View file @
fd890421
...
...
@@ -8,24 +8,24 @@
/* Error definitions and output stringification based on the work available
* at the libsllp project repository: https://github.com/brunoseivam/libsllp */
#ifndef _H
AL
UTILS_ERR_H_
#define _H
AL
UTILS_ERR_H_
#ifndef _HUTILS_ERR_H_
#define _HUTILS_ERR_H_
enum
_h
al
utils_err_e
enum
_hutils_err_e
{
H
AL
UTILS_SUCCESS
=
0
,
/* No error */
H
AL
UTILS_ERR_ALLOC
,
/* Could not allocate memory */
H
AL
UTILS_ERR_NULL_POINTER
,
/* Null pointer received */
H
AL
UTILS_ERR_NO_FUNC_REG
,
/* No function registered */
H
AL
UTILS_ERR_INV_LESS_ARGS
,
/* Less arguments than specified passed */
H
AL
UTILS_ERR_INV_MORE_ARGS
,
/* More arguments than specified passed */
H
AL
UTILS_ERR_INV_SIZE_ARG
,
/* Invalid size of argument size */
H
AL
UTILS_ERR_END
HUTILS_SUCCESS
=
0
,
/* No error */
HUTILS_ERR_ALLOC
,
/* Could not allocate memory */
HUTILS_ERR_NULL_POINTER
,
/* Null pointer received */
HUTILS_ERR_NO_FUNC_REG
,
/* No function registered */
HUTILS_ERR_INV_LESS_ARGS
,
/* Less arguments than specified passed */
HUTILS_ERR_INV_MORE_ARGS
,
/* More arguments than specified passed */
HUTILS_ERR_INV_SIZE_ARG
,
/* Invalid size of argument size */
HUTILS_ERR_END
};
typedef
enum
_h
alutils_err_e
hal
utils_err_e
;
typedef
enum
_h
utils_err_e
h
utils_err_e
;
/* Convert enumeration type to string */
const
char
*
h
alutils_err_str
(
hal
utils_err_e
err
);
const
char
*
h
utils_err_str
(
h
utils_err_e
err
);
#endif
src/hal/sm_io/chips/sm_ch_si57x.c
View file @
fd890421
...
...
@@ -502,7 +502,7 @@ static smch_err_e _smch_si57x_calc_divs (smch_si57x_t *self, double frequency,
hs_div
=
si57x_hs_div_values
[
i
];
/* Calculate lowest possible value for n1 */
n1
=
div_u64
(
div_u64
(
SI57X_FDCO_MIN
,
hs_div
),
(
uint64_t
)
FLOOR
(
frequency
));
n1
=
hutils_div_u64
(
hutils_
div_u64
(
SI57X_FDCO_MIN
,
hs_div
),
(
uint64_t
)
FLOOR
(
frequency
));
if
(
!
n1
||
(
n1
&
1
))
{
n1
++
;
...
...
src/hal/sm_io/chips/sm_ch_si57x.h
View file @
fd890421
...
...
@@ -13,7 +13,7 @@
#include "sm_pr_i2c.h"
#include "sm_ch_err.h"
#include "h
al
_math.h"
#include "h
utils
_math.h"
struct
_smch_si57x_t
{
smpr_t
*
i2c
;
/* I2C protocol object */
...
...
src/hal/sm_io/modules/afc_diag/sm_io_afc_diag_exp.c
View file @
fd890421
...
...
@@ -115,25 +115,25 @@ static int _afc_diag_info_rw (void *owner, void *args, void *ret,
AFC_DIAG_INFO_FUNC_NAME_HEADER
(
build_revision
)
{
return
_afc_diag_info_rw
(
owner
,
args
,
ret
,
halutils
_copy_build_revision
,
return
_afc_diag_info_rw
(
owner
,
args
,
ret
,
revision
_copy_build_revision
,
AFC_DIAG_OPCODE_GET_BUILD_REVISION
,
"Could not get build revision"
);
}
AFC_DIAG_INFO_FUNC_NAME_HEADER
(
build_date
)
{
return
_afc_diag_info_rw
(
owner
,
args
,
ret
,
halutils
_copy_build_date
,
return
_afc_diag_info_rw
(
owner
,
args
,
ret
,
revision
_copy_build_date
,
AFC_DIAG_OPCODE_GET_BUILD_DATE
,
"Could not get build date"
);
}
AFC_DIAG_INFO_FUNC_NAME_HEADER
(
build_user_name
)
{
return
_afc_diag_info_rw
(
owner
,
args
,
ret
,
halutils
_copy_build_user_name
,
return
_afc_diag_info_rw
(
owner
,
args
,
ret
,
revision
_copy_build_user_name
,
AFC_DIAG_OPCODE_GET_BUILD_USER_NAME
,
"Could not get build user name"
);
}
AFC_DIAG_INFO_FUNC_NAME_HEADER
(
build_user_email
)
{
return
_afc_diag_info_rw
(
owner
,
args
,
ret
,
halutils
_copy_build_user_email
,
return
_afc_diag_info_rw
(
owner
,
args
,
ret
,
revision
_copy_build_user_email
,
AFC_DIAG_OPCODE_GET_BUILD_USER_EMAIL
,
"Could not get build user email"
);
}
...
...
src/hal/sm_io/sm_io.c
View file @
fd890421
...
...
@@ -100,8 +100,8 @@ smio_err_e smio_export_ops (smio_t *self, const disp_op_t** smio_exp_ops)
smio_err_e
err
=
SMIO_SUCCESS
;
h
al
utils_err_e
herr
=
disp_table_insert_all
(
self
->
exp_ops_dtable
,
smio_exp_ops
);
ASSERT_TEST
(
herr
==
H
AL
UTILS_SUCCESS
,
"smio_export_ops: Could not export"
hutils_err_e
herr
=
disp_table_insert_all
(
self
->
exp_ops_dtable
,
smio_exp_ops
);
ASSERT_TEST
(
herr
==
HUTILS_SUCCESS
,
"smio_export_ops: Could not export"
" SMIO ops"
,
err_export_op
,
SMIO_ERR_EXPORT_OP
);
err
=
SMIO_FUNC_OPS_NOFAIL_WRAPPER
(
err
,
export_ops
,
smio_exp_ops
);
...
...
@@ -119,9 +119,9 @@ smio_err_e smio_unexport_ops (smio_t *self)
assert
(
self
);
smio_err_e
err
=
SMIO_SUCCESS
;
h
al
utils_err_e
herr
=
disp_table_remove_all
(
self
->
exp_ops_dtable
);
hutils_err_e
herr
=
disp_table_remove_all
(
self
->
exp_ops_dtable
);
ASSERT_TEST
(
herr
==
H
AL
UTILS_SUCCESS
,
"smio_export_ops: Could not unexport SMIO ops"
,
ASSERT_TEST
(
herr
==
HUTILS_SUCCESS
,
"smio_export_ops: Could not unexport SMIO ops"
,
err_unexport_op
,
SMIO_ERR_EXPORT_OP
);
err
=
SMIO_FUNC_OPS_NOFAIL_WRAPPER
(
err
,
unexport_ops
);
...
...
@@ -143,10 +143,10 @@ smio_err_e smio_init_exp_ops (smio_t *self, disp_op_t** smio_exp_ops,
{
assert
(
self
);
h
alutils_err_e
herr
=
HAL
UTILS_SUCCESS
;
h
utils_err_e
herr
=
H
UTILS_SUCCESS
;
smio_err_e
err
=
SMIO_SUCCESS
;
herr
=
disp_table_fill_desc
(
self
->
exp_ops_dtable
,
smio_exp_ops
,
func_fps
);
ASSERT_TEST
(
herr
==
H
AL
UTILS_SUCCESS
,
"smio_export_ops: Could not export"
ASSERT_TEST
(
herr
==
HUTILS_SUCCESS
,
"smio_export_ops: Could not export"
" fill SMIO ops description"
,
err_fill_desc_ops
,
SMIO_ERR_EXPORT_OP
);
err_fill_desc_ops:
...
...
src/hal/sm_io/sm_io_bootstrap.c
View file @
fd890421
...
...
@@ -11,7 +11,7 @@
#include "sm_io.h"
#include "exp_ops_codes.h"
#include "errhand.h"
#include "h
al_
utils.h"
#include "hutils.h"
/* Undef ASSERT_ALLOC to avoid conflicting with other ASSERT_ALLOC */
#ifdef ASSERT_TEST
...
...
@@ -61,9 +61,9 @@ void smio_startup (void *args, zctx_t *ctx, void *pipe)
/* We must export our service as the combination of the
* devio name (coming from devio parent) and our own name ID
* followed by an optional parameter coming from priv pointer */
char
*
inst_id_str
=
h
al
utils_stringify_dec_key
(
th_args
->
inst_id
);
char
*
inst_id_str
=
hutils_stringify_dec_key
(
th_args
->
inst_id
);
ASSERT_ALLOC
(
inst_id_str
,
err_inst_id_str_alloc
);
char
*
smio_service
=
h
al
utils_concat_strings3
(
th_args
->
service
,
char
*
smio_service
=
hutils_concat_strings3
(
th_args
->
service
,
smio_mod_dispatch
[
th_args
->
smio_id
].
name
,
inst_id_str
,
':'
);
ASSERT_ALLOC
(
smio_service
,
err_smio_service_alloc
);
...
...
@@ -107,7 +107,7 @@ err_call_init:
err_self_alloc:
/* We can't output this message at a later time as we depend on the smio_service
* variable. This is not so bad, though, as most of the time we will not fail
* in h
al
utils_concat_strings () function */
* in hutils_concat_strings () function */
DBE_DEBUG
(
DBG_SM_IO
|
DBG_LVL_WARN
,
"[sm_io_bootstrap] SMIO Thread %s exiting ...
\n
"
,
smio_service
);
free
(
smio_service
);
...
...
@@ -128,9 +128,9 @@ void *smio_config_defaults (void *args)
/* We must export our service as the combination of the
* devio name (coming from devio parent) and our own name ID
* followed by an optional parameter coming from priv pointer */
char
*
inst_id_str
=
h
al
utils_stringify_dec_key
(
th_args
->
inst_id
);
char
*
inst_id_str
=
hutils_stringify_dec_key
(
th_args
->
inst_id
);
ASSERT_ALLOC
(
inst_id_str
,
err_inst_id_str_alloc
);
char
*
smio_service
=
h
al
utils_concat_strings3
(
th_args
->
service
,
char
*
smio_service
=
hutils_concat_strings3
(
th_args
->
service
,
smio_mod_dispatch
[
th_args
->
smio_id
].
name
,
inst_id_str
,
':'
);
ASSERT_ALLOC
(
smio_service
,
err_smio_service_alloc
);
...
...
src/libs/libbpmclient/Makefile
View file @
fd890421
...
...
@@ -90,7 +90,7 @@ OBJS_EXTERNAL = ../../hal/sm_io/modules/sm_io_codes.o \
boards_INCLUDE_DIRS
=
-I
../../../include/boards/
$(BOARD)
# Include directories
INCLUDE_DIRS
=
-I
.
-I
../../../include
-I
../liberrhand
\
INCLUDE_DIRS
=
-I
.
-I
../../../include
-I
../liberrhand
-I
../libhutils
\
$(boards_INCLUDE_DIRS)
\
-I
../../hal/sm_io/modules
\
-I
../../hal/sm_io/modules/fmc130m_4ch
\
...
...
@@ -129,7 +129,10 @@ $(LIBBPMCLIENT)_CODE_HEADERS = ../../hal/sm_io/modules/fmc130m_4ch/sm_io_fmc130m
../../hal/sm_io/modules/sm_io_codes.h
\
../../../include/acq_chan_gen_defs.h
\
../../hal/hal_utils/dispatch_table.h
\
../../hal/hal_utils/hal_utils_err.h
\
../libhutils/hutils.h
\
../libhutils/hutils_err.h
\
../libhutils/hutils_math.h
\
../libhutils/hutils_utils.h
\
bpm_client_codes.h
$(LIBBPMCLIENT)
_FUNC_EXPORTS
=
../../hal/sm_io/modules/fmc130m_4ch/sm_io_fmc130m_4ch_exports.h
\
...
...
src/libs/liberrhand/Makefile
View file @
fd890421
...
...
@@ -15,8 +15,11 @@ PWD = $(shell pwd)
LIBERRHAND
=
liberrhand
INSTALL_DIR
?=
/usr/local
export
INSTALL_DIR
# General C flags
CFLAGS
=
-std
=
gnu99
-O2
CFLAGS
=
-std
=
gnu99
-O2
-fPIC
# To enable this option, use: make ERRHAND_DBG=y
ifneq
($(ERRHAND_DBG),)
...
...
@@ -92,9 +95,12 @@ OBJS_all = $(common_OBJS) $($(LIBERRHAND)_OBJS)
# Libraries suffixes
LIB_STATIC_SUFFIX
=
.a
LIB_SHARED_SUFFIX
=
.so
# Generate suitable names for static libraries
TARGET_STATIC
=
$
(
addsuffix
$(LIB_STATIC_SUFFIX)
,
$(OUT)
)
TARGET_SHARED
=
$
(
addsuffix
$(LIB_SHARED_SUFFIX)
,
$(OUT)
)
TARGET_SHARED_VER
=
$
(
addsuffix
$(LIB_SHARED_SUFFIX)
.
$(LIB_VER)
,
$(OUT)
)
.PHONY
:
all clean mrproper install uninstall
...
...
@@ -102,12 +108,16 @@ TARGET_STATIC = $(addsuffix $(LIB_STATIC_SUFFIX), $(OUT))
.SECONDARY
:
$(OBJS_all)
# Makefile rules
all
:
$(TARGET_STATIC)
all
:
$(TARGET_STATIC)
$(TARGET_SHARED_VER)
# Compile static library
%.a
:
$$($$*_OBJS)
$(AR)
rcs
$@
$^
# Compile dynamic library
%.so.$(LIB_VER)
:
$$($$*_OBJS) $(OBJ_REVISION)
$(CC)
-shared
-fPIC
-Wl
,-soname,
$@
-o
$@
$^
$(LDFLAGS)
# Pull in dependency info for *existing* .o files and don't complain if the
# corresponding .d file is not found
-include $(OBJS_all
:
.o=.d)
...
...
@@ -140,8 +150,19 @@ all: $(TARGET_STATIC)
@
rm
-f
$*
.d.tmp
install
:
$
(
foreach lib,
$(TARGET_SHARED_VER)
,install
-m
755
$(lib)
$(INSTALL_DIR)
/lib
$(CMDSEP)
)
$
(
foreach lib,
$(TARGET_SHARED)
,ln
-sf
$(lib)
.
$(LIB_VER)
$(INSTALL_DIR)
/lib/
$(lib)
$(CMDSEP)
)
$
(
foreach lib,
$(TARGET_SHARED)
,ln
-sf
$(lib)
.
$(LIB_VER)
$(INSTALL_DIR)
/lib/
$(lib)
.
$(LIB_VER_MAJOR)
$(CMDSEP)
)
$
(
foreach lib,
$(TARGET_STATIC)
,install
-m
755
$(lib)
$(INSTALL_DIR)
/lib
$(CMDSEP)
)
$
(
foreach header,
$
(
$(LIBBPMCLIENT)
_INST_HEADERS
)
,install
-m
755
$(header)
$(INSTALL_DIR)
/include
$(CMDSEP)
)
uninstall
:
$
(
foreach lib,
$(TARGET_SHARED)
,rm
-f
$(INSTALL_DIR)
/lib/
$(lib)
.
$(LIB_VER)
$(CMDSEP)
)
$
(
foreach lib,
$(TARGET_SHARED)
,rm
-f
$(INSTALL_DIR)
/lib/
$(lib)
$(CMDSEP)
)
$
(
foreach lib,
$(TARGET_SHARED)
,rm
-f
$(INSTALL_DIR)
/lib/
$(lib)
.
$(LIB_VER_MAJOR)
$(CMDSEP)
)
$
(
foreach lib,
$(TARGET_STATIC)
,rm
-f
$(INSTALL_DIR)
/lib/
$(lib)
$(CMDSEP)
)
$
(
foreach header,
$
(
notdir
$
(
$(LIBBPMCLIENT)
_INST_HEADERS
))
,rm
-f
\
$(INSTALL_DIR)
/include/
$(header)
$(CMDSEP)
)
clean
:
rm
-f
$(OBJS_all)
$
(
OBJS_all:.o
=
.d
)
...
...
src/revision/revision.c
View file @
fd890421
#include "hutils.h"
#include "revision.h"
const
char
*
build_revision
=
GIT_REVISION
;
const
char
*
build_date
=
__DATE__
" "
__TIME__
;
const
char
*
build_user_name
=
GIT_USER_NAME
;
const
char
*
build_user_email
=
GIT_USER_EMAIL
;
char
*
revision_clone_build_rev
(
void
)
{
return
hutils_clone_str
(
build_revision
);
}
char
*
revision_clone_build_date
(
void
)
{
return
hutils_clone_str
(
build_date
);
}
char
*
revision_clone_build_user_name
(
void
)
{
return
hutils_clone_str
(
build_user_name
);
}
char
*
revision_clone_build_user_email
(
void
)
{
return
hutils_clone_str
(
build_user_email
);
}
int
revision_copy_build_revision
(
char
*
dest
,
size_t
size
)
{
return
hutils_copy_str
(
dest
,
build_revision
,
size
);
}
int
revision_copy_build_date
(
char
*
dest
,
size_t
size
)
{
return
hutils_copy_str
(
dest
,
build_date
,
size
);
}
int
revision_copy_build_user_name
(
char
*
dest
,
size_t
size
)
{
return
hutils_copy_str
(
dest
,
build_user_name
,
size
);
}
int
revision_copy_build_user_email
(
char
*
dest
,
size_t
size
)
{
return
hutils_copy_str
(
dest
,
build_user_email
,
size
);
}
src/revision/revision.h
View file @
fd890421
...
...
@@ -13,4 +13,32 @@ extern const char *build_date;
extern
const
char
*
build_user_name
;
extern
const
char
*
build_user_email
;
/* Clone the build revision. Returns the cloned string is successfully or NULL
* on error */
char
*
revision_clone_build_revision
(
void
);
/* Copies the build revision into a pre-allocated buffer. Returns a negative number
* on error and the number of copied bytes otherwise */
int
revision_copy_build_revision
(
char
*
dest
,
size_t
size
);
/* Clone the build date. Returns the cloned string is successfully or NULL
* on error */
char
*
revision_clone_build_date
(
void
);
/* Copies the build date into a pre-allocated buffer. Returns a negative number
* on error and the number of copied bytes otherwise */
int
revision_copy_build_date
(
char
*
dest
,
size_t
size
);
/* Clone the build user name. Returns the cloned string is successfully or NULL
* on error */
char
*
revision_clone_build_user_name
(
void
);
/* Copies the build user name into a pre-allocated buffer. Returns a negative number
* on error and the number of copied bytes otherwise */
int
revision_copy_build_user_name
(
char
*
dest
,
size_t
size
);
/* Clone the build user email. Returns the cloned string is successfully or NULL
* on error */
char
*
revision_clone_build_user_email
(
void
);
/* Copies the build user email into a pre-allocated buffer. Returns a negative number
* on error and the number of copied bytes otherwise */
int
revision_copy_build_user_email
(
char
*
dest
,
size_t
size
);
#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