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
6
Merge Requests
6
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
0581b66d
Commit
0581b66d
authored
Jan 05, 2022
by
Adam Wujek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lib/util: add dump_mem function
Signed-off-by:
Adam Wujek
<
dev_public@wujek.eu
>
parent
3fef7ad3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
0 deletions
+23
-0
util.c
lib/util.c
+23
-0
No files found.
lib/util.c
View file @
0581b66d
...
...
@@ -272,6 +272,29 @@ int atoi(const char *s)
return
res
;
}
/* Quick and dirty function to be used for debugging to dump the memory */
void
dump_mem
(
uint8_t
*
p
,
int
size
)
{
int
i
=
0
;
uint8_t
*
end
=
p
+
size
;
pp_printf
(
"0x%x size 0x%x
\n
"
,
(
int
)
p
,
size
);
while
(
1
){
pp_printf
(
"0x%x:"
,
(
unsigned
int
)
p
);
for
(
i
=
0
;
i
<
8
;
i
++
)
{
pp_printf
(
" %02x"
,
*
p
);
p
++
;
if
(
p
>=
end
)
{
pp_printf
(
"
\n
"
);
return
;
}
}
pp_printf
(
"
\n
"
);
}
}
/* To save code, in the div of two int64 numbers
* use signed 64bit division, then correct the sign of the result */
long
long
__divdi3
(
long
long
A
,
long
long
B
)
...
...
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