Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
M
mock-turtle
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
hdl-core-lib
mock-turtle
Commits
ad33f01e
Commit
ad33f01e
authored
Jun 06, 2018
by
Federico Vaga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sw:lib: add new error code
Signed-off-by:
Federico Vaga
<
federico.vaga@cern.ch
>
parent
c0093881
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
1 deletion
+9
-1
libmockturtle.c
software/lib/libmockturtle.c
+7
-1
libmockturtle.h
software/lib/libmockturtle.h
+2
-0
No files found.
software/lib/libmockturtle.c
View file @
ad33f01e
...
...
@@ -45,6 +45,7 @@ static char *trtl_error_str[] = {
"Error while reading HMQ messages"
,
"Failed to send synchronous message"
,
"Failed to receive synchronous message"
,
"Failed to receive synchronous message: poll error"
,
"Failed to receive synchronous message: timeout"
,
"Failed to receive synchronous message: invalid sync id"
,
NULL
,
...
...
@@ -1099,11 +1100,16 @@ int trtl_msg_sync(struct trtl_dev *trtl,
errno
=
ETRTL_MSG_SYNC_FAILED_RECV_TIMEOUT
;
return
-
1
;
}
if
((
p
.
revents
&
POLLERR
)
||
!
(
p
.
revents
&
POLLIN
))
{
if
((
p
.
revents
&
POLLERR
))
{
errno
=
ETRTL_MSG_SYNC_FAILED_RECV_POLLERR
;
return
-
1
;
}
if
(
!
(
p
.
revents
&
POLLIN
))
{
errno
=
ETRTL_MSG_SYNC_FAILED_RECV
;
return
-
1
;
}
/* read the answer */
ret
=
trtl_msg_async_recv
(
wdesc
->
trtl_sync
,
idx_cpu
,
idx_hmq
,
msg_r
,
1
);
if
(
ret
<
0
)
...
...
software/lib/libmockturtle.h
View file @
ad33f01e
...
...
@@ -63,6 +63,8 @@ enum trtl_error_number {
ETRTL_MSG_SYNC_FAILED_RECV
,
/**< Receive sync message failure */
ETRTL_MSG_SYNC_FAILED_RECV_TIMEOUT
,
/**< Receive sync message failure:
timeout */
ETRTL_MSG_SYNC_FAILED_RECV_POLLERR
,
/**< Receive sync message failure */
ETRTL_MSG_SYNC_FAILED_INVAL
,
/**< Receive sync message failure:
invalid */
__ETRTL_MAX
,
...
...
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