summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/m68k
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>1998-03-30 14:01:19 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>1998-03-30 14:01:19 +0000
commit8f95b5f67b59eef4aa392b6be72f59af720d9ea2 (patch)
treeaf9b523e50efac2535bb4adc90d162f84ec78284 /c/src/lib/libbsp/m68k
parentRenamed crt0.o to crt0_go32.o to avoid build problems. (diff)
downloadrtems-8f95b5f67b59eef4aa392b6be72f59af720d9ea2.tar.bz2
Moved bsp_postdriver_hook() to a shared file and made it a common
component.
Diffstat (limited to 'c/src/lib/libbsp/m68k')
-rw-r--r--c/src/lib/libbsp/m68k/dmv152/startup/Makefile.in2
-rw-r--r--c/src/lib/libbsp/m68k/dmv152/startup/bspstart.c28
-rw-r--r--c/src/lib/libbsp/m68k/efi332/startup/Makefile.in2
-rw-r--r--c/src/lib/libbsp/m68k/efi332/startup/bspstart.c30
-rw-r--r--c/src/lib/libbsp/m68k/efi68k/startup/Makefile.in2
-rw-r--r--c/src/lib/libbsp/m68k/efi68k/startup/bspstart.c29
-rw-r--r--c/src/lib/libbsp/m68k/gen68302/startup/Makefile.in2
-rw-r--r--c/src/lib/libbsp/m68k/gen68302/startup/bspstart.c29
-rw-r--r--c/src/lib/libbsp/m68k/gen68360/startup/Makefile.in2
-rw-r--r--c/src/lib/libbsp/m68k/gen68360/startup/bspstart.c28
-rw-r--r--c/src/lib/libbsp/m68k/idp/startup/Makefile.in2
-rw-r--r--c/src/lib/libbsp/m68k/idp/startup/bspstart.c28
-rw-r--r--c/src/lib/libbsp/m68k/mvme136/startup/Makefile.in2
-rw-r--r--c/src/lib/libbsp/m68k/mvme136/startup/bspstart.c29
-rw-r--r--c/src/lib/libbsp/m68k/mvme147/startup/Makefile.in2
-rw-r--r--c/src/lib/libbsp/m68k/mvme147/startup/bspstart.c29
-rw-r--r--c/src/lib/libbsp/m68k/mvme147s/startup/Makefile.in2
-rw-r--r--c/src/lib/libbsp/m68k/mvme147s/startup/bspstart.c29
-rw-r--r--c/src/lib/libbsp/m68k/mvme162/startup/Makefile.in2
-rw-r--r--c/src/lib/libbsp/m68k/mvme162/startup/bspstart.c29
-rw-r--r--c/src/lib/libbsp/m68k/ods68302/startup/Makefile.in2
-rw-r--r--c/src/lib/libbsp/m68k/ods68302/startup/bspstart.c28
22 files changed, 39 insertions, 299 deletions
diff --git a/c/src/lib/libbsp/m68k/dmv152/startup/Makefile.in b/c/src/lib/libbsp/m68k/dmv152/startup/Makefile.in
index 4e05da9431..c8cbc6c78d 100644
--- a/c/src/lib/libbsp/m68k/dmv152/startup/Makefile.in
+++ b/c/src/lib/libbsp/m68k/dmv152/startup/Makefile.in
@@ -11,7 +11,7 @@ PROJECT_ROOT = @PROJECT_ROOT@
PGM=${ARCH}/startup.rel
# C source names, if any, go here -- minus the .c
-C_PIECES=bspclean bspstart main sbrk setvec vmeintr
+C_PIECES=bspclean bsppost bspstart main sbrk setvec vmeintr
C_FILES=$(C_PIECES:%=%.c)
C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
diff --git a/c/src/lib/libbsp/m68k/dmv152/startup/bspstart.c b/c/src/lib/libbsp/m68k/dmv152/startup/bspstart.c
index be1edde6fe..a63187cf78 100644
--- a/c/src/lib/libbsp/m68k/dmv152/startup/bspstart.c
+++ b/c/src/lib/libbsp/m68k/dmv152/startup/bspstart.c
@@ -26,7 +26,6 @@
#include <libcsupport.h>
#include <string.h>
-#include <fcntl.h>
#ifdef STACK_CHECKER_ON
#include <stackchk.h>
@@ -111,33 +110,10 @@ bsp_pretasking_hook(void)
/*
- * After drivers are setup, register some "filenames"
- * and open stdin, stdout, stderr files
- *
- * Newlib will automatically associate the files with these
- * (it hardcodes the numbers)
+ * Use the shared bsp_postdriver_hook() implementation
*/
-void
-bsp_postdriver_hook(void)
-{
- int stdin_fd, stdout_fd, stderr_fd;
- int error_code;
-
- error_code = 'S' << 24 | 'T' << 16;
-
- if ((stdin_fd = __rtems_open("/dev/console", O_RDONLY, 0)) == -1)
- rtems_fatal_error_occurred( error_code | 'D' << 8 | '0' );
-
- if ((stdout_fd = __rtems_open("/dev/console", O_WRONLY, 0)) == -1)
- rtems_fatal_error_occurred( error_code | 'D' << 8 | '1' );
-
- if ((stderr_fd = __rtems_open("/dev/console", O_WRONLY, 0)) == -1)
- rtems_fatal_error_occurred( error_code | 'D' << 8 | '2' );
-
- if ((stdin_fd != 0) || (stdout_fd != 1) || (stderr_fd != 2))
- rtems_fatal_error_occurred( error_code | 'I' << 8 | 'O' );
-}
+void bsp_postdriver_hook(void);
void bsp_start( void )
{
diff --git a/c/src/lib/libbsp/m68k/efi332/startup/Makefile.in b/c/src/lib/libbsp/m68k/efi332/startup/Makefile.in
index 6dd881b30c..d28b19db1f 100644
--- a/c/src/lib/libbsp/m68k/efi332/startup/Makefile.in
+++ b/c/src/lib/libbsp/m68k/efi332/startup/Makefile.in
@@ -11,7 +11,7 @@ PROJECT_ROOT = @PROJECT_ROOT@
PGM=${ARCH}/startup.rel
# C source names, if any, go here -- minus the .c
-C_PIECES=bspstart bspclean main sbrk setvec
+C_PIECES=bsppost bspstart bspclean main sbrk setvec
C_FILES=$(C_PIECES:%=%.c)
C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
diff --git a/c/src/lib/libbsp/m68k/efi332/startup/bspstart.c b/c/src/lib/libbsp/m68k/efi332/startup/bspstart.c
index b20bdd5ff1..6a2e6604eb 100644
--- a/c/src/lib/libbsp/m68k/efi332/startup/bspstart.c
+++ b/c/src/lib/libbsp/m68k/efi332/startup/bspstart.c
@@ -25,7 +25,6 @@
#include <libcsupport.h>
#include <string.h>
-#include <fcntl.h>
#ifdef STACK_CHECKER_ON
#include <stackchk.h>
@@ -119,34 +118,11 @@ bsp_pretasking_hook(void)
/*
- * After drivers are setup, register some "filenames"
- * and open stdin, stdout, stderr files
- *
- * Newlib will automatically associate the files with these
- * (it hardcodes the numbers)
+ * Use the shared bsp_postdriver_hook() implementation
*/
-void
-bsp_postdriver_hook(void)
-{
- int stdin_fd, stdout_fd, stderr_fd;
- int error_code;
-
- error_code = 'S' << 24 | 'T' << 16;
-
- if ((stdin_fd = __rtems_open("/dev/console", O_RDONLY, 0)) == -1)
- rtems_fatal_error_occurred( error_code | 'D' << 8 | '0' );
-
- if ((stdout_fd = __rtems_open("/dev/console", O_WRONLY, 0)) == -1)
- rtems_fatal_error_occurred( error_code | 'D' << 8 | '1' );
-
- if ((stderr_fd = __rtems_open("/dev/console", O_WRONLY, 0)) == -1)
- rtems_fatal_error_occurred( error_code | 'D' << 8 | '2' );
-
- if ((stdin_fd != 0) || (stdout_fd != 1) || (stderr_fd != 2))
- rtems_fatal_error_occurred( error_code | 'I' << 8 | 'O' );
-}
-
+void bsp_postdriver_hook(void);
+
void bsp_start( void )
{
void *vbr;
diff --git a/c/src/lib/libbsp/m68k/efi68k/startup/Makefile.in b/c/src/lib/libbsp/m68k/efi68k/startup/Makefile.in
index 0316a43525..13e0a5ae50 100644
--- a/c/src/lib/libbsp/m68k/efi68k/startup/Makefile.in
+++ b/c/src/lib/libbsp/m68k/efi68k/startup/Makefile.in
@@ -11,7 +11,7 @@ PROJECT_ROOT = @PROJECT_ROOT@
PGM=${ARCH}/startup.rel
# C source names, if any, go here -- minus the .c
-C_PIECES=bspstart bspclean efi68k_tcp efi68k_wd main sbrk setvec
+C_PIECES=bsppost bspstart bspclean efi68k_tcp efi68k_wd main sbrk setvec
C_FILES=$(C_PIECES:%=%.c)
C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
diff --git a/c/src/lib/libbsp/m68k/efi68k/startup/bspstart.c b/c/src/lib/libbsp/m68k/efi68k/startup/bspstart.c
index 339c809e4f..4c7431efb6 100644
--- a/c/src/lib/libbsp/m68k/efi68k/startup/bspstart.c
+++ b/c/src/lib/libbsp/m68k/efi68k/startup/bspstart.c
@@ -25,7 +25,6 @@
#include <libcsupport.h>
#include <string.h>
-#include <fcntl.h>
#ifdef STACK_CHECKER_ON
#include <stackchk.h>
@@ -124,33 +123,11 @@ bsp_pretasking_hook(void)
/*
- * After drivers are setup, register some "filenames"
- * and open stdin, stdout, stderr files
- *
- * Newlib will automatically associate the files with these
- * (it hardcodes the numbers)
+ * Use the shared bsp_postdriver_hook() implementation
*/
-void
-bsp_postdriver_hook(void)
-{
- int stdin_fd, stdout_fd, stderr_fd;
- int error_code;
-
- error_code = 'S' << 24 | 'T' << 16;
-
- if ((stdin_fd = __rtems_open("/dev/console", O_RDONLY, 0)) == -1)
- rtems_fatal_error_occurred( error_code | 'D' << 8 | '0' );
-
- if ((stdout_fd = __rtems_open("/dev/console", O_WRONLY, 0)) == -1)
- rtems_fatal_error_occurred( error_code | 'D' << 8 | '1' );
-
- if ((stderr_fd = __rtems_open("/dev/console", O_WRONLY, 0)) == -1)
- rtems_fatal_error_occurred( error_code | 'D' << 8 | '2' );
-
- if ((stdin_fd != 0) || (stdout_fd != 1) || (stderr_fd != 2))
- rtems_fatal_error_occurred( error_code | 'I' << 8 | 'O' );
-}
+void bsp_postdriver_hook(void);
+
void bsp_start( void )
{
diff --git a/c/src/lib/libbsp/m68k/gen68302/startup/Makefile.in b/c/src/lib/libbsp/m68k/gen68302/startup/Makefile.in
index d131f4a2ab..bc3a786ed5 100644
--- a/c/src/lib/libbsp/m68k/gen68302/startup/Makefile.in
+++ b/c/src/lib/libbsp/m68k/gen68302/startup/Makefile.in
@@ -11,7 +11,7 @@ PROJECT_ROOT = @PROJECT_ROOT@
PGM=${ARCH}/startup.rel
# C source names, if any, go here -- minus the .c
-C_PIECES=bspclean bspstart main sbrk setvec
+C_PIECES=bspclean bsppost bspstart main sbrk setvec
C_FILES=$(C_PIECES:%=%.c)
C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
diff --git a/c/src/lib/libbsp/m68k/gen68302/startup/bspstart.c b/c/src/lib/libbsp/m68k/gen68302/startup/bspstart.c
index 6f42beb938..f301a99297 100644
--- a/c/src/lib/libbsp/m68k/gen68302/startup/bspstart.c
+++ b/c/src/lib/libbsp/m68k/gen68302/startup/bspstart.c
@@ -26,7 +26,6 @@
#include <libcsupport.h>
#include <string.h>
-#include <fcntl.h>
#ifdef STACK_CHECKER_ON
#include <stackchk.h>
@@ -119,33 +118,11 @@ bsp_pretasking_hook(void)
/*
- * After drivers are setup, register some "filenames"
- * and open stdin, stdout, stderr files
- *
- * Newlib will automatically associate the files with these
- * (it hardcodes the numbers)
+ * Use the shared bsp_postdriver_hook() implementation
*/
-void
-bsp_postdriver_hook(void)
-{
- int stdin_fd, stdout_fd, stderr_fd;
- int error_code;
-
- error_code = 'S' << 24 | 'T' << 16;
-
- if ((stdin_fd = __rtems_open("/dev/console", O_RDONLY, 0)) == -1)
- rtems_fatal_error_occurred( error_code | 'D' << 8 | '0' );
-
- if ((stdout_fd = __rtems_open("/dev/console", O_WRONLY, 0)) == -1)
- rtems_fatal_error_occurred( error_code | 'D' << 8 | '1' );
-
- if ((stderr_fd = __rtems_open("/dev/console", O_WRONLY, 0)) == -1)
- rtems_fatal_error_occurred( error_code | 'D' << 8 | '2' );
-
- if ((stdin_fd != 0) || (stdout_fd != 1) || (stderr_fd != 2))
- rtems_fatal_error_occurred( error_code | 'I' << 8 | 'O' );
-}
+void bsp_postdriver_hook(void);
+
void bsp_start( void )
{
diff --git a/c/src/lib/libbsp/m68k/gen68360/startup/Makefile.in b/c/src/lib/libbsp/m68k/gen68360/startup/Makefile.in
index 4500ca87f4..dafab347c9 100644
--- a/c/src/lib/libbsp/m68k/gen68360/startup/Makefile.in
+++ b/c/src/lib/libbsp/m68k/gen68360/startup/Makefile.in
@@ -11,7 +11,7 @@ PROJECT_ROOT = @PROJECT_ROOT@
PGM=${ARCH}/startup.rel
# C source names, if any, go here -- minus the .c
-C_PIECES=alloc360 bspclean bspstart init68360 main sbrk setvec
+C_PIECES=alloc360 bspclean bsppost bspstart init68360 main sbrk setvec
C_FILES=$(C_PIECES:%=%.c)
C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
diff --git a/c/src/lib/libbsp/m68k/gen68360/startup/bspstart.c b/c/src/lib/libbsp/m68k/gen68360/startup/bspstart.c
index 6593087194..7c58cd9254 100644
--- a/c/src/lib/libbsp/m68k/gen68360/startup/bspstart.c
+++ b/c/src/lib/libbsp/m68k/gen68360/startup/bspstart.c
@@ -26,7 +26,6 @@
#include <libcsupport.h>
#include <string.h>
-#include <fcntl.h>
#ifdef STACK_CHECKER_ON
#include <stackchk.h>
@@ -115,33 +114,10 @@ bsp_pretasking_hook(void)
/*
- * After drivers are setup, register some "filenames"
- * and open stdin, stdout, stderr files
- *
- * Newlib will automatically associate the files with these
- * (it hardcodes the numbers)
+ * Use the shared bsp_postdriver_hook() implementation
*/
-void
-bsp_postdriver_hook(void)
-{
- int stdin_fd, stdout_fd, stderr_fd;
- int error_code;
-
- error_code = 'S' << 24 | 'T' << 16;
-
- if ((stdin_fd = __rtems_open("/dev/console", O_RDONLY, 0)) == -1)
- rtems_fatal_error_occurred( error_code | 'D' << 8 | '0' );
-
- if ((stdout_fd = __rtems_open("/dev/console", O_WRONLY, 0)) == -1)
- rtems_fatal_error_occurred( error_code | 'D' << 8 | '1' );
-
- if ((stderr_fd = __rtems_open("/dev/console", O_WRONLY, 0)) == -1)
- rtems_fatal_error_occurred( error_code | 'D' << 8 | '2' );
-
- if ((stdin_fd != 0) || (stdout_fd != 1) || (stderr_fd != 2))
- rtems_fatal_error_occurred( error_code | 'I' << 8 | 'O' );
-}
+void bsp_postdriver_hook(void);
void bsp_start( void )
{
diff --git a/c/src/lib/libbsp/m68k/idp/startup/Makefile.in b/c/src/lib/libbsp/m68k/idp/startup/Makefile.in
index ee58600cd3..709d28ab27 100644
--- a/c/src/lib/libbsp/m68k/idp/startup/Makefile.in
+++ b/c/src/lib/libbsp/m68k/idp/startup/Makefile.in
@@ -11,7 +11,7 @@ PROJECT_ROOT = @PROJECT_ROOT@
PGM=${ARCH}/startup.rel
# C source names, if any, go here -- minus the .c
-C_PIECES=bspclean bspstart main sbrk setvec
+C_PIECES=bspclean bsppost bspstart main sbrk setvec
C_FILES=$(C_PIECES:%=%.c)
C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
diff --git a/c/src/lib/libbsp/m68k/idp/startup/bspstart.c b/c/src/lib/libbsp/m68k/idp/startup/bspstart.c
index 2e226eb2b1..bf66f8f6ba 100644
--- a/c/src/lib/libbsp/m68k/idp/startup/bspstart.c
+++ b/c/src/lib/libbsp/m68k/idp/startup/bspstart.c
@@ -26,7 +26,6 @@
#include <libcsupport.h>
#include <string.h>
-#include <fcntl.h>
#ifdef STACK_CHECKER_ON
#include <stackchk.h>
@@ -120,33 +119,10 @@ bsp_pretasking_hook(void)
/*
- * After drivers are setup, register some "filenames"
- * and open stdin, stdout, stderr files
- *
- * Newlib will automatically associate the files with these
- * (it hardcodes the numbers)
+ * Use the shared bsp_postdriver_hook() implementation
*/
-void
-bsp_postdriver_hook(void)
-{
- int stdin_fd, stdout_fd, stderr_fd;
- int error_code;
-
- error_code = 'S' << 24 | 'T' << 16;
-
- if ((stdin_fd = __rtems_open("/dev/console", O_RDONLY, 0)) == -1)
- rtems_fatal_error_occurred( error_code | 'D' << 8 | '0' );
-
- if ((stdout_fd = __rtems_open("/dev/console", O_WRONLY, 0)) == -1)
- rtems_fatal_error_occurred( error_code | 'D' << 8 | '1' );
-
- if ((stderr_fd = __rtems_open("/dev/console", O_WRONLY, 0)) == -1)
- rtems_fatal_error_occurred( error_code | 'D' << 8 | '2' );
-
- if ((stdin_fd != 0) || (stdout_fd != 1) || (stderr_fd != 2))
- rtems_fatal_error_occurred( error_code | 'I' << 8 | 'O' );
-}
+void bsp_postdriver_hook(void);
void bsp_start( void )
{
diff --git a/c/src/lib/libbsp/m68k/mvme136/startup/Makefile.in b/c/src/lib/libbsp/m68k/mvme136/startup/Makefile.in
index 60cbb0ecc6..12fca968bc 100644
--- a/c/src/lib/libbsp/m68k/mvme136/startup/Makefile.in
+++ b/c/src/lib/libbsp/m68k/mvme136/startup/Makefile.in
@@ -11,7 +11,7 @@ PROJECT_ROOT = @PROJECT_ROOT@
PGM=${ARCH}/startup.rel
# C source names, if any, go here -- minus the .c
-C_PIECES=bspclean bspstart main sbrk setvec
+C_PIECES=bspclean bsppost bspstart main sbrk setvec
C_FILES=$(C_PIECES:%=%.c)
C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
diff --git a/c/src/lib/libbsp/m68k/mvme136/startup/bspstart.c b/c/src/lib/libbsp/m68k/mvme136/startup/bspstart.c
index 6c923e6073..f551c78c2e 100644
--- a/c/src/lib/libbsp/m68k/mvme136/startup/bspstart.c
+++ b/c/src/lib/libbsp/m68k/mvme136/startup/bspstart.c
@@ -27,7 +27,6 @@
#include <zilog/z8036.h>
#include <string.h>
-#include <fcntl.h>
#ifdef STACK_CHECKER_ON
#include <stackchk.h>
@@ -111,35 +110,11 @@ bsp_pretasking_hook(void)
#endif
}
-
/*
- * After drivers are setup, register some "filenames"
- * and open stdin, stdout, stderr files
- *
- * Newlib will automatically associate the files with these
- * (it hardcodes the numbers)
+ * Use the shared bsp_postdriver_hook() implementation
*/
-void
-bsp_postdriver_hook(void)
-{
- int stdin_fd, stdout_fd, stderr_fd;
- int error_code;
-
- error_code = 'S' << 24 | 'T' << 16;
-
- if ((stdin_fd = __rtems_open("/dev/console", O_RDONLY, 0)) == -1)
- rtems_fatal_error_occurred( error_code | 'D' << 8 | '0' );
-
- if ((stdout_fd = __rtems_open("/dev/console", O_WRONLY, 0)) == -1)
- rtems_fatal_error_occurred( error_code | 'D' << 8 | '1' );
-
- if ((stderr_fd = __rtems_open("/dev/console", O_WRONLY, 0)) == -1)
- rtems_fatal_error_occurred( error_code | 'D' << 8 | '2' );
-
- if ((stdin_fd != 0) || (stdout_fd != 1) || (stderr_fd != 2))
- rtems_fatal_error_occurred( error_code | 'I' << 8 | 'O' );
-}
+void bsp_postdriver_hook(void);
void bsp_start( void )
{
diff --git a/c/src/lib/libbsp/m68k/mvme147/startup/Makefile.in b/c/src/lib/libbsp/m68k/mvme147/startup/Makefile.in
index 60cbb0ecc6..12fca968bc 100644
--- a/c/src/lib/libbsp/m68k/mvme147/startup/Makefile.in
+++ b/c/src/lib/libbsp/m68k/mvme147/startup/Makefile.in
@@ -11,7 +11,7 @@ PROJECT_ROOT = @PROJECT_ROOT@
PGM=${ARCH}/startup.rel
# C source names, if any, go here -- minus the .c
-C_PIECES=bspclean bspstart main sbrk setvec
+C_PIECES=bspclean bsppost bspstart main sbrk setvec
C_FILES=$(C_PIECES:%=%.c)
C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
diff --git a/c/src/lib/libbsp/m68k/mvme147/startup/bspstart.c b/c/src/lib/libbsp/m68k/mvme147/startup/bspstart.c
index 842bf0bbac..d86155db99 100644
--- a/c/src/lib/libbsp/m68k/mvme147/startup/bspstart.c
+++ b/c/src/lib/libbsp/m68k/mvme147/startup/bspstart.c
@@ -30,7 +30,6 @@
#include <libcsupport.h>
#include <string.h>
-#include <fcntl.h>
#ifdef STACK_CHECKER_ON
#include <stackchk.h>
@@ -116,33 +115,11 @@ bsp_pretasking_hook(void)
/*
- * After drivers are setup, register some "filenames"
- * and open stdin, stdout, stderr files
- *
- * Newlib will automatically associate the files with these
- * (it hardcodes the numbers)
+ * Use the shared bsp_postdriver_hook() implementation
*/
-void
-bsp_postdriver_hook(void)
-{
- int stdin_fd, stdout_fd, stderr_fd;
- int error_code;
-
- error_code = 'S' << 24 | 'T' << 16;
-
- if ((stdin_fd = __rtems_open("/dev/console", O_RDONLY, 0)) == -1)
- rtems_fatal_error_occurred( error_code | 'D' << 8 | '0' );
-
- if ((stdout_fd = __rtems_open("/dev/console", O_WRONLY, 0)) == -1)
- rtems_fatal_error_occurred( error_code | 'D' << 8 | '1' );
-
- if ((stderr_fd = __rtems_open("/dev/console", O_WRONLY, 0)) == -1)
- rtems_fatal_error_occurred( error_code | 'D' << 8 | '2' );
-
- if ((stdin_fd != 0) || (stdout_fd != 1) || (stderr_fd != 2))
- rtems_fatal_error_occurred( error_code | 'I' << 8 | 'O' );
-}
+void bsp_postdriver_hook(void);
+
void bsp_start( void )
{
diff --git a/c/src/lib/libbsp/m68k/mvme147s/startup/Makefile.in b/c/src/lib/libbsp/m68k/mvme147s/startup/Makefile.in
index 0ccf177a4c..f5cc3ccace 100644
--- a/c/src/lib/libbsp/m68k/mvme147s/startup/Makefile.in
+++ b/c/src/lib/libbsp/m68k/mvme147s/startup/Makefile.in
@@ -11,7 +11,7 @@ PROJECT_ROOT = @PROJECT_ROOT@
PGM=${ARCH}/startup.rel
# C source names, if any, go here -- minus the .c
-C_PIECES=bspclean bspstart main sbrk setvec
+C_PIECES=bspclean bsppost bspstart main sbrk setvec
C_FILES=$(C_PIECES:%=%.c)
C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
diff --git a/c/src/lib/libbsp/m68k/mvme147s/startup/bspstart.c b/c/src/lib/libbsp/m68k/mvme147s/startup/bspstart.c
index 67ef0c9c94..d50a63910a 100644
--- a/c/src/lib/libbsp/m68k/mvme147s/startup/bspstart.c
+++ b/c/src/lib/libbsp/m68k/mvme147s/startup/bspstart.c
@@ -30,7 +30,6 @@
#include <libcsupport.h>
#include <string.h>
-#include <fcntl.h>
#ifdef STACK_CHECKER_ON
#include <stackchk.h>
@@ -116,33 +115,11 @@ bsp_pretasking_hook(void)
/*
- * After drivers are setup, register some "filenames"
- * and open stdin, stdout, stderr files
- *
- * Newlib will automatically associate the files with these
- * (it hardcodes the numbers)
+ * Use the shared bsp_postdriver_hook() implementation
*/
-void
-bsp_postdriver_hook(void)
-{
- int stdin_fd, stdout_fd, stderr_fd;
- int error_code;
-
- error_code = 'S' << 24 | 'T' << 16;
-
- if ((stdin_fd = __rtems_open("/dev/console", O_RDONLY, 0)) == -1)
- rtems_fatal_error_occurred( error_code | 'D' << 8 | '0' );
-
- if ((stdout_fd = __rtems_open("/dev/console", O_WRONLY, 0)) == -1)
- rtems_fatal_error_occurred( error_code | 'D' << 8 | '1' );
-
- if ((stderr_fd = __rtems_open("/dev/console", O_WRONLY, 0)) == -1)
- rtems_fatal_error_occurred( error_code | 'D' << 8 | '2' );
-
- if ((stdin_fd != 0) || (stdout_fd != 1) || (stderr_fd != 2))
- rtems_fatal_error_occurred( error_code | 'I' << 8 | 'O' );
-}
+void bsp_postdriver_hook(void);
+
void bsp_start( void )
{
diff --git a/c/src/lib/libbsp/m68k/mvme162/startup/Makefile.in b/c/src/lib/libbsp/m68k/mvme162/startup/Makefile.in
index b1d452bf89..181b4e11b7 100644
--- a/c/src/lib/libbsp/m68k/mvme162/startup/Makefile.in
+++ b/c/src/lib/libbsp/m68k/mvme162/startup/Makefile.in
@@ -11,7 +11,7 @@ PROJECT_ROOT = @PROJECT_ROOT@
PGM=${ARCH}/startup.rel
# C source names, if any, go here -- minus the .c
-C_PIECES=bspclean bspstart main page_table sbrk setvec
+C_PIECES=bspclean bsppost bspstart main page_table sbrk setvec
C_FILES=$(C_PIECES:%=%.c)
C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
diff --git a/c/src/lib/libbsp/m68k/mvme162/startup/bspstart.c b/c/src/lib/libbsp/m68k/mvme162/startup/bspstart.c
index b9430c9f30..5ed4265c44 100644
--- a/c/src/lib/libbsp/m68k/mvme162/startup/bspstart.c
+++ b/c/src/lib/libbsp/m68k/mvme162/startup/bspstart.c
@@ -34,7 +34,6 @@
#include <libcsupport.h>
#include <string.h>
-#include <fcntl.h>
#ifdef STACK_CHECKER_ON
#include <stackchk.h>
@@ -120,33 +119,11 @@ bsp_pretasking_hook(void)
/*
- * After drivers are setup, register some "filenames"
- * and open stdin, stdout, stderr files
- *
- * Newlib will automatically associate the files with these
- * (it hardcodes the numbers)
+ * Use the shared bsp_postdriver_hook() implementation
*/
-void
-bsp_postdriver_hook(void)
-{
- int stdin_fd, stdout_fd, stderr_fd;
- int error_code;
-
- error_code = 'S' << 24 | 'T' << 16;
-
- if ((stdin_fd = __rtems_open("/dev/console", O_RDONLY, 0)) == -1)
- rtems_fatal_error_occurred( error_code | 'D' << 8 | '0' );
-
- if ((stdout_fd = __rtems_open("/dev/console", O_WRONLY, 0)) == -1)
- rtems_fatal_error_occurred( error_code | 'D' << 8 | '1' );
-
- if ((stderr_fd = __rtems_open("/dev/console", O_WRONLY, 0)) == -1)
- rtems_fatal_error_occurred( error_code | 'D' << 8 | '2' );
-
- if ((stdin_fd != 0) || (stdout_fd != 1) || (stderr_fd != 2))
- rtems_fatal_error_occurred( error_code | 'I' << 8 | 'O' );
-}
+void bsp_postdriver_hook(void);
+
void bsp_start( void )
{
diff --git a/c/src/lib/libbsp/m68k/ods68302/startup/Makefile.in b/c/src/lib/libbsp/m68k/ods68302/startup/Makefile.in
index 4e4b8bcc32..b93dbf526d 100644
--- a/c/src/lib/libbsp/m68k/ods68302/startup/Makefile.in
+++ b/c/src/lib/libbsp/m68k/ods68302/startup/Makefile.in
@@ -12,7 +12,7 @@ PGM=${ARCH}/startup.rel
# C source names, if any, go here -- minus the .c
C_PIECES=crc debugport gdb-hooks main m68302scc m68k-stub memcheck trace \
- bspstart bspclean sbrk setvec
+ bsppost bspstart bspclean sbrk setvec
C_FILES=$(C_PIECES:%=%.c)
C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
diff --git a/c/src/lib/libbsp/m68k/ods68302/startup/bspstart.c b/c/src/lib/libbsp/m68k/ods68302/startup/bspstart.c
index 09b8494e05..2448109128 100644
--- a/c/src/lib/libbsp/m68k/ods68302/startup/bspstart.c
+++ b/c/src/lib/libbsp/m68k/ods68302/startup/bspstart.c
@@ -26,7 +26,6 @@
#include <libcsupport.h>
#include <string.h>
-#include <fcntl.h>
#ifdef STACK_CHECKER_ON
#include <stackchk.h>
@@ -120,33 +119,10 @@ bsp_pretasking_hook(void)
/*
- * After drivers are setup, register some "filenames"
- * and open stdin, stdout, stderr files
- *
- * Newlib will automatically associate the files with these
- * (it hardcodes the numbers)
+ * Use the shared bsp_postdriver_hook() implementation
*/
-void
-bsp_postdriver_hook(void)
-{
- int stdin_fd, stdout_fd, stderr_fd;
- int error_code;
-
- error_code = 'S' << 24 | 'T' << 16;
-
- if ((stdin_fd = __rtems_open("/dev/console", O_RDONLY, 0)) == -1)
- rtems_fatal_error_occurred( error_code | 'D' << 8 | '0' );
-
- if ((stdout_fd = __rtems_open("/dev/console", O_WRONLY, 0)) == -1)
- rtems_fatal_error_occurred( error_code | 'D' << 8 | '1' );
-
- if ((stderr_fd = __rtems_open("/dev/console", O_WRONLY, 0)) == -1)
- rtems_fatal_error_occurred( error_code | 'D' << 8 | '2' );
-
- if ((stdin_fd != 0) || (stdout_fd != 1) || (stderr_fd != 2))
- rtems_fatal_error_occurred( error_code | 'I' << 8 | 'O' );
-}
+void bsp_postdriver_hook(void);
void bsp_start( void )
{