Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
Software for White Rabbit PTP Core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
32
Issues
32
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
Software for White Rabbit PTP Core
Commits
01972b89
Commit
01972b89
authored
Aug 22, 2019
by
Federico Vaga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tools:vuart: add option to select big-endian
Signed-off-by:
Federico Vaga
<
federico.vaga@cern.ch
>
parent
fc7ab8d9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
7 deletions
+11
-7
devmap.c
liblinux/devmap.c
+10
-7
libdevmap.h
liblinux/libdevmap.h
+1
-0
No files found.
liblinux/devmap.c
View file @
01972b89
...
...
@@ -121,12 +121,11 @@ struct mapping_desc *dev_map(struct mapping_args *map_args, uint32_t map_length)
desc
->
base
=
desc
->
mmap
+
map_args
->
offset
-
pa_offset
;
/*
* @todo for future VME devices handled via a resource file,
* exposed in standard place (/sys/bus/vme/device/xxx/resource-file)
* the bus type (pci or vme) should be checked to set properly
* the endianess (could be get from the path's resource)
* @todo when WhiteRabbit will use a Byte-Order-Mask, use it to
* detect endianess automatically
*/
desc
->
is_be
=
0
;
/* default set to little endian */
desc
->
is_be
=
map_args
->
is_be
;
return
desc
;
out_mmap:
...
...
@@ -284,7 +283,7 @@ struct mapping_args *dev_parse_mapping_args(int argc, char *argv[])
return
map_args
;
}
#endif
while
((
c
=
getopt
(
argc
,
argv
,
"o:f:"
))
!=
-
1
)
while
((
c
=
getopt
(
argc
,
argv
,
"o:f:
b
"
))
!=
-
1
)
{
switch
(
c
)
{
...
...
@@ -300,6 +299,9 @@ struct mapping_args *dev_parse_mapping_args(int argc, char *argv[])
map_args
->
resource_file
=
optarg
;
++
arg_count
;
break
;
case
'b'
:
map_args
->
is_be
=
1
;
break
;
case
'?'
:
/* ignore unknown arguments */
break
;
...
...
@@ -326,10 +328,11 @@ const char * const dev_mapping_help()
{
static
char
help_msg
[]
=
"Device mapping options:
\n
"
"
\t
-f <file resource path> -o 0x<address offset>
\n
"
"
\t
-f <file resource path> -o 0x<address offset>
[-b]
\n
"
"Arguments:
\n
"
"
\t
-t resource file to mmap
\n
"
"
\t
-o memory offset from within the resource
\n
"
"
\t
-b big endian access
\n
"
#ifdef SUPPORT_CERN_VMEBRIDGE
"Device mapping options for CERN vmebus driver:
\n
"
"
\t
--cern-vmebridge -a 0x<VME base address>
\n
"
...
...
liblinux/libdevmap.h
View file @
01972b89
...
...
@@ -14,6 +14,7 @@
struct
mapping_args
{
char
*
resource_file
;
uint64_t
offset
;
int
is_be
;
void
*
vme_extra_args
;
};
...
...
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