summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/unix/posix
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2007-12-12 17:08:20 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2007-12-12 17:08:20 +0000
commita70ec6cb9cc31d6b2b697bdc624a66cca8b05eb5 (patch)
tree25d8e95e35434a8d8e9f3d5dd8f4410610a00b19 /c/src/lib/libbsp/unix/posix
parent2007-12-12 Joel Sherrill <joel.sherrill@OARcorp.com> (diff)
downloadrtems-a70ec6cb9cc31d6b2b697bdc624a66cca8b05eb5.tar.bz2
2007-12-12 Joel Sherrill <joel.sherrill@OARcorp.com>
* Makefile.am, startup/bspstart.c: Links and runs again. * console/console-io.c: New file.
Diffstat (limited to 'c/src/lib/libbsp/unix/posix')
-rw-r--r--c/src/lib/libbsp/unix/posix/ChangeLog5
-rw-r--r--c/src/lib/libbsp/unix/posix/Makefile.am5
-rw-r--r--c/src/lib/libbsp/unix/posix/console/console-io.c21
-rw-r--r--c/src/lib/libbsp/unix/posix/startup/bspstart.c36
4 files changed, 47 insertions, 20 deletions
diff --git a/c/src/lib/libbsp/unix/posix/ChangeLog b/c/src/lib/libbsp/unix/posix/ChangeLog
index c1537b18fd..961a39a5f2 100644
--- a/c/src/lib/libbsp/unix/posix/ChangeLog
+++ b/c/src/lib/libbsp/unix/posix/ChangeLog
@@ -1,3 +1,8 @@
+2007-12-12 Joel Sherrill <joel.sherrill@OARcorp.com>
+
+ * Makefile.am, startup/bspstart.c: Links and runs again.
+ * console/console-io.c: New file.
+
2007-12-11 Joel Sherrill <joel.sherrill@OARcorp.com>
* clock/clock.c, include/bsp.h, startup/bspstart.c,
diff --git a/c/src/lib/libbsp/unix/posix/Makefile.am b/c/src/lib/libbsp/unix/posix/Makefile.am
index 436a1f4565..ad9ff71543 100644
--- a/c/src/lib/libbsp/unix/posix/Makefile.am
+++ b/c/src/lib/libbsp/unix/posix/Makefile.am
@@ -41,7 +41,8 @@ noinst_LIBRARIES =
noinst_PROGRAMS += startup.rel
startup_rel_SOURCES = startup/bspclean.c ../../shared/bsplibc.c \
- startup/bspstart.c startup/setvec.c ../../shared/bootcard.c
+ ../../shared/bsppredriverhook.c startup/bspstart.c \
+ startup/setvec.c ../../shared/bootcard.c
## for now always using main.c style startup
##if !HAS_CXX
startup_rel_SOURCES += startup/main.c
@@ -56,7 +57,7 @@ clock_rel_CPPFLAGS = $(AM_CPPFLAGS)
clock_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
noinst_PROGRAMS += console.rel
-console_rel_SOURCES = console/console.c
+console_rel_SOURCES = console/console.c console/console-io.c
console_rel_CPPFLAGS = $(AM_CPPFLAGS)
console_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
diff --git a/c/src/lib/libbsp/unix/posix/console/console-io.c b/c/src/lib/libbsp/unix/posix/console/console-io.c
new file mode 100644
index 0000000000..a2f7e814e0
--- /dev/null
+++ b/c/src/lib/libbsp/unix/posix/console/console-io.c
@@ -0,0 +1,21 @@
+/*
+ * UNIX BSP Debug IO
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.com/license/LICENSE.
+ *
+ * $Id$
+ */
+
+/*
+ * To support printk
+ */
+
+#include <rtems/bspIo.h>
+#include <stdio.h>
+
+void POSIX_BSP_output_char(char c) { fputc( c, stderr ); }
+
+BSP_output_char_function_type BSP_output_char = POSIX_BSP_output_char;
+BSP_polling_getchar_function_type BSP_poll_char = NULL;
diff --git a/c/src/lib/libbsp/unix/posix/startup/bspstart.c b/c/src/lib/libbsp/unix/posix/startup/bspstart.c
index 45001c68ef..51bd1dbedd 100644
--- a/c/src/lib/libbsp/unix/posix/startup/bspstart.c
+++ b/c/src/lib/libbsp/unix/posix/startup/bspstart.c
@@ -106,37 +106,37 @@ void bsp_postdriver_hook(void)
void bsp_start(void)
{
- uintptr_t workspace_ptr;
+ uintptr_t workspace_ptr;
+ cpu_number = 0;
+
+ #if defined(RTEMS_MULTIPROCESSING)
/*
* If the node number is -1 then the application better provide
* it through environment variables RTEMS_NODE.
* Ditto for RTEMS_MAXIMUM_NODES
*/
-
if (Configuration.User_multiprocessing_table) {
- char *p;
-
- if (Configuration.User_multiprocessing_table->node == -1) {
- p = getenv("RTEMS_NODE");
- Configuration.User_multiprocessing_table->node = p ? atoi(p) : 1;
- }
-
- /* If needed provide maximum_nodes also */
- if (Configuration.User_multiprocessing_table->maximum_nodes == -1) {
- p = getenv("RTEMS_MAXIMUM_NODES");
- Configuration.User_multiprocessing_table->maximum_nodes = p ? atoi(p) : 1;
- }
+ char *p;
+
+ if (Configuration.User_multiprocessing_table->node == -1) {
+ p = getenv("RTEMS_NODE");
+ Configuration.User_multiprocessing_table->node = p ? atoi(p) : 1;
+ }
+
+ /* If needed provide maximum_nodes also */
+ if (Configuration.User_multiprocessing_table->maximum_nodes == -1) {
+ p = getenv("RTEMS_MAXIMUM_NODES");
+ Configuration.User_multiprocessing_table->maximum_nodes = p ? atoi(p) : 1;
+ }
}
/*
* Set cpu_number to accurately reflect our cpu number
*/
-
- if (Configuration.User_multiprocessing_table->User_multiprocessing_table)
+ if (Configuration.User_multiprocessing_table)
cpu_number = Configuration.User_multiprocessing_table->node - 1;
- else
- cpu_number = 0;
+ #endif
if (getenv("RTEMS_WORKSPACE_SIZE"))
rtems_configuration_get_work_space_size() =