summaryrefslogtreecommitdiffstats
path: root/c
diff options
context:
space:
mode:
authorTill Straumann <strauman@slac.stanford.edu>2009-10-28 01:24:10 +0000
committerTill Straumann <strauman@slac.stanford.edu>2009-10-28 01:24:10 +0000
commit7699617f2ad500878376891d805099dc5c57af99 (patch)
tree4589531735ad8be60974774e7e413041faf7d869 /c
parent2009-10-27 Ralf Corsépius <ralf.corsepius@rtems.org> (diff)
downloadrtems-7699617f2ad500878376891d805099dc5c57af99.tar.bz2
2009-12-27 Till Straumann <strauman@slac.stanford.edu>
* include/bsp.h, console/console.c: Provide weak-alias hook so that the application may choose the console.
Diffstat (limited to 'c')
-rw-r--r--c/src/lib/libbsp/i386/pc386/ChangeLog5
-rw-r--r--c/src/lib/libbsp/i386/pc386/console/console.c7
-rw-r--r--c/src/lib/libbsp/i386/pc386/include/bsp.h8
3 files changed, 20 insertions, 0 deletions
diff --git a/c/src/lib/libbsp/i386/pc386/ChangeLog b/c/src/lib/libbsp/i386/pc386/ChangeLog
index e6bbcd0a22..31803f5503 100644
--- a/c/src/lib/libbsp/i386/pc386/ChangeLog
+++ b/c/src/lib/libbsp/i386/pc386/ChangeLog
@@ -1,3 +1,8 @@
+2009-12-27 Till Straumann <strauman@slac.stanford.edu>
+
+ * include/bsp.h, console/console.c: Provide weak-alias
+ hook so that the application may choose the console.
+
2009-10-21 Ralf Corsépius <ralf.corsepius@rtems.org>
* make/custom/pc386.cfg: Remove RTEMS_BSP_FAMILY.
diff --git a/c/src/lib/libbsp/i386/pc386/console/console.c b/c/src/lib/libbsp/i386/pc386/console/console.c
index 907d540542..8b4664b9d4 100644
--- a/c/src/lib/libbsp/i386/pc386/console/console.c
+++ b/c/src/lib/libbsp/i386/pc386/console/console.c
@@ -139,6 +139,10 @@ int kbd_poll_read( int minor )
return -1;
}
+/* provide default that does nothing */
+extern void
+BSP_runtime_console_select(int *, int *) __attribute__((weak));
+
/*-------------------------------------------------------------------------+
| Console device driver INITIALIZE entry point.
+--------------------------------------------------------------------------+
@@ -186,6 +190,9 @@ console_initialize(rtems_device_major_number major,
*/
rtems_termios_initialize ();
+ if ( BSP_runtime_console_select )
+ BSP_runtime_console_select(&BSPPrintkPort, &BSPConsolePort);
+
#ifdef RTEMS_RUNTIME_CONSOLE_SELECT
/*
* If no video card, fall back to serial port console
diff --git a/c/src/lib/libbsp/i386/pc386/include/bsp.h b/c/src/lib/libbsp/i386/pc386/include/bsp.h
index 80fd33978f..ddf0ded9c6 100644
--- a/c/src/lib/libbsp/i386/pc386/include/bsp.h
+++ b/c/src/lib/libbsp/i386/pc386/include/bsp.h
@@ -61,6 +61,14 @@ extern "C" {
*/
struct rtems_bsdnet_ifconfig;
+/* app. may provide a routine (called _very_ early) to tell us
+ * which ports to use for printk / console. BSP provides a default
+ * implementation (weak alias) which does nothing (use BSP default
+ * ports).
+ */
+extern void
+BSP_runtime_console_select(int *pPrintkPort, int *pConsolePort);
+
extern int rtems_ne_driver_attach(struct rtems_bsdnet_ifconfig *, int);
#define BSP_NE2000_NETWORK_DRIVER_NAME "ne1"
#define BSP_NE2000_NETWORK_DRIVER_ATTACH rtems_ne_driver_attach