[rtems commit] Make rtems/print.h independent of rtems/bspIo.h
Sebastian Huber
sebh at rtems.org
Wed Jun 22 05:46:10 UTC 2016
Module: rtems
Branch: master
Commit: ede1a4182df68b1191b8ef2031f7a1f14813b525
Changeset: http://git.rtems.org/rtems/commit/?id=ede1a4182df68b1191b8ef2031f7a1f14813b525
Author: Sebastian Huber <sebastian.huber at embedded-brains.de>
Date: Tue Jun 21 13:12:31 2016 +0200
Make rtems/print.h independent of rtems/bspIo.h
---
c/src/lib/libbsp/shared/src/irq-default-handler.c | 2 +-
c/src/libchip/rtc/ds1375.c | 1 +
cpukit/include/rtems/bspIo.h | 12 ------------
cpukit/include/rtems/print.h | 21 ++++++++++++++++-----
cpukit/libcsupport/src/printk_plugin.c | 1 +
cpukit/libdrvmgr/drvmgr_translate_check.c | 2 ++
cpukit/libfs/src/devfs/devfs_show.c | 2 ++
cpukit/libfs/src/jffs2/include/linux/kernel-rtems.h | 2 +-
cpukit/libmisc/mouse/mouse_parser.c | 1 +
cpukit/libmisc/mouse/serial_mouse.c | 1 +
testsuites/libtests/block08/bdbuf_tests.h | 1 +
testsuites/samples/cdtest/main.cc | 1 +
testsuites/sptests/spprintk/init.c | 1 -
testsuites/support/include/buffer_test_io.h | 1 +
14 files changed, 29 insertions(+), 20 deletions(-)
diff --git a/c/src/lib/libbsp/shared/src/irq-default-handler.c b/c/src/lib/libbsp/shared/src/irq-default-handler.c
index f1d1e38..4f4b4be 100644
--- a/c/src/lib/libbsp/shared/src/irq-default-handler.c
+++ b/c/src/lib/libbsp/shared/src/irq-default-handler.c
@@ -14,7 +14,7 @@
#include <inttypes.h>
-#include <rtems/print.h>
+#include <rtems/bspIo.h>
#include <bsp/irq-generic.h>
diff --git a/c/src/libchip/rtc/ds1375.c b/c/src/libchip/rtc/ds1375.c
index f7e58f2..4a23a00 100644
--- a/c/src/libchip/rtc/ds1375.c
+++ b/c/src/libchip/rtc/ds1375.c
@@ -51,6 +51,7 @@
#include <unistd.h> /* write, read, close */
#include <rtems.h>
+#include <rtems/bspIo.h>
#include <rtems/rtc.h>
#include <rtems/score/sysstate.h>
#include <libchip/rtc.h>
diff --git a/cpukit/include/rtems/bspIo.h b/cpukit/include/rtems/bspIo.h
index 4b5b2a2..d0d8f83 100644
--- a/cpukit/include/rtems/bspIo.h
+++ b/cpukit/include/rtems/bspIo.h
@@ -122,18 +122,6 @@ extern int putk(const char *s);
*/
extern void rtems_putc(char c);
-/**
- * Type definition for function which can be plugged in to
- * certain reporting routines to redirect the output.
- *
- * Use the RTEMS Print interface to call these functions. Do not
- * directly use them.
- *
- * If the user provides their own "printf plugin", then they may
- * redirect those reports as they see fit.
- */
-typedef int (*rtems_print_plugin_t)(void *, const char *format, va_list ap);
-
/**@}*/
#ifdef __cplusplus
diff --git a/cpukit/include/rtems/print.h b/cpukit/include/rtems/print.h
index c4dacce..07e50d0 100644
--- a/cpukit/include/rtems/print.h
+++ b/cpukit/include/rtems/print.h
@@ -18,11 +18,10 @@
#ifndef _RTEMS_PRINT_H
#define _RTEMS_PRINT_H
-#include <stdbool.h>
-#include <stddef.h>
-#include <stdio.h>
+#include <rtems/score/basedefs.h>
-#include <rtems/bspIo.h>
+#include <stdarg.h>
+#include <stdio.h>
#ifdef __cplusplus
extern "C" {
@@ -36,12 +35,24 @@ extern "C" {
*/
/**
+ * Type definition for function which can be plugged in to certain reporting
+ * routines to redirect the output.
+ *
+ * Use the RTEMS Print interface to call these functions. Do not directly use
+ * them.
+ *
+ * If the user provides their own printer, then they may redirect those reports
+ * as they see fit.
+ */
+typedef int (*rtems_print_printer)(void *, const char *format, va_list ap);
+
+/**
* Type definition for the printer structure used to access the kernel print
* support.
*/
typedef struct rtems_printer {
void *context;
- rtems_print_plugin_t printer;
+ rtems_print_printer printer;
} rtems_printer;
/**
diff --git a/cpukit/libcsupport/src/printk_plugin.c b/cpukit/libcsupport/src/printk_plugin.c
index 485346d..38214f8 100644
--- a/cpukit/libcsupport/src/printk_plugin.c
+++ b/cpukit/libcsupport/src/printk_plugin.c
@@ -19,6 +19,7 @@
#endif
#include <rtems/print.h>
+#include <rtems/bspIo.h>
static int printk_plugin(
void *ignored,
diff --git a/cpukit/libdrvmgr/drvmgr_translate_check.c b/cpukit/libdrvmgr/drvmgr_translate_check.c
index e5f0b7a..5ee0930 100644
--- a/cpukit/libdrvmgr/drvmgr_translate_check.c
+++ b/cpukit/libdrvmgr/drvmgr_translate_check.c
@@ -9,6 +9,8 @@
#include <drvmgr/drvmgr.h>
+#include <rtems/bspIo.h>
+
/* Calls drvmgr_translate() to translate an address range and check the result,
* a printout is generated if the check fails. See paramters of
* drvmgr_translate().
diff --git a/cpukit/libfs/src/devfs/devfs_show.c b/cpukit/libfs/src/devfs/devfs_show.c
index b5984bd..0ea1306 100644
--- a/cpukit/libfs/src/devfs/devfs_show.c
+++ b/cpukit/libfs/src/devfs/devfs_show.c
@@ -17,6 +17,8 @@
#include "devfs.h"
+#include <rtems/bspIo.h>
+
void devFS_Show(void)
{
rtems_filesystem_location_info_t *rootloc = &rtems_filesystem_root->location;
diff --git a/cpukit/libfs/src/jffs2/include/linux/kernel-rtems.h b/cpukit/libfs/src/jffs2/include/linux/kernel-rtems.h
index 0852034..0550446 100644
--- a/cpukit/libfs/src/jffs2/include/linux/kernel-rtems.h
+++ b/cpukit/libfs/src/jffs2/include/linux/kernel-rtems.h
@@ -18,7 +18,7 @@
#define __LINUX_RTEMS_IMPL_H__
#include <rtems.h>
-#include <rtems/print.h>
+#include <rtems/bspIo.h>
static inline char *do_kmemdup(const char *s, size_t n)
{
diff --git a/cpukit/libmisc/mouse/mouse_parser.c b/cpukit/libmisc/mouse/mouse_parser.c
index 2831f64..573e6cf 100644
--- a/cpukit/libmisc/mouse/mouse_parser.c
+++ b/cpukit/libmisc/mouse/mouse_parser.c
@@ -40,6 +40,7 @@
#include <errno.h>
#include <rtems.h>
+#include <rtems/bspIo.h>
#include <rtems/mouse_parser.h>
#include <rtems/mw_uid.h>
diff --git a/cpukit/libmisc/mouse/serial_mouse.c b/cpukit/libmisc/mouse/serial_mouse.c
index eb993b4..874903a 100644
--- a/cpukit/libmisc/mouse/serial_mouse.c
+++ b/cpukit/libmisc/mouse/serial_mouse.c
@@ -20,6 +20,7 @@
#include <sys/stat.h>
#include <fcntl.h>
+#include <rtems/bspIo.h>
#include <rtems/libio.h>
#include <termios.h>
#include <rtems/termiostypes.h>
diff --git a/testsuites/libtests/block08/bdbuf_tests.h b/testsuites/libtests/block08/bdbuf_tests.h
index 1a0703f..b5d5967 100644
--- a/testsuites/libtests/block08/bdbuf_tests.h
+++ b/testsuites/libtests/block08/bdbuf_tests.h
@@ -16,6 +16,7 @@
#include <stdio.h>
#include <string.h>
#include <errno.h>
+#include <rtems/bspIo.h>
#include <rtems/diskdevs.h>
#include <rtems/bdbuf.h>
diff --git a/testsuites/samples/cdtest/main.cc b/testsuites/samples/cdtest/main.cc
index 4274f65..8aea62f 100644
--- a/testsuites/samples/cdtest/main.cc
+++ b/testsuites/samples/cdtest/main.cc
@@ -23,6 +23,7 @@
*/
#include <rtems.h>
+#include <rtems/bspIo.h>
#include <rtems/test.h>
#include <cstdio>
diff --git a/testsuites/sptests/spprintk/init.c b/testsuites/sptests/spprintk/init.c
index 55e132d..0f5c2a7 100644
--- a/testsuites/sptests/spprintk/init.c
+++ b/testsuites/sptests/spprintk/init.c
@@ -24,7 +24,6 @@
#define TESTS_USE_PRINTK
#include <tmacros.h>
-#include <rtems/print.h>
const char rtems_test_name[] = "SPPRINTK";
diff --git a/testsuites/support/include/buffer_test_io.h b/testsuites/support/include/buffer_test_io.h
index 0ae3909..ac73352 100644
--- a/testsuites/support/include/buffer_test_io.h
+++ b/testsuites/support/include/buffer_test_io.h
@@ -5,6 +5,7 @@
#ifndef __BUFFER_TEST_IO_h
#define __BUFFER_TEST_IO_h
+#include <rtems/bspIo.h>
#include <rtems/test.h>
#ifdef __cplusplus
More information about the vc
mailing list