summaryrefslogtreecommitdiff
path: root/util/libreboot-utils/lib/command.c
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2026-03-29 07:21:08 +0100
committerLeah Rowe <leah@libreboot.org>2026-03-29 07:22:34 +0100
commitafe2e71c014e291b9915271d45c1fd933f2fa55f (patch)
tree5263dcf1b0e2c5f1824635630c4517be60087442 /util/libreboot-utils/lib/command.c
parent546565f32103da7fc66ddddeaabe9cbcc30c831a (diff)
util/nvmutil: better hexdump
this is a more generic one that i implemented for "lottery.c" (which is really just a tester of my rset function in lib/rand.c) i could probably actually write a full hexdump program in libreboot-utils to be honest. Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'util/libreboot-utils/lib/command.c')
-rw-r--r--util/libreboot-utils/lib/command.c32
1 files changed, 1 insertions, 31 deletions
diff --git a/util/libreboot-utils/lib/command.c b/util/libreboot-utils/lib/command.c
index d0f783dd..a1e46e5f 100644
--- a/util/libreboot-utils/lib/command.c
+++ b/util/libreboot-utils/lib/command.c
@@ -364,8 +364,7 @@ cmd_helper_dump(void)
(size_t)p);
print_mac_from_nvm(p);
-
- hexdump(p);
+ spew_hex(f->buf + (p * GBE_PART_SIZE), NVM_SIZE);
}
}
@@ -391,35 +390,6 @@ print_mac_from_nvm(size_t partnum)
}
void
-hexdump(size_t partnum)
-{
- size_t c;
- size_t row;
- unsigned short val16;
-
- for (row = 0; row < 8; row++) {
-
- printf("%08lx ",
- (size_t)((size_t)row << 4));
-
- for (c = 0; c < 8; c++) {
-
- val16 = nvm_word((row << 3) + c, partnum);
-
- if (c == 4)
- printf(" ");
-
- printf(" %02x %02x",
- (unsigned int)(val16 & 0xff),
- (unsigned int)(val16 >> 8));
-
- }
-
- printf("\n");
- }
-}
-
-void
cmd_helper_swap(void)
{
struct xstate *x = xstatus();