diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2009-02-17 23:14:25 -0500 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2009-02-17 23:14:25 -0500 |
commit | 1eba429e3988b84fe1b095defdbeac37a480c25f (patch) | |
tree | 0cc163219c851a29e38a44b7a95a33fb028cc20d /src/output.c | |
parent | 6a46a4250e2b6169c6d41e2ee07b22e9e77d320f (diff) | |
download | seabios-hppa-1eba429e3988b84fe1b095defdbeac37a480c25f.zip seabios-hppa-1eba429e3988b84fe1b095defdbeac37a480c25f.tar.gz seabios-hppa-1eba429e3988b84fe1b095defdbeac37a480c25f.tar.bz2 |
Add hexdump() output helper function.
Diffstat (limited to 'src/output.c')
-rw-r--r-- | src/output.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/output.c b/src/output.c index 2e6246b..5cda9c1 100644 --- a/src/output.c +++ b/src/output.c @@ -257,6 +257,26 @@ printf(const char *fmt, ...) va_end(args); } +void +hexdump(void *d, int len) +{ + int count=0; + while (len) { + if (count % 8 == 0) { + putc(0, '\n'); + puthex(0, count*4); + putc(0, ':'); + } else { + putc(0, ' '); + } + puthex(0, *(u32*)d); + count++; + len-=4; + d+=4; + } + putc(0, '\n'); +} + static void dump_regs(struct bregs *regs) { |