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
7
Merge Requests
7
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
51bc276b
Commit
51bc276b
authored
Nov 08, 2021
by
Adam Wujek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tools: support for RISCV to wrpc-dump
Signed-off-by:
Adam Wujek
<
dev_public@wujek.eu
>
parent
f08441be
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
3 deletions
+9
-3
wrpc-dump.c
tools/wrpc-dump.c
+9
-3
No files found.
tools/wrpc-dump.c
View file @
51bc276b
...
...
@@ -31,6 +31,12 @@
#define ntohl(x) __do_not_use
#define ntohll(x) __do_not_use
#ifdef CONFIG_ARCH_RISCV
#define HAS_ARCH_RISCV 1
#else
#define HAS_ARCH_RISCV 0
#endif
/* create fancy macro to shorten the switch statements, assign val as a string to p */
#define ENUM_TO_P_IN_CASE(val, p) \
case val: \
...
...
@@ -61,7 +67,7 @@ long long wrpc_get_64(void *p)
uint64_t
*
p64
=
p
;
uint64_t
result
;
if
(
endian_flag
==
DUMP_ENDIAN_FLAG
)
{
if
(
HAS_ARCH_RISCV
||
endian_flag
==
DUMP_ENDIAN_FLAG
)
{
return
*
p64
;
}
result
=
__bswap_32
((
uint32_t
)
*
p64
);
...
...
@@ -75,7 +81,7 @@ long wrpc_get_l32(void *p)
{
uint32_t
*
p32
=
p
;
if
(
endian_flag
==
DUMP_ENDIAN_FLAG
)
if
(
HAS_ARCH_RISCV
||
endian_flag
==
DUMP_ENDIAN_FLAG
)
return
*
p32
;
return
__bswap_32
(
*
p32
);
}
...
...
@@ -89,7 +95,7 @@ int wrpc_get_16(void *p)
{
uint16_t
*
p16
=
p
;
if
(
endian_flag
==
DUMP_ENDIAN_FLAG
)
if
(
HAS_ARCH_RISCV
||
endian_flag
==
DUMP_ENDIAN_FLAG
)
return
*
p16
;
return
__bswap_16
(
*
p16
);
}
...
...
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