Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
W
White Rabbit Switch - Software
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
83
Issues
83
List
Board
Labels
Milestones
Merge Requests
4
Merge Requests
4
CI / CD
CI / CD
Pipelines
Schedules
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
White Rabbit Switch - Software
Commits
6b25ce2b
Commit
6b25ce2b
authored
Feb 11, 2015
by
Adam Wujek
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
userspace/tools: check if following hal_ports pointer in shmem was successful
Signed-off-by:
Adam Wujek
<
adam.wujek@cern.ch
>
parent
2d462c45
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
3 deletions
+9
-3
wr_mon.c
userspace/tools/wr_mon.c
+9
-3
No files found.
userspace/tools/wr_mon.c
View file @
6b25ce2b
...
...
@@ -91,15 +91,21 @@ void init_shm(void)
h
=
(
void
*
)
hal_head
+
hal_head
->
data_off
;
/* Assume number of ports does not change in runtime */
hal_nports_local
=
h
->
nports
;
/* Even after HAL restart, HAL will place structures at the same
* addresses. No need to re-dereference pointer at each read. */
hal_ports
=
wrs_shm_follow
(
hal_head
,
h
->
ports
);
if
(
hal_nports_local
>
HAL_MAX_PORTS
)
{
fprintf
(
stderr
,
"Too many ports reported by HAL. "
"%d vs %d supported
\n
"
,
hal_nports_local
,
HAL_MAX_PORTS
);
exit
(
-
1
);
}
/* Even after HAL restart, HAL will place structures at the same
* addresses. No need to re-dereference pointer at each read. */
hal_ports
=
wrs_shm_follow
(
hal_head
,
h
->
ports
);
if
(
!
hal_ports
)
{
fprintf
(
stderr
,
"Unalbe to follow hal_ports pointer in HAL's "
"shmem"
);
exit
(
-
1
);
}
ppsi_head
=
wrs_shm_get
(
wrs_shm_ptp
,
""
,
WRS_SHM_READ
);
if
(
!
ppsi_head
)
{
...
...
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