Commit 82ef3aa3 authored by Lucas Russo's avatar Lucas Russo

include/*,src/*: fix linker table type reference

We were using the linker table label
as a pointer, which was wrong. The
correct type for it is just an address
on which can be dereferenced later.

A clear way to do that is to just
declare it as the type on which you
wish to deference later.
parent 3b78186a
...@@ -30,10 +30,11 @@ extern "C" { ...@@ -30,10 +30,11 @@ extern "C" {
#define SMIO_DISPATCH_FUNC_WRAPPER_GEN(func_name, ...) \ #define SMIO_DISPATCH_FUNC_WRAPPER_GEN(func_name, ...) \
({ \ ({ \
volatile const smio_mod_dispatch_t *smio_mod_dispatch = &_smio_mod_dispatch; \
smio_err_e local_err = SMIO_ERR_FUNC_NOT_IMPL; \ smio_err_e local_err = SMIO_ERR_FUNC_NOT_IMPL; \
if (_smio_mod_dispatch[th_args->smio_id].bootstrap_ops && \ if (smio_mod_dispatch[th_args->smio_id].bootstrap_ops && \
_smio_mod_dispatch[th_args->smio_id].bootstrap_ops->func_name) { \ smio_mod_dispatch[th_args->smio_id].bootstrap_ops->func_name) { \
local_err = _smio_mod_dispatch[th_args->smio_id].bootstrap_ops->func_name (__VA_ARGS__); \ local_err = smio_mod_dispatch[th_args->smio_id].bootstrap_ops->func_name (__VA_ARGS__); \
} \ } \
local_err; \ local_err; \
}) })
......
...@@ -30,8 +30,8 @@ typedef struct { ...@@ -30,8 +30,8 @@ typedef struct {
* } * }
*/ */
extern const smio_mod_dispatch_t *_smio_mod_dispatch; extern const smio_mod_dispatch_t _smio_mod_dispatch;
extern const smio_mod_dispatch_t *_esmio_mod_dispatch; extern const smio_mod_dispatch_t _esmio_mod_dispatch;
#define SMIO_MOD_DECLARE(mod_id, mod_name, mod_bootstrap_ops) \ #define SMIO_MOD_DECLARE(mod_id, mod_name, mod_bootstrap_ops) \
const smio_mod_dispatch_t __attribute__ ((section (".smio_mod_dispatch"))) \ const smio_mod_dispatch_t __attribute__ ((section (".smio_mod_dispatch"))) \
......
...@@ -389,8 +389,8 @@ devio_err_e devio_register_sm (devio_t *self, uint32_t smio_id, uint64_t base, ...@@ -389,8 +389,8 @@ devio_err_e devio_register_sm (devio_t *self, uint32_t smio_id, uint64_t base,
uint32_t pipe_mgmt_idx = 0; uint32_t pipe_mgmt_idx = 0;
uint32_t pipe_msg_idx = 0; uint32_t pipe_msg_idx = 0;
uint32_t pipe_config_idx = 0; uint32_t pipe_config_idx = 0;
volatile const smio_mod_dispatch_t *smio_mod_dispatch_start = _smio_mod_dispatch; volatile const smio_mod_dispatch_t *smio_mod_dispatch_start = &_smio_mod_dispatch;
volatile const smio_mod_dispatch_t *smio_mod_dispatch_end = _esmio_mod_dispatch; volatile const smio_mod_dispatch_t *smio_mod_dispatch_end = &_esmio_mod_dispatch;
smio_mod_dispatch_t *smio_mod_handler = (smio_mod_dispatch_t *) smio_mod_dispatch_start; smio_mod_dispatch_t *smio_mod_handler = (smio_mod_dispatch_t *) smio_mod_dispatch_start;
DBE_DEBUG (DBG_DEV_IO | DBG_LVL_TRACE, DBE_DEBUG (DBG_DEV_IO | DBG_LVL_TRACE,
......
...@@ -42,6 +42,7 @@ void smio_startup (zsock_t *pipe, void *args) ...@@ -42,6 +42,7 @@ void smio_startup (zsock_t *pipe, void *args)
th_boot_args_t *th_args = (th_boot_args_t *) args; th_boot_args_t *th_args = (th_boot_args_t *) args;
zsock_t *pipe_mgmt = pipe; zsock_t *pipe_mgmt = pipe;
zsock_t *pipe_msg = th_args->pipe_msg; zsock_t *pipe_msg = th_args->pipe_msg;
volatile const smio_mod_dispatch_t *smio_mod_dispatch = &_smio_mod_dispatch;
/* Signal parent we are initializing */ /* Signal parent we are initializing */
zsock_signal (pipe_mgmt, 0); zsock_signal (pipe_mgmt, 0);
...@@ -51,7 +52,7 @@ void smio_startup (zsock_t *pipe, void *args) ...@@ -51,7 +52,7 @@ void smio_startup (zsock_t *pipe, void *args)
char *inst_id_str = hutils_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); ASSERT_ALLOC(inst_id_str, err_inst_id_str_alloc);
char *smio_service = hutils_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, ':'); smio_mod_dispatch[th_args->smio_id].name, inst_id_str, ':');
ASSERT_ALLOC(smio_service, err_smio_service_alloc); ASSERT_ALLOC(smio_service, err_smio_service_alloc);
DBE_DEBUG (DBG_SM_IO | DBG_LVL_INFO, "[sm_io_bootstrap] SMIO Thread %s " DBE_DEBUG (DBG_SM_IO | DBG_LVL_INFO, "[sm_io_bootstrap] SMIO Thread %s "
...@@ -116,6 +117,7 @@ err_inst_id_str_alloc: ...@@ -116,6 +117,7 @@ err_inst_id_str_alloc:
void smio_config_defaults (zsock_t *pipe, void *args) void smio_config_defaults (zsock_t *pipe, void *args)
{ {
th_config_args_t *th_args = (th_config_args_t *) args; th_config_args_t *th_args = (th_config_args_t *) args;
volatile const smio_mod_dispatch_t *smio_mod_dispatch = &_smio_mod_dispatch;
/* Signal parent we are initializing */ /* Signal parent we are initializing */
zsock_signal (pipe, 0); zsock_signal (pipe, 0);
...@@ -125,7 +127,7 @@ void smio_config_defaults (zsock_t *pipe, void *args) ...@@ -125,7 +127,7 @@ void smio_config_defaults (zsock_t *pipe, void *args)
char *inst_id_str = hutils_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); ASSERT_ALLOC(inst_id_str, err_inst_id_str_alloc);
char *smio_service = hutils_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, ':'); smio_mod_dispatch[th_args->smio_id].name, inst_id_str, ':');
ASSERT_ALLOC(smio_service, err_smio_service_alloc); ASSERT_ALLOC(smio_service, err_smio_service_alloc);
DBE_DEBUG (DBG_SM_IO | DBG_LVL_INFO, "[sm_io_bootstrap] Config Thread %s " DBE_DEBUG (DBG_SM_IO | DBG_LVL_INFO, "[sm_io_bootstrap] Config Thread %s "
...@@ -138,7 +140,7 @@ void smio_config_defaults (zsock_t *pipe, void *args) ...@@ -138,7 +140,7 @@ void smio_config_defaults (zsock_t *pipe, void *args)
/* We've finished configuring the SMIO. Tell DEVIO we are done */ /* We've finished configuring the SMIO. Tell DEVIO we are done */
char *smio_service_suffix = hutils_concat_strings_no_sep ( char *smio_service_suffix = hutils_concat_strings_no_sep (
_smio_mod_dispatch[th_args->smio_id].name, inst_id_str); smio_mod_dispatch[th_args->smio_id].name, inst_id_str);
ASSERT_ALLOC(smio_service_suffix, err_smio_service_suffix_alloc); ASSERT_ALLOC(smio_service_suffix, err_smio_service_suffix_alloc);
DBE_DEBUG (DBG_SM_IO | DBG_LVL_INFO, "[sm_io_bootstrap] Sending CONFIG DONE message over PIPE\n"); DBE_DEBUG (DBG_SM_IO | DBG_LVL_INFO, "[sm_io_bootstrap] Sending CONFIG DONE message over PIPE\n");
......
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