summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Norum <WENorum@lbl.gov>2002-10-30 19:47:03 +0000
committerEric Norum <WENorum@lbl.gov>2002-10-30 19:47:03 +0000
commit108bab3ee72cdc8f799b71987f7b4db442c5d287 (patch)
tree1fc52d7755647a85d2f593ef50e715a717eda2a6
parent489782d481478a25e80df2d7ae0aa6b543764ed9 (diff)
downloadrtems-108bab3ee72cdc8f799b71987f7b4db442c5d287.tar.bz2
Add vprintk function for kernel printing from routines
which have already obtained the va_list pointer.
-rw-r--r--cpukit/include/rtems/bspIo.h2
-rw-r--r--cpukit/libcsupport/src/printk.c15
2 files changed, 13 insertions, 4 deletions
diff --git a/cpukit/include/rtems/bspIo.h b/cpukit/include/rtems/bspIo.h
index 0e2cdfb713..53618121f1 100644
--- a/cpukit/include/rtems/bspIo.h
+++ b/cpukit/include/rtems/bspIo.h
@@ -32,6 +32,8 @@ extern BSP_polling_getchar_function_type BSP_poll_char;
* the files contained in this directory PROVIDED definition
* and initialisation of the previous variable are done.
*/
+#include <stdarg.h>
+extern void vprintk(char *fmt, va_list ap);
extern void printk(char *fmt, ...);
#endif
diff --git a/cpukit/libcsupport/src/printk.c b/cpukit/libcsupport/src/printk.c
index 3542fd465a..433560a4fc 100644
--- a/cpukit/libcsupport/src/printk.c
+++ b/cpukit/libcsupport/src/printk.c
@@ -73,16 +73,14 @@ printNum(long unsigned int num, int base, int sign, int maxwidth, int lead)
| Returns: Nothing.
+--------------------------------------------------------------------------*/
void
-printk(char *fmt, ...)
+vprintk(char *fmt, va_list ap)
{
- va_list ap; /* points to each unnamed argument in turn */
char c, *str;
int lflag, base, sign, width, lead;
/* unsigned int level; */
/* _CPU_ISR_Disable(level); */
- va_start(ap, fmt); /* make ap point to 1st unnamed arg */
for (; *fmt != '\0'; fmt++)
{
lflag = 0;
@@ -143,8 +141,17 @@ printk(char *fmt, ...)
BSP_output_char(*fmt);
}
}
- va_end(ap); /* clean up when done */
/* _CPU_ISR_Enable(level); */
+} /* vprintk */
+
+void
+printk(char *fmt, ...)
+{
+ va_list ap; /* points to each unnamed argument in turn */
+
+ va_start(ap, fmt); /* make ap point to 1st unnamed arg */
+ vprintk(fmt, ap);
+ va_end(ap); /* clean up when done */
} /* printk */