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
8f71d69a
Commit
8f71d69a
authored
Dec 03, 2016
by
Alessandro Rubini
Committed by
Grzegorz Daniluk
Feb 16, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tools: fix dumping cross-endian 64-bit
Signed-off-by:
Alessandro Rubini
<
rubini@gnudd.com
>
parent
651c6bf2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
19 deletions
+3
-19
wrpc-dump.c
tools/wrpc-dump.c
+3
-19
No files found.
tools/wrpc-dump.c
View file @
8f71d69a
...
...
@@ -34,9 +34,7 @@ static long long wrpc_get_64(void *p)
uint64_t
result
;
if
(
endian_flag
==
DUMP_ENDIAN_FLAG
)
{
result
=
*
p64
>>
32
;
result
|=
(
uint32_t
)
*
p64
;
return
result
;
return
*
p64
;
}
result
=
__bswap_32
((
uint32_t
)(
*
p64
>>
32
));
result
<<=
32
;
...
...
@@ -57,20 +55,6 @@ static int wrpc_get_i32(void *p)
{
return
wrpc_get_l32
(
p
);
}
static
int64_t
wrpc_get_i64
(
void
*
p
)
{
int64_t
*
p64
=
p
,
i64
;
if
(
endian_flag
==
DUMP_ENDIAN_FLAG
)
return
*
p64
;
/* uff... */
i64
=
*
p64
;
i64
=
__bswap_32
(
i64
&
0xffffffff
);
i64
<<=
32
;
i64
|=
__bswap_32
(
i64
>>
32
);
return
i64
;
}
static
int
wrpc_get_16
(
void
*
p
)
{
uint16_t
*
p16
=
p
;
...
...
@@ -153,8 +137,8 @@ void dump_one_field(void *addr, struct dump_info *info)
case
dump_type_pp_time
:
{
struct
pp_time
localt
;
localt
.
secs
=
wrpc_get_
i
64
(
&
t
->
secs
);
localt
.
scaled_nsecs
=
wrpc_get_
i
64
(
&
t
->
scaled_nsecs
);
localt
.
secs
=
wrpc_get_64
(
&
t
->
secs
);
localt
.
scaled_nsecs
=
wrpc_get_64
(
&
t
->
scaled_nsecs
);
printf
(
"correct %i: %10lli.%09li:0x%04x
\n
"
,
!
is_incorrect
(
&
localt
),
...
...
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