<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
On 08/13/2012 11:31 AM, Gedare Bloom wrote:
<blockquote
cite="mid:CAC82fA0CAKbbk4-apbuZ+fwVgtaraO1mN6YMQpK1=ZLWeUCRWA@mail.gmail.com"
type="cite">Hi,<br>
Would there be any problem with just using 'rtems_putc'? the
rtems_debug_putc seems a little weird to me, because I think debug
is misleading here; I would expect something named as rtems_debug
to be only available when rtems-enable-debug is on, and otherwise
conditionally unavailable.<br>
<br>
Perhaps this is just me though. rtems_bsp_putc might be an ok
alternative.<br>
<br>
</blockquote>
printk vs rtems_xxx_putc just isn't consistent. :(<br>
<blockquote
cite="mid:CAC82fA0CAKbbk4-apbuZ+fwVgtaraO1mN6YMQpK1=ZLWeUCRWA@mail.gmail.com"
type="cite">-Gedare<br>
<br>
<div class="gmail_quote">On Mon, Aug 13, 2012 at 12:13 PM,
Sebastian Huber <span dir="ltr"><<a moz-do-not-send="true"
href="mailto:sebastian.huber@embedded-brains.de"
target="_blank">sebastian.huber@embedded-brains.de</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">This reduces
code size and provides a function similar to fputc().<br>
---<br>
cpukit/include/rtems/bspIo.h | 1 +<br>
cpukit/libcsupport/Makefile.am | 1 +<br>
cpukit/libcsupport/src/rtems_debug_putc.c | 24
++++++++++++++++++++++++<br>
cpukit/libcsupport/src/vprintk.c | 18
+++++++++---------<br>
4 files changed, 35 insertions(+), 9 deletions(-)<br>
create mode 100644 cpukit/libcsupport/src/rtems_debug_putc.c<br>
<br>
diff --git a/cpukit/include/rtems/bspIo.h
b/cpukit/include/rtems/bspIo.h<br>
index d5a004a..f702ae9 100644<br>
--- a/cpukit/include/rtems/bspIo.h<br>
+++ b/cpukit/include/rtems/bspIo.h<br>
@@ -53,6 +53,7 @@ extern int getchark(void);<br>
extern void vprintk(const char *fmt, va_list ap);<br>
extern void printk(const char *fmt, ...);<br>
extern void putk(const char *s);<br>
+extern void rtems_debug_putc(char c);<br>
<br>
/*<br>
* This routine is passed into RTEMS reporting functions<br>
diff --git a/cpukit/libcsupport/Makefile.am
b/cpukit/libcsupport/Makefile.am<br>
index ae23338..45d7684 100644<br>
--- a/cpukit/libcsupport/Makefile.am<br>
+++ b/cpukit/libcsupport/Makefile.am<br>
@@ -120,6 +120,7 @@ BSD_LIBC_C_FILES = src/strlcpy.c
src/strlcat.c src/issetugid.c<br>
<br>
libcsupport_a_SOURCES = src/gxx_wrappers.c src/getchark.c
src/printk.c \<br>
src/printk_plugin.c src/putk.c src/vprintk.c \<br>
+ src/rtems_debug_putc.c \<br>
src/printf_plugin.c \<br>
src/sup_fs_location.c \<br>
src/sup_fs_eval_path.c \<br>
diff --git a/cpukit/libcsupport/src/rtems_debug_putc.c
b/cpukit/libcsupport/src/rtems_debug_putc.c<br>
new file mode 100644<br>
index 0000000..0283efd<br>
--- /dev/null<br>
+++ b/cpukit/libcsupport/src/rtems_debug_putc.c<br>
@@ -0,0 +1,24 @@<br>
+/*<br>
+ * Copyright (c) 2012 embedded brains GmbH. All rights
reserved.<br>
+ *<br>
+ * embedded brains GmbH<br>
+ * Obere Lagerstr. 30<br>
+ * 82178 Puchheim<br>
+ * Germany<br>
+ * <<a moz-do-not-send="true"
href="mailto:rtems@embedded-brains.de">rtems@embedded-brains.de</a>><br>
+ *<br>
+ * The license and distribution terms for this file may be<br>
+ * found in the file LICENSE in this distribution or at<br>
+ * <a moz-do-not-send="true"
href="http://www.rtems.com/license/LICENSE" target="_blank">http://www.rtems.com/license/LICENSE</a>.<br>
+ */<br>
+<br>
+#if HAVE_CONFIG_H<br>
+ #include "config.h"<br>
+#endif<br>
+<br>
+#include <rtems/bspIo.h><br>
+<br>
+void rtems_debug_putc(char c)<br>
+{<br>
+ (*BSP_output_char)(c);<br>
+}<br>
diff --git a/cpukit/libcsupport/src/vprintk.c
b/cpukit/libcsupport/src/vprintk.c<br>
index 1a8d5dd..d5255a7 100644<br>
--- a/cpukit/libcsupport/src/vprintk.c<br>
+++ b/cpukit/libcsupport/src/vprintk.c<br>
@@ -55,7 +55,7 @@ void vprintk(<br>
char c;<br>
<br>
if (*fmt != '%') {<br>
- BSP_output_char(*fmt);<br>
+ rtems_debug_putc(*fmt);<br>
continue;<br>
}<br>
fmt++;<br>
@@ -80,7 +80,7 @@ void vprintk(<br>
if ( c == 'c' ) {<br>
/* need a cast here since va_arg() only takes fully
promoted types */<br>
char chr = (char) va_arg(ap, int);<br>
- BSP_output_char(chr);<br>
+ rtems_debug_putc(chr);<br>
continue;<br>
}<br>
if ( c == 's' ) {<br>
@@ -100,7 +100,7 @@ void vprintk(<br>
/* leading spaces */<br>
if ( !minus )<br>
for ( i=len ; i<width ; i++ )<br>
- BSP_output_char(' ');<br>
+ rtems_debug_putc(' ');<br>
<br>
/* no width option */<br>
if (width == 0) {<br>
@@ -109,12 +109,12 @@ void vprintk(<br>
<br>
/* output the string */<br>
for ( i=0 ; i<width && *str ; str++ )<br>
- BSP_output_char(*str);<br>
+ rtems_debug_putc(*str);<br>
<br>
/* trailing spaces */<br>
if ( minus )<br>
for ( i=len ; i<width ; i++ )<br>
- BSP_output_char(' ');<br>
+ rtems_debug_putc(' ');<br>
<br>
continue;<br>
}<br>
@@ -132,7 +132,7 @@ void vprintk(<br>
} else if ( c == 'p' ) {<br>
base = 16; sign = false; lflag = true;<br>
} else {<br>
- BSP_output_char(c);<br>
+ rtems_debug_putc(c);<br>
continue;<br>
}<br>
<br>
@@ -166,7 +166,7 @@ static void printNum(<br>
char toPrint[20];<br>
<br>
if ( sign && (num < 0) ) {<br>
- BSP_output_char('-');<br>
+ rtems_debug_putc('-');<br>
unsigned_num = (unsigned long) -num;<br>
if (maxwidth) maxwidth--;<br>
} else {<br>
@@ -181,9 +181,9 @@ static void printNum(<br>
toPrint[count++] = (char) unsigned_num;<br>
<br>
for (n=maxwidth ; n > count; n-- )<br>
- BSP_output_char(lead);<br>
+ rtems_debug_putc(lead);<br>
<br>
for (n = 0; n < count; n++) {<br>
-
BSP_output_char("0123456789ABCDEF"[(int)(toPrint[count-(n+1)])]);<br>
+
rtems_debug_putc("0123456789ABCDEF"[(int)(toPrint[count-(n+1)])]);<br>
}<br>
}<br>
<span class="HOEnZb"><font color="#888888">--<br>
1.7.7<br>
<br>
_______________________________________________<br>
rtems-devel mailing list<br>
<a moz-do-not-send="true"
href="mailto:rtems-devel@rtems.org">rtems-devel@rtems.org</a><br>
<a moz-do-not-send="true"
href="http://www.rtems.org/mailman/listinfo/rtems-devel"
target="_blank">http://www.rtems.org/mailman/listinfo/rtems-devel</a><br>
</font></span></blockquote>
</div>
<br>
</blockquote>
<br>
<br>
<pre class="moz-signature" cols="72">--
Joel Sherrill, Ph.D. Director of Research& Development
<a class="moz-txt-link-abbreviated" href="mailto:joel.sherrill@OARcorp.com">joel.sherrill@OARcorp.com</a> On-Line Applications Research
Ask me about RTEMS: a free RTOS Huntsville AL 35805
Support Available (256) 722-9985
</pre>
</body>
</html>