Randy Dunlap 99eaf3c45f lib/hexdump
Based on ace_dump_mem() from Grant Likely for the Xilinx SystemACE
CompactFlash interface.

Add print_hex_dump() & hex_dumper() to lib/hexdump.c and linux/kernel.h.

This patch adds the functions print_hex_dump() & hex_dumper().
print_hex_dump() can be used to perform a hex + ASCII dump of data to
syslog, in an easily viewable format, thus providing a common text hex dump
format.

hex_dumper() provides a dump-to-memory function.  It converts one "line" of
output (16 bytes of input) at a time.

Example usages:
	print_hex_dump(KERN_DEBUG, DUMP_PREFIX_ADDRESS, frame->data, frame->len);
	hex_dumper(frame->data, frame->len, linebuf, sizeof(linebuf));

Example output using %DUMP_PREFIX_OFFSET:
0009ab42: 40414243 44454647 48494a4b 4c4d4e4f-@ABCDEFG HIJKLMNO
Example output using %DUMP_PREFIX_ADDRESS:
ffffffff88089af0: 70717273 74757677 78797a7b 7c7d7e7f-pqrstuvw xyz{|}~.

[akpm@linux-foundation.org: cleanups, add export]
Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-05-11 08:29:34 -07:00
..
2005-10-18 08:26:15 -07:00
2006-12-08 08:28:39 -08:00
2006-06-25 10:01:20 -07:00
2006-06-25 10:01:20 -07:00
2007-05-10 18:24:13 +02:00
2007-04-25 22:28:53 -07:00
2007-05-08 11:14:58 -07:00
2007-02-20 17:10:15 -08:00
2007-05-11 08:29:34 -07:00
2006-06-20 20:24:58 -07:00
2006-12-13 09:05:52 -08:00
2006-10-06 08:53:40 -07:00
2006-06-25 10:01:09 -07:00
2007-05-11 08:29:34 -07:00
2006-12-04 02:00:22 -05:00
2007-02-17 19:07:33 +01:00