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
1bb1b14e
Commit
1bb1b14e
authored
Nov 02, 2020
by
Federico Vaga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
liblinux: add read32/write32 functions
Signed-off-by:
Federico Vaga
<
federico.vaga@cern.ch
>
parent
0406f658
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
1 deletion
+17
-1
devmap.c
liblinux/devmap.c
+14
-0
libdevmap.h
liblinux/libdevmap.h
+3
-1
No files found.
liblinux/devmap.c
View file @
1bb1b14e
...
...
@@ -342,3 +342,17 @@ const char * const dev_get_version()
{
return
libdevmap_version_s
;
}
uint32_t
dev_read32
(
struct
mapping_desc
*
map
,
off_t
offset
)
{
uint32_t
val
;
val
=
*
((
uint32_t
*
)(
map
->
base
+
offset
));
return
iomemr32
(
map
->
is_be
,
val
);
}
void
dev_write32
(
struct
mapping_desc
*
map
,
uint32_t
val
,
off_t
offset
)
{
*
((
uint32_t
*
)(
map
->
base
+
offset
))
=
iomemw32
(
map
->
is_be
,
val
);
}
liblinux/libdevmap.h
View file @
1bb1b14e
...
...
@@ -36,7 +36,9 @@ extern struct mapping_desc *dev_map(struct mapping_args *map_args,
extern
void
dev_unmap
(
struct
mapping_desc
*
dev
);
extern
struct
mapping_args
*
dev_parse_mapping_args
(
int
argc
,
char
*
argv
[]);
extern
const
char
*
const
dev_mapping_help
();
extern
const
char
*
const
dev_get_version
();
extern
const
char
*
const
dev_get_version
();
extern
uint32_t
dev_read32
(
struct
mapping_desc
*
map
,
off_t
offset
);
extern
void
dev_write32
(
struct
mapping_desc
*
map
,
uint32_t
val
,
off_t
offset
);
/** @}*/
...
...
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