From a70ec6cb9cc31d6b2b697bdc624a66cca8b05eb5 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Wed, 12 Dec 2007 17:08:20 +0000 Subject: 2007-12-12 Joel Sherrill * Makefile.am, startup/bspstart.c: Links and runs again. * console/console-io.c: New file. --- c/src/lib/libbsp/unix/posix/ChangeLog | 5 ++++ c/src/lib/libbsp/unix/posix/Makefile.am | 5 ++-- c/src/lib/libbsp/unix/posix/console/console-io.c | 21 ++++++++++++++ c/src/lib/libbsp/unix/posix/startup/bspstart.c | 36 ++++++++++++------------ 4 files changed, 47 insertions(+), 20 deletions(-) create mode 100644 c/src/lib/libbsp/unix/posix/console/console-io.c (limited to 'c/src/lib/libbsp/unix') 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 + + * Makefile.am, startup/bspstart.c: Links and runs again. + * console/console-io.c: New file. + 2007-12-11 Joel Sherrill * 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 +#include + +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() = -- cgit v1.2.3