summaryrefslogtreecommitdiffstats
path: root/cpukit/include/rtems/bspIo.h
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2007-09-06 22:51:25 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2007-09-06 22:51:25 +0000
commit90a5d194a2712d7e28eafa1aac0b9fdb32e7b96b (patch)
tree251aff7b38cce4867fb2a77f5bbafa3b8ccb9785 /cpukit/include/rtems/bspIo.h
parent2007-09-06 Joel Sherrill <joel.sherrill@oarcorp.com> (diff)
downloadrtems-90a5d194a2712d7e28eafa1aac0b9fdb32e7b96b.tar.bz2
2007-09-06 Joel Sherrill <joel.sherrill@oarcorp.com>
* libcsupport/Makefile.am, libcsupport/src/printk.c: * libcsupport/src/printk_plugin.c: New file. include/rtems/bspIo.h, libmisc/cpuuse/cpuusagereport.c, libmisc/cpuuse/cpuuse.h, libmisc/stackchk/check.c, libmisc/stackchk/stackchk.h: rtems/include/rtems/rtems/ratemon.h, rtems/src/ratemonreportstatistics.c: Added capability to specify your own "printf" routine to various reporting functions. This added an XXX_with_plugin as the underlying implementation for + rtems_rate_monotonic_report_statistics + rtems_stack_checker_report_usage + rtems_cpu_usage_report As demonstration, the http netdemo can now print out stack and cpu usage reports.
Diffstat (limited to '')
-rw-r--r--cpukit/include/rtems/bspIo.h21
1 files changed, 19 insertions, 2 deletions
diff --git a/cpukit/include/rtems/bspIo.h b/cpukit/include/rtems/bspIo.h
index d3eda5610a..3e8eb5a534 100644
--- a/cpukit/include/rtems/bspIo.h
+++ b/cpukit/include/rtems/bspIo.h
@@ -37,8 +37,25 @@ extern BSP_polling_getchar_function_type BSP_poll_char;
* and initialisation of the previous variable are done.
*/
#include <stdarg.h>
-extern void vprintk(char *fmt, va_list ap);
-extern void printk(char *fmt, ...);
+
+extern void vprintk(const char *fmt, va_list ap);
+extern void printk(const char *fmt, ...);
+
+/*
+ * This routine is passed into RTEMS reporting functions
+ * that may have their output redirected. In particular,
+ * the cpu usage, period usage, and stack usage reporting
+ * functions use this. If the user provides their
+ * own "printf plugin", then they may redirect those reports
+ * as they see fit.
+ */
+extern int printk_plugin(void *context, const char *fmt, ...);
+
+/*
+ * Type definition for function which can be plugged in to
+ * certain reporting routines to redirect the output
+ */
+typedef int (*rtems_printk_plugin_t)(void *, const char *format, ...);
#ifdef __cplusplus
}