Commit 69751e15 authored by Adam Wujek's avatar Adam Wujek 💬

userspace/wrsw_hal: assign hal version before releasing the lock

It might happen that the reader of shmem ignores the lock, but at least shall
check the version of HAL. When it is not 0 then we can be sure HAL's shmem
is initialized. However, don't relay on this behaviour.
Signed-off-by: Adam Wujek's avatarAdam Wujek <adam.wujek@cern.ch>
parent 7b229c3c
...@@ -254,7 +254,6 @@ int hal_port_init_shmem(char *logfilename) ...@@ -254,7 +254,6 @@ int hal_port_init_shmem(char *logfilename)
/* We are done, mark things as valid */ /* We are done, mark things as valid */
hal_shmem->nports = hal_port_nports; hal_shmem->nports = hal_port_nports;
hal_shmem_hdr->version = HAL_SHMEM_VERSION;
hal_shmem->hal_mode = hal_get_timing_mode(); hal_shmem->hal_mode = hal_get_timing_mode();
ret = libwr_cfg_get("READ_SFP_DIAG_ENABLE"); ret = libwr_cfg_get("READ_SFP_DIAG_ENABLE");
...@@ -264,6 +263,7 @@ int hal_port_init_shmem(char *logfilename) ...@@ -264,6 +263,7 @@ int hal_port_init_shmem(char *logfilename)
} else } else
hal_shmem->read_sfp_diag = READ_SFP_DIAG_DISABLE; hal_shmem->read_sfp_diag = READ_SFP_DIAG_DISABLE;
hal_shmem_hdr->version = HAL_SHMEM_VERSION;
/* Release processes waiting for HAL's to fill shm with correct data /* Release processes waiting for HAL's to fill shm with correct data
When shm is opened successfully data in shm is still not populated! When shm is opened successfully data in shm is still not populated!
Read data with wrs_shm_seqbegin and wrs_shm_seqend! Read data with wrs_shm_seqbegin and wrs_shm_seqend!
......
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