Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
Simple VME FMC Carrier SVEC - Software
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
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
Simple VME FMC Carrier SVEC - Software
Commits
ceb79d6c
Commit
ceb79d6c
authored
Nov 27, 2012
by
Juan David González Cobas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tools: add -s (skip_bytes) option
parent
2e5183ef
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
3 deletions
+10
-3
vme.c
tools/vme.c
+10
-3
No files found.
tools/vme.c
View file @
ceb79d6c
...
...
@@ -7,8 +7,9 @@
#include <libvmebus.h>
static
char
usage_string
[]
=
"usage: %s [-oh?] [ -w word ] [-v vme_address] "
"[-d data_width] [-a address_modifier] [-n word_count]
\n
"
;
"usage: %s [-oh?] [ -w word ] [-v vme_address]
\n
"
"[-s skip_bytes ] [-d data_width] "
"[-a address_modifier] [-n word_count]
\n
"
;
void
usage
(
char
*
prog
)
{
...
...
@@ -22,6 +23,7 @@ int main(int argc, char *argv[])
struct
vme_mapping
*
mapp
=
&
map
;
volatile
void
*
ptr
;
unsigned
int
vmebase
,
am
,
data_width
;
unsigned
int
skip_bytes
;
int
i
,
count
;
int
c
;
int
write
,
offsets_on
;
...
...
@@ -34,11 +36,15 @@ int main(int argc, char *argv[])
write
=
0
;
offsets_on
=
1
;
while
((
c
=
getopt
(
argc
,
argv
,
"ov:d:a:n:w:"
))
!=
-
1
)
{
skip_bytes
=
0
;
while
((
c
=
getopt
(
argc
,
argv
,
"ov:s:d:a:n:w:"
))
!=
-
1
)
{
switch
(
c
)
{
case
'o'
:
offsets_on
=
0
;
break
;
case
's'
:
skip_bytes
=
strtoul
(
optarg
,
NULL
,
0
);
break
;
case
'v'
:
vmebase
=
strtoul
(
optarg
,
NULL
,
0
);
break
;
...
...
@@ -78,6 +84,7 @@ int main(int argc, char *argv[])
fprintf
(
stderr
,
"vme 0x%08x kernel 0x%p user 0x%p
\n
"
,
vmebase
,
mapp
->
kernel_va
,
mapp
->
user_va
);
ptr
+=
skip_bytes
;
for
(
i
=
0
;
i
<
count
;
i
++
,
ptr
+=
4
)
{
if
(
!
write
)
{
if
(
offsets_on
)
...
...
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