summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 6ee8998)
raw | patch | inline | side by side (parent: 6ee8998)
author | Vitaly Andrianov <vitalya@ti.com> | |
Wed, 20 Feb 2013 18:00:29 +0000 (13:00 -0500) | ||
committer | Cyril Chemparathy <cyril@ti.com> | |
Wed, 20 Feb 2013 19:13:29 +0000 (14:13 -0500) |
This patch adds debug functions to print byte and unsigned long values
Signed-off-by: Vitaly Andrianov <vitalya@ti.com>
Signed-off-by: Vitaly Andrianov <vitalya@ti.com>
sec/debug.c | patch | blob | history | |
sec/debug.h | patch | blob | history |
diff --git a/sec/debug.c b/sec/debug.c
index 11c0cda32f4d81de9607728d496767b5fc9438b7..9eed67de0179b09792ef22ce9b2ef08b29b1fcaf 100644 (file)
--- a/sec/debug.c
+++ b/sec/debug.c
for (; *str != '\0'; str++ )
skern_putc(*str);
}
+
+static char dig[] = "0123456789abcdef";
+void skern_putbyte(unsigned char b)
+{
+ skern_putc(dig[(b >> 4) & 0xf]);
+ skern_putc(dig[b & 0xf]);
+}
+
+void skern_putui(unsigned int ul)
+{
+ skern_putbyte((ul >> 24) & 0xff);
+ skern_putbyte((ul >> 16) & 0xff);
+ skern_putbyte((ul >> 8) & 0xff);
+ skern_putbyte( ul & 0xff);
+}
diff --git a/sec/debug.h b/sec/debug.h
index 02da98e7fc599106f25865c16d342e4f08eb74de..6fef8ee0b4b12df3b3b2ace31a887ea8d8fca123 100644 (file)
--- a/sec/debug.h
+++ b/sec/debug.h
*/
#ifndef _SKERN_DEBUG
#define _SKERN_DEBUG
+
void skern_puts(char *str);
+void skern_putbyte(unsigned char b);
+void skern_putui(unsigned int ul);
+
#endif