Skip to contentSkip to conversation

debug_ll.h: add PUTS_LL() function

PATCH Superseded Antony Pavlov 2 participants 3 messages Jul 17, 2011 – Jul 18, 2011

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 debug_ll.h: add PUTS_LL() function

---
 include/debug_ll.h |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
include/debug_ll.h +10 -0
index e99ae7d..87aa083 100644
@@ -35,9 +35,19 @@
 			     ch = ((v >> (i*4)) & 0xf);\
 			     ch += (ch >= 10) ? 'a' - 10 : '0';\
 			     PUTC_LL (ch); }})
+
+static __inline__ void PUTS_LL(char * str)
+{
+	while (*str) {
+		PUTC_LL(*str);
+		str++;
+	}
+}
+
 #else
 # define PUTC_LL(c) do {} while (0)
 # define PUTHEX_LL(v) do {} while (0)
+# define PUTS_LL(c) do {} while (0)
 
 #endif
 
Signature · 7 lines
1.7.5.4


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#1 lore raw

PATCH 2/2 startup.c: make DEBUG_LL output more useful

---
 common/startup.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
common/startup.c +5 -1
index 00bc9a0..f8efa08 100644
@@ -134,13 +134,17 @@ void start_barebox (void)
 
 	for (initcall = __barebox_initcalls_start;
 			initcall < __barebox_initcalls_end; initcall++) {
+		PUTS_LL("<<");
 		PUTHEX_LL(*initcall);
-		PUTC_LL('\n');
 		result = (*initcall)();
+		PUTC_LL('>');
 		if (result)
 			hang();
+		PUTS_LL(">\r\n");
 	}
 
+	PUTS_LL("initcalls done\r\n");
+
 	display_meminfo();
 
 #ifdef CONFIG_ENV_HANDLING
Signature · 7 lines
1.7.5.4


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#2 lore raw

Re: [PATCH 2/2] startup.c: make DEBUG_LL output more useful

Quoted 11 lines · Antony Pavlov
---
 common/startup.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
common/startup.c +0 -0
index 00bc9a0..f8efa08 100644
@@ -134,13 +134,17 @@ void start_barebox (void)
 

common/startup.c void start_barebox (void) · line 143

Quoted 10 lines
common/startup.c +3 -1
 	for (initcall = __barebox_initcalls_start;
 			initcall < __barebox_initcalls_end; initcall++) {
+		PUTS_LL("<<");
 		PUTHEX_LL(*initcall);
-		PUTC_LL('\n');
 		result = (*initcall)();
+		PUTC_LL('>');
 		if (result)
 			hang();
+		PUTS_LL(">\r\n");

Looks mostly good. Can we to the \n -> \r\n conversion in PUTS_LL instead?

Sascha

Quoted 16 lines
common/startup.c +2 -0
 	}
 
+	PUTS_LL("initcalls done\r\n");
+
 	display_meminfo();
 
 #ifdef CONFIG_ENV_HANDLING
Signature · 7 lines
1.7.5.4


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
Signature · 9 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox