forked from Imagelibrary/rtems
Moved bsp_postdriver_hook() to a shared file and made it a common
component.
This commit is contained 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 iface
|
||||
C_PIECES=bspclean bsppost bspstart main sbrk setvec iface
|
||||
C_FILES=$(C_PIECES:%=%.c)
|
||||
C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
|
||||
|
||||
|
||||
@@ -26,7 +26,6 @@
|
||||
#include <libcsupport.h>
|
||||
|
||||
#include <string.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
#ifdef STACK_CHECKER_ON
|
||||
#include <stackchk.h>
|
||||
@@ -137,38 +136,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' );
|
||||
|
||||
printf("allocated %d heap size, %d work space size\n",
|
||||
heap_size, BSP_Configuration.work_space_size);
|
||||
printf(" work space start 0x%x\n",(unsigned int)BSP_Configuration.work_space_start);
|
||||
}
|
||||
|
||||
void bsp_postdriver_hook(void);
|
||||
|
||||
int bsp_start(
|
||||
int argc,
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -29,7 +29,6 @@
|
||||
#include <libcsupport.h>
|
||||
|
||||
#include <string.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
#ifdef STACK_CHECKER_ON
|
||||
#include <stackchk.h>
|
||||
@@ -229,33 +228,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);
|
||||
|
||||
/*
|
||||
* Function: bsp_start
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -25,8 +25,6 @@
|
||||
|
||||
#include <libcsupport.h>
|
||||
|
||||
#include <fcntl.h>
|
||||
|
||||
#ifdef STACK_CHECKER_ON
|
||||
#include <stackchk.h>
|
||||
#endif
|
||||
@@ -111,33 +109,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 )
|
||||
{
|
||||
|
||||
@@ -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 sbrk setvec
|
||||
C_PIECES=bsppost bspstart sbrk setvec
|
||||
C_FILES=$(C_PIECES:%=%.c)
|
||||
C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
|
||||
|
||||
|
||||
@@ -27,7 +27,6 @@
|
||||
#include <zilog/z8036.h>
|
||||
|
||||
#include <string.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
#ifdef STACK_CHECKER_ON
|
||||
#include <stackchk.h>
|
||||
@@ -118,33 +117,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);
|
||||
|
||||
/* This is the original command line passed from DOS */
|
||||
char ** Go32_Argv;
|
||||
|
||||
@@ -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 exit irq main sbrk
|
||||
C_PIECES=bspclean bsppost bspstart exit irq main sbrk
|
||||
C_FILES=$(C_PIECES:%=%.c)
|
||||
C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
|
||||
|
||||
|
||||
@@ -34,8 +34,6 @@
|
||||
+--------------------------------------------------------------------------*/
|
||||
|
||||
|
||||
#include <fcntl.h>
|
||||
|
||||
#include <bsp.h>
|
||||
#include <libcsupport.h>
|
||||
#include <rtems/libio.h>
|
||||
@@ -136,38 +134,11 @@ bsp_pretasking_hook(void)
|
||||
} /* bsp_pretasking_hook */
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------+
|
||||
| Function: bsp_postdriver_hook
|
||||
| Description: 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).
|
||||
| Global Variables: None.
|
||||
| Arguments: None.
|
||||
| Returns: Nothing.
|
||||
+--------------------------------------------------------------------------*/
|
||||
void
|
||||
bsp_postdriver_hook(void)
|
||||
{
|
||||
int stdin_fd, stdout_fd, stderr_fd;
|
||||
/*
|
||||
* Use the shared bsp_postdriver_hook() implementation
|
||||
*/
|
||||
|
||||
rtems_status_code error_code;
|
||||
|
||||
error_code = 'S' << 24 | 'T' << 16;
|
||||
|
||||
/* open standard devices: stdout, stderr and stdin */
|
||||
|
||||
if ((stdin_fd = __rtems_open("/dev/console", O_RDONLY, 0)) < 0)
|
||||
rtems_fatal_error_occurred( error_code | 'D' << 8 | '0' );
|
||||
|
||||
if ((stdout_fd = __rtems_open("/dev/console", O_WRONLY, 0)) < 0)
|
||||
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' );
|
||||
} /* bsp_postdriver_hook */
|
||||
void bsp_postdriver_hook(void);
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------+
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -26,7 +26,6 @@
|
||||
#include <libcsupport.h>
|
||||
|
||||
#include <string.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
#ifdef STACK_CHECKER_ON
|
||||
#include <stackchk.h>
|
||||
@@ -113,33 +112,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 )
|
||||
{
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -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 )
|
||||
{
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
#include <libcsupport.h>
|
||||
|
||||
#include <string.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
#ifdef STACK_CHECKER_ON
|
||||
#include <stackchk.h>
|
||||
@@ -119,33 +118,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 )
|
||||
{
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -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;
|
||||
void bsp_postdriver_hook(void);
|
||||
|
||||
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_start( void )
|
||||
{
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -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;
|
||||
void bsp_postdriver_hook(void);
|
||||
|
||||
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_start( void )
|
||||
{
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -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 )
|
||||
{
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -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 )
|
||||
{
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -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 )
|
||||
{
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -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;
|
||||
void bsp_postdriver_hook(void);
|
||||
|
||||
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_start( void )
|
||||
{
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -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;
|
||||
void bsp_postdriver_hook(void);
|
||||
|
||||
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_start( void )
|
||||
{
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -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;
|
||||
void bsp_postdriver_hook(void);
|
||||
|
||||
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_start( void )
|
||||
{
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -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 )
|
||||
{
|
||||
|
||||
@@ -34,7 +34,6 @@
|
||||
#include <libcsupport.h>
|
||||
|
||||
#include <string.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
#ifdef STACK_CHECKER_ON
|
||||
#include <stackchk.h>
|
||||
@@ -128,36 +127,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);
|
||||
|
||||
extern int end; /* defined by linker */
|
||||
|
||||
|
||||
@@ -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 inittlb
|
||||
C_PIECES=bspclean bsppost bspstart main sbrk setvec inittlb
|
||||
C_FILES=$(C_PIECES:%=%.c)
|
||||
C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
|
||||
|
||||
|
||||
@@ -34,7 +34,6 @@
|
||||
#include <libcsupport.h>
|
||||
|
||||
#include <string.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
#ifdef STACK_CHECKER_ON
|
||||
#include <stackchk.h>
|
||||
@@ -128,36 +127,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);
|
||||
|
||||
extern int end; /* defined by linker */
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
int bsp_start(
|
||||
int argc,
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -43,7 +43,6 @@
|
||||
#include <libcsupport.h>
|
||||
|
||||
#include <string.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
#ifdef STACK_CHECKER_ON
|
||||
#include <stackchk.h>
|
||||
@@ -138,33 +137,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;
|
||||
void bsp_postdriver_hook(void);
|
||||
|
||||
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_start( void )
|
||||
{
|
||||
|
||||
@@ -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 sbrk setvec main
|
||||
C_PIECES=bsppost bspstart bspclean sbrk setvec main
|
||||
C_FILES=$(C_PIECES:%=%.c)
|
||||
C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
|
||||
|
||||
|
||||
@@ -36,7 +36,6 @@
|
||||
#include <libcsupport.h>
|
||||
|
||||
#include <string.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
#ifdef STACK_CHECKER_ON
|
||||
#include <stackchk.h>
|
||||
@@ -121,35 +120,12 @@ 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;
|
||||
void bsp_postdriver_hook(void);
|
||||
|
||||
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_start(void)
|
||||
{
|
||||
|
||||
37
c/src/lib/libbsp/shared/bsppost.c
Normal file
37
c/src/lib/libbsp/shared/bsppost.c
Normal file
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
* This is a basic BSP post driver hook.
|
||||
*
|
||||
* 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)
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#include <rtems.h>
|
||||
#include <rtems/libio.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
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' );
|
||||
}
|
||||
|
||||
@@ -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 spurious
|
||||
C_PIECES=bspclean bsppost bspstart main sbrk setvec spurious
|
||||
C_FILES=$(C_PIECES:%=%.c)
|
||||
C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
|
||||
|
||||
|
||||
@@ -31,7 +31,6 @@
|
||||
#include <libcsupport.h>
|
||||
|
||||
#include <string.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
#ifdef STACK_CHECKER_ON
|
||||
#include <stackchk.h>
|
||||
@@ -204,35 +203,11 @@ void bsp_pretasking_hook(void)
|
||||
}
|
||||
|
||||
/*
|
||||
* bsp_postdriver_hook
|
||||
*
|
||||
* 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;
|
||||
void bsp_postdriver_hook(void);
|
||||
|
||||
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' );
|
||||
}
|
||||
|
||||
/*
|
||||
* bsp_start
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
/* for sbrk prototype in linux */
|
||||
#if defined(__linux__)
|
||||
@@ -176,34 +175,13 @@ 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)
|
||||
* DO NOT Use the shared bsp_postdriver_hook() implementation
|
||||
*/
|
||||
|
||||
void
|
||||
bsp_postdriver_hook(void)
|
||||
{
|
||||
#if 0
|
||||
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' );
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user