summaryrefslogtreecommitdiffstats
path: root/sys/dev/softraid.c
diff options
context:
space:
mode:
authorjsing <jsing@openbsd.org>2014-01-22 05:11:36 +0000
committerjsing <jsing@openbsd.org>2014-01-22 05:11:36 +0000
commitf5040c40c737927f7813ace672cb42801e54e13a (patch)
treef2f842fafcd19ef85d54ac1f305945a1744d59b4 /sys/dev/softraid.c
parentbring inteldrm back up after resume using DVACT_WAKEUP (non-cold, able (diff)
downloadwireguard-openbsd-f5040c40c737927f7813ace672cb42801e54e13a.tar.xz
wireguard-openbsd-f5040c40c737927f7813ace672cb42801e54e13a.zip
Move sr_dump from the RAID5 code into shared code. Rename it to
sr_dump_block and place it under the debug define in the process.
Diffstat (limited to 'sys/dev/softraid.c')
-rw-r--r--sys/dev/softraid.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/sys/dev/softraid.c b/sys/dev/softraid.c
index ff717a56ac7..44dacacbcb2 100644
--- a/sys/dev/softraid.c
+++ b/sys/dev/softraid.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: softraid.c,v 1.326 2014/01/22 04:24:29 jsing Exp $ */
+/* $OpenBSD: softraid.c,v 1.327 2014/01/22 05:11:36 jsing Exp $ */
/*
* Copyright (c) 2007, 2008, 2009 Marco Peereboom <marco@peereboom.us>
* Copyright (c) 2008 Chris Kuethe <ckuethe@openbsd.org>
@@ -4916,6 +4916,26 @@ sr_meta_print(struct sr_metadata *m)
}
void
+sr_dump_block(void *blk, int len)
+{
+ uint8_t *b = blk;
+ int i, j, c;
+
+ for (i = 0; i < len; i += 16) {
+ for (j = 0; j < 16; j++)
+ printf("%.2x ", b[i + j]);
+ printf(" ");
+ for (j = 0; j < 16; j++) {
+ c = b[i + j];
+ if (c < ' ' || c > 'z' || i + j > len)
+ c = '.';
+ printf("%c", c);
+ }
+ printf("\n");
+ }
+}
+
+void
sr_dump_mem(u_int8_t *p, int len)
{
int i;