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
a5431365
Commit
a5431365
authored
Apr 08, 2022
by
Tristan Gingold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
liblinux/devmap.c: --cern-vmebridge is also -V
parent
4794bfc4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
13 deletions
+11
-13
devmap.c
liblinux/devmap.c
+11
-13
No files found.
liblinux/devmap.c
View file @
a5431365
...
...
@@ -30,9 +30,7 @@ struct vmebridge_map_args {
uint32_t
am
;
/**< VME address modifier to use */
uint64_t
addr
;
/**< physical base address */
};
#endif
#ifdef SUPPORT_CERN_VMEBRIDGE
static
struct
mapping_desc
*
cern_vmebridge_dev_map
(
struct
mapping_args
*
map_args
,
int
mapping_length
)
{
...
...
@@ -162,11 +160,8 @@ void dev_unmap(struct mapping_desc *desc)
#ifdef SUPPORT_CERN_VMEBRIDGE
#define CERN_VMEBRIDGE_REQUIRED_ARG_NB 2
#define CERN_VMEBRIDGE 1
static
struct
option
long_options
[]
=
{
{
"cern-vmebridge"
,
no_argument
,
0
,
CERN_VMEBRIDGE
},
{
"cern-vmebridge"
,
no_argument
,
0
,
'V'
},
{
"address"
,
required_argument
,
0
,
'a'
},
{
"offset"
,
required_argument
,
0
,
'o'
},
{
"data-width"
,
required_argument
,
0
,
'w'
},
...
...
@@ -183,7 +178,8 @@ static int cern_vmebridge_match(int argc, char *argv[])
int
i
;
for
(
i
=
0
;
i
<
argc
;
++
i
)
{
if
(
!
strcmp
(
argv
[
i
],
"--cern-vmebridge"
))
{
if
(
!
strcmp
(
argv
[
i
],
"--cern-vmebridge"
)
||
!
strcmp
(
argv
[
i
],
"-V"
))
{
return
1
;
}
}
...
...
@@ -209,11 +205,12 @@ static int cern_vmebridge_parse_args(int *argc, char *argv[],
/* set default values in case they are not provided*/
vme_args
->
data_width
=
32
;
vme_args
->
am
=
0x39
;
map_args
->
offset
=
0
;
while
((
c
=
getopt_long
(
*
argc
,
argv
,
"w:o:m:a:"
,
long_options
,
while
((
c
=
getopt_long
(
*
argc
,
argv
,
"w:o:m:a:
V
"
,
long_options
,
&
option_index
))
!=
-
1
)
{
switch
(
c
)
{
case
CERN_VMEBRIDGE
:
case
'V'
:
// nothing to do
break
;
case
'w'
:
/* optional arg */
...
...
@@ -227,11 +224,10 @@ static int cern_vmebridge_parse_args(int *argc, char *argv[],
vme_args
->
data_width
==
64
)
)
return
-
1
;
break
;
case
'o'
:
/*
mandatory
arg */
case
'o'
:
/*
optional
arg */
ret
=
sscanf
(
optarg
,
"0x%"
SCNx64
,
&
map_args
->
offset
);
if
(
ret
!=
1
)
return
-
1
;
++
arg_count
;
break
;
case
'm'
:
/* optional arg */
ret
=
sscanf
(
optarg
,
"0x%x"
,
...
...
@@ -253,7 +249,7 @@ static int cern_vmebridge_parse_args(int *argc, char *argv[],
}
}
*
argc
=
nargc
;
return
(
arg_count
==
CERN_VMEBRIDGE_REQUIRED_ARG_NB
)
?
0
:
-
1
;
return
(
arg_count
==
1
)
?
0
:
-
1
;
}
#endif
...
...
@@ -279,6 +275,8 @@ struct mapping_args *dev_parse_mapping_args(int *argc, char *argv[])
nargc
=
*
argc
;
ret
=
cern_vmebridge_parse_args
(
&
nargc
,
argv
,
map_args
);
if
(
ret
<
0
)
{
fprintf
(
stderr
,
"%s: bad value or missing -a ADDR
\n
"
,
argv
[
0
]);
goto
out
;
}
}
...
...
@@ -309,7 +307,7 @@ struct mapping_args *dev_parse_mapping_args(int *argc, char *argv[])
break
;
}
}
if
(
arg_count
!=
REQUIRED_ARG_NB
)
{
goto
out
;
}
...
...
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