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
Issues
1
Issues
1
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
Mock Turtle
Commits
63276363
Commit
63276363
authored
May 07, 2018
by
Federico Vaga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sw:lib: bugfix wrong endianess calculation
Signed-off-by:
Federico Vaga
<
federico.vaga@cern.ch
>
parent
40c622db
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
8 deletions
+13
-8
mockturtle.h
software/include/mockturtle.h
+2
-0
libmockturtle.c
software/lib/libmockturtle.c
+11
-8
No files found.
software/include/mockturtle.h
View file @
63276363
...
...
@@ -192,6 +192,8 @@ enum trtl_msg_filter_operation_type {
__TRTL_MSG_FILTER_MAX
,
};
#define TRTL_MSG_FILTER_FLAG_HEADER (0)
#define TRTL_MSG_FILTER_FLAG_PAYLOAD (1 << 0)
/**
...
...
software/lib/libmockturtle.c
View file @
63276363
...
...
@@ -65,18 +65,18 @@ enum trtl_msg_filter_predefined {
*/
static
struct
trtl_msg_filter
filters
[]
=
{
[
TRTL_MSG_FILTER_ASYNC
]
=
{
.
flags
=
0
,
.
flags
=
TRTL_MSG_FILTER_FLAG_HEADER
,
.
operation
=
TRTL_MSG_FILTER_AND
,
.
word_offset
=
0
,
/* ATTENTION:
sync_id
in the message header */
.
mask
=
(
TRTL_HMQ_HEADER_FLAG_SYNC
|
TRTL_HMQ_HEADER_FLAG_ACK
)
<<
8
,
.
word_offset
=
0
,
/* ATTENTION:
flags
in the message header */
.
mask
=
(
TRTL_HMQ_HEADER_FLAG_SYNC
|
TRTL_HMQ_HEADER_FLAG_ACK
)
<<
16
,
.
value
=
0
,
},
[
TRTL_MSG_FILTER_SYNC
]
=
{
.
flags
=
0
,
.
flags
=
TRTL_MSG_FILTER_FLAG_HEADER
,
.
operation
=
TRTL_MSG_FILTER_AND
,
.
word_offset
=
1
,
/* ATTENTION: sync_id
in the message header */
.
mask
=
TRTL_HMQ_HEADER_FLAG_ACK
<<
8
,
.
value
=
TRTL_HMQ_HEADER_FLAG_ACK
<<
8
,
.
word_offset
=
0
,
/* ATTENTION: flags
in the message header */
.
mask
=
TRTL_HMQ_HEADER_FLAG_ACK
<<
16
,
.
value
=
TRTL_HMQ_HEADER_FLAG_ACK
<<
16
,
},
};
...
...
@@ -1048,6 +1048,9 @@ int trtl_msg_async_send(struct trtl_dev *trtl,
* @param[out] msg_r message received
* @param[in] timeout like poll(2)
* @return 0 on success, otherwise -1 and errno is set appropriately
*
* This function configure some filters, so it does some bit magic which have been
* tested on a little-endian host.
*/
int
trtl_msg_sync
(
struct
trtl_dev
*
trtl
,
unsigned
int
idx_cpu
,
...
...
@@ -1059,7 +1062,7 @@ int trtl_msg_sync(struct trtl_dev *trtl,
struct
trtl_desc
*
wdesc
=
(
struct
trtl_desc
*
)
trtl
;
struct
polltrtl
p
;
struct
trtl_msg_filter
f_sync
=
{
.
flags
=
0
,
.
flags
=
TRTL_MSG_FILTER_FLAG_HEADER
,
.
operation
=
TRTL_MSG_FILTER_AND
,
.
word_offset
=
1
,
/* ATTENTION: sync_id in the message header */
.
mask
=
0xFFFF0000
,
...
...
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