diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 1995-10-30 21:54:45 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 1995-10-30 21:54:45 +0000 |
commit | 97005786d89fd7a57b5fe82f713cea739916f3da (patch) | |
tree | cfff15a6bc93114480ecd20f6afddde3dcd74470 /c/src/lib/libbsp | |
parent | reordered test cases from simple to complex (diff) | |
download | rtems-97005786d89fd7a57b5fe82f713cea739916f3da.tar.bz2 |
SPARC port passes all tests
Diffstat (limited to 'c/src/lib/libbsp')
29 files changed, 168 insertions, 249 deletions
diff --git a/c/src/lib/libbsp/hppa1.1/simhppa/startup/bspstart.c b/c/src/lib/libbsp/hppa1.1/simhppa/startup/bspstart.c index 0c19667b1f..bfdb429ef8 100644 --- a/c/src/lib/libbsp/hppa1.1/simhppa/startup/bspstart.c +++ b/c/src/lib/libbsp/hppa1.1/simhppa/startup/bspstart.c @@ -29,7 +29,7 @@ #include <rtems.h> #include <bsp.h> #include <rtems/libio.h> -#include <rtems/score/intthrd.h> +#include <rtems/intthrd.h> #include <libcsupport.h> @@ -243,19 +243,22 @@ bsp_pretasking_hook(void) void bsp_postdriver_hook(void) { - int stdin_fd, stdout_fd, stderr_fd; - - if ((stdin_fd = __open("/dev/tty00", O_RDONLY, 0)) == -1) - rtems_fatal_error_occurred('STD0'); - - if ((stdout_fd = __open("/dev/tty00", O_WRONLY, 0)) == -1) - rtems_fatal_error_occurred('STD1'); - - if ((stderr_fd = __open("/dev/tty00", O_WRONLY, 0)) == -1) - rtems_fatal_error_occurred('STD2'); - - if ((stdin_fd != 0) || (stdout_fd != 1) || (stderr_fd != 2)) - rtems_fatal_error_occurred('STIO'); + int stdin_fd, stdout_fd, stderr_fd; + int error_code; + + error_code = 'S' << 24 | 'T' << 16; + + if ((stdin_fd = __open("/dev/console", O_RDONLY, 0)) == -1) + rtems_fatal_error_occurred( error_code | 'D' << 8 | '0' ); + + if ((stdout_fd = __open("/dev/console", O_WRONLY, 0)) == -1) + rtems_fatal_error_occurred( error_code | 'D' << 8 | '1' ); + + if ((stderr_fd = __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' ); } /* diff --git a/c/src/lib/libbsp/i386/force386/clock/ckinit.c b/c/src/lib/libbsp/i386/force386/clock/ckinit.c index 45a64f6f14..9bfad8991a 100644 --- a/c/src/lib/libbsp/i386/force386/clock/ckinit.c +++ b/c/src/lib/libbsp/i386/force386/clock/ckinit.c @@ -75,17 +75,6 @@ void Install_clock( atexit( Clock_exit ); } -void ReInstall_clock( - rtems_isr_entry clock_isr -) -{ - rtems_unsigned32 isrlevel = 0; - - rtems_interrupt_disable( isrlevel ); - (void) set_vector( clock_isr, CLOCK_VECTOR, 1 ); - rtems_interrupt_enable( isrlevel ); -} - void Clock_exit( void ) { if ( BSP_Configuration.ticks_per_timeslice ) { @@ -119,6 +108,7 @@ rtems_device_driver Clock_control( void *pargp ) { + rtems_unsigned32 isrlevel; rtems_libio_ioctl_args_t *args = pargp; if (args == 0) @@ -135,7 +125,9 @@ rtems_device_driver Clock_control( } else if (args->command == rtems_build_name('N', 'E', 'W', ' ')) { - ReInstall_clock(args->buffer); + rtems_interrupt_disable( isrlevel ); + (void) set_vector( args->buffer, CLOCK_VECTOR, 1 ); + rtems_interrupt_enable( isrlevel ); } done: diff --git a/c/src/lib/libbsp/i386/force386/startup/bspstart.c b/c/src/lib/libbsp/i386/force386/startup/bspstart.c index 1433e5e02a..3f001fb109 100644 --- a/c/src/lib/libbsp/i386/force386/startup/bspstart.c +++ b/c/src/lib/libbsp/i386/force386/startup/bspstart.c @@ -122,18 +122,21 @@ void bsp_postdriver_hook(void) { int stdin_fd, stdout_fd, stderr_fd; + int error_code; + + error_code = 'S' << 24 | 'T' << 16; if ((stdin_fd = __open("/dev/console", O_RDONLY, 0)) == -1) - rtems_fatal_error_occurred('STD0'); + rtems_fatal_error_occurred( error_code | 'D' << 8 | '0' ); if ((stdout_fd = __open("/dev/console", O_WRONLY, 0)) == -1) - rtems_fatal_error_occurred('STD1'); + rtems_fatal_error_occurred( error_code | 'D' << 8 | '1' ); if ((stderr_fd = __open("/dev/console", O_WRONLY, 0)) == -1) - rtems_fatal_error_occurred('STD2'); + rtems_fatal_error_occurred( error_code | 'D' << 8 | '2' ); if ((stdin_fd != 0) || (stdout_fd != 1) || (stderr_fd != 2)) - rtems_fatal_error_occurred('STIO'); + rtems_fatal_error_occurred( error_code | 'I' << 8 | 'O' ); } int main( diff --git a/c/src/lib/libbsp/i386/go32/clock/ckinit.c b/c/src/lib/libbsp/i386/go32/clock/ckinit.c index fa6a8bf057..70c564fabc 100644 --- a/c/src/lib/libbsp/i386/go32/clock/ckinit.c +++ b/c/src/lib/libbsp/i386/go32/clock/ckinit.c @@ -108,17 +108,6 @@ void Install_clock( atexit( Clock_exit ); } -void ReInstall_clock( - rtems_isr_entry clock_isr -) -{ - rtems_unsigned32 isrlevel = 0; - - rtems_interrupt_disable( isrlevel ); - (void) set_vector( clock_isr, CLOCK_VECTOR, 1 ); - rtems_interrupt_enable( isrlevel ); -} - void Clock_exit( void ) { if ( BSP_Configuration.ticks_per_timeslice ) { @@ -161,6 +150,7 @@ rtems_device_driver Clock_control( void *pargp ) { + rtems_unsigned32 isrlevel; rtems_libio_ioctl_args_t *args = pargp; if (args == 0) @@ -177,7 +167,9 @@ rtems_device_driver Clock_control( } else if (args->command == rtems_build_name('N', 'E', 'W', ' ')) { - ReInstall_clock(args->buffer); + rtems_interrupt_disable( isrlevel ); + (void) set_vector( args->buffer, CLOCK_VECTOR, 1 ); + rtems_interrupt_enable( isrlevel ); } done: diff --git a/c/src/lib/libbsp/i386/go32/startup/bspstart.c b/c/src/lib/libbsp/i386/go32/startup/bspstart.c index 17a10b4193..602b7bdfd6 100644 --- a/c/src/lib/libbsp/i386/go32/startup/bspstart.c +++ b/c/src/lib/libbsp/i386/go32/startup/bspstart.c @@ -129,18 +129,21 @@ void bsp_postdriver_hook(void) { int stdin_fd, stdout_fd, stderr_fd; + int error_code; + + error_code = 'S' << 24 | 'T' << 16; if ((stdin_fd = __open("/dev/console", O_RDONLY, 0)) == -1) - rtems_fatal_error_occurred('STD0'); + rtems_fatal_error_occurred( error_code | 'D' << 8 | '0' ); if ((stdout_fd = __open("/dev/console", O_WRONLY, 0)) == -1) - rtems_fatal_error_occurred('STD1'); + rtems_fatal_error_occurred( error_code | 'D' << 8 | '1' ); if ((stderr_fd = __open("/dev/console", O_WRONLY, 0)) == -1) - rtems_fatal_error_occurred('STD2'); + rtems_fatal_error_occurred( error_code | 'D' << 8 | '2' ); if ((stdin_fd != 0) || (stdout_fd != 1) || (stderr_fd != 2)) - rtems_fatal_error_occurred('STIO'); + rtems_fatal_error_occurred( error_code | 'I' << 8 | 'O' ); } /* This is the original command line passed from DOS */ diff --git a/c/src/lib/libbsp/i960/cvme961/clock/ckinit.c b/c/src/lib/libbsp/i960/cvme961/clock/ckinit.c index b479ad137c..3f2ba718bc 100644 --- a/c/src/lib/libbsp/i960/cvme961/clock/ckinit.c +++ b/c/src/lib/libbsp/i960/cvme961/clock/ckinit.c @@ -60,13 +60,6 @@ void Install_clock( } } -void ReInstall_clock( - rtems_isr_entry clock_isr -) -{ - (void) set_vector( clock_isr, CLOCK_VECTOR, 1 ); -} - void Clock_exit() { unsigned char *victimer; @@ -105,6 +98,7 @@ rtems_device_driver Clock_control( void *pargp ) { + rtems_unsigned32 isrlevel; rtems_libio_ioctl_args_t *args = pargp; if (args == 0) @@ -121,7 +115,9 @@ rtems_device_driver Clock_control( } else if (args->command == rtems_build_name('N', 'E', 'W', ' ')) { - ReInstall_clock(args->buffer); + rtems_interrupt_disable( isrlevel ); + (void) set_vector( args->buffer, CLOCK_VECTOR, 1 ); + rtems_interrupt_enable( isrlevel ); } done: diff --git a/c/src/lib/libbsp/i960/cvme961/startup/bspstart.c b/c/src/lib/libbsp/i960/cvme961/startup/bspstart.c index ec4f8b601d..1c9c29f29e 100644 --- a/c/src/lib/libbsp/i960/cvme961/startup/bspstart.c +++ b/c/src/lib/libbsp/i960/cvme961/startup/bspstart.c @@ -124,18 +124,21 @@ void bsp_postdriver_hook(void) { int stdin_fd, stdout_fd, stderr_fd; + int error_code; + + error_code = 'S' << 24 | 'T' << 16; if ((stdin_fd = __open("/dev/console", O_RDONLY, 0)) == -1) - rtems_fatal_error_occurred('STD0'); + rtems_fatal_error_occurred( error_code | 'D' << 8 | '0' ); if ((stdout_fd = __open("/dev/console", O_WRONLY, 0)) == -1) - rtems_fatal_error_occurred('STD1'); + rtems_fatal_error_occurred( error_code | 'D' << 8 | '1' ); if ((stderr_fd = __open("/dev/console", O_WRONLY, 0)) == -1) - rtems_fatal_error_occurred('STD2'); + rtems_fatal_error_occurred( error_code | 'D' << 8 | '2' ); if ((stdin_fd != 0) || (stdout_fd != 1) || (stderr_fd != 2)) - rtems_fatal_error_occurred('STIO'); + rtems_fatal_error_occurred( error_code | 'I' << 8 | 'O' ); } int main( diff --git a/c/src/lib/libbsp/m68k/dmv152/clock/ckinit.c b/c/src/lib/libbsp/m68k/dmv152/clock/ckinit.c index 8715cdcc26..128bed84d7 100644 --- a/c/src/lib/libbsp/m68k/dmv152/clock/ckinit.c +++ b/c/src/lib/libbsp/m68k/dmv152/clock/ckinit.c @@ -97,17 +97,6 @@ void Install_clock( } } -void ReInstall_clock( - rtems_isr_entry clock_isr -) -{ - rtems_unsigned32 isrlevel = 0 ; - - rtems_interrupt_disable( isrlevel ); - (void) set_vector( clock_isr, CLOCK_VECTOR, 1 ); - rtems_interrupt_enable( isrlevel ); -} - void Clock_exit( void ) { rtems_unsigned8 data; @@ -145,6 +134,7 @@ rtems_device_driver Clock_control( void *pargp ) { + rtems_unsigned32 isrlevel; rtems_libio_ioctl_args_t *args = pargp; if (args == 0) @@ -161,7 +151,9 @@ rtems_device_driver Clock_control( } else if (args->command == rtems_build_name('N', 'E', 'W', ' ')) { - ReInstall_clock(args->buffer); + rtems_interrupt_disable( isrlevel ); + (void) set_vector( args->buffer, CLOCK_VECTOR, 1 ); + rtems_interrupt_enable( isrlevel ); } done: diff --git a/c/src/lib/libbsp/m68k/dmv152/startup/bspstart.c b/c/src/lib/libbsp/m68k/dmv152/startup/bspstart.c index 44ad6b6f7e..0f0ecbf00d 100644 --- a/c/src/lib/libbsp/m68k/dmv152/startup/bspstart.c +++ b/c/src/lib/libbsp/m68k/dmv152/startup/bspstart.c @@ -123,18 +123,21 @@ void bsp_postdriver_hook(void) { int stdin_fd, stdout_fd, stderr_fd; + int error_code; + + error_code = 'S' << 24 | 'T' << 16; if ((stdin_fd = __open("/dev/console", O_RDONLY, 0)) == -1) - rtems_fatal_error_occurred('STD0'); + rtems_fatal_error_occurred( error_code | 'D' << 8 | '0' ); if ((stdout_fd = __open("/dev/console", O_WRONLY, 0)) == -1) - rtems_fatal_error_occurred('STD1'); + rtems_fatal_error_occurred( error_code | 'D' << 8 | '1' ); if ((stderr_fd = __open("/dev/console", O_WRONLY, 0)) == -1) - rtems_fatal_error_occurred('STD2'); + rtems_fatal_error_occurred( error_code | 'D' << 8 | '2' ); if ((stdin_fd != 0) || (stdout_fd != 1) || (stderr_fd != 2)) - rtems_fatal_error_occurred('STIO'); + rtems_fatal_error_occurred( error_code | 'I' << 8 | 'O' ); } int main( diff --git a/c/src/lib/libbsp/m68k/efi332/clock/ckinit.c b/c/src/lib/libbsp/m68k/efi332/clock/ckinit.c index 2bfa34d32d..8b46fc283d 100644 --- a/c/src/lib/libbsp/m68k/efi332/clock/ckinit.c +++ b/c/src/lib/libbsp/m68k/efi332/clock/ckinit.c @@ -70,17 +70,6 @@ void Install_clock( } } -void ReInstall_clock( - rtems_isr_entry clock_isr -) -{ - rtems_unsigned32 isrlevel = 0 ; - - rtems_interrupt_disable( isrlevel ); - (void) set_vector( clock_isr, CLOCK_VECTOR, 1 ); - rtems_interrupt_enable( isrlevel ); -} - void Clock_exit( void ) { @@ -120,6 +109,7 @@ rtems_device_driver Clock_control( void *pargp ) { + rtems_unsigned32 isrlevel; rtems_libio_ioctl_args_t *args = pargp; if (args == 0) @@ -136,7 +126,9 @@ rtems_device_driver Clock_control( } else if (args->command == rtems_build_name('N', 'E', 'W', ' ')) { - ReInstall_clock(args->buffer); + rtems_interrupt_disable( isrlevel ); + (void) set_vector( args->buffer, CLOCK_VECTOR, 1 ); + rtems_interrupt_enable( isrlevel ); } done: diff --git a/c/src/lib/libbsp/m68k/efi332/startup/bspstart.c b/c/src/lib/libbsp/m68k/efi332/startup/bspstart.c index 6a7830bcfe..7a291ef02e 100644 --- a/c/src/lib/libbsp/m68k/efi332/startup/bspstart.c +++ b/c/src/lib/libbsp/m68k/efi332/startup/bspstart.c @@ -123,18 +123,21 @@ void bsp_postdriver_hook(void) { int stdin_fd, stdout_fd, stderr_fd; + int error_code; + + error_code = 'S' << 24 | 'T' << 16; if ((stdin_fd = __open("/dev/console", O_RDONLY, 0)) == -1) - rtems_fatal_error_occurred('STD0'); + rtems_fatal_error_occurred( error_code | 'D' << 8 | '0' ); if ((stdout_fd = __open("/dev/console", O_WRONLY, 0)) == -1) - rtems_fatal_error_occurred('STD1'); + rtems_fatal_error_occurred( error_code | 'D' << 8 | '1' ); if ((stderr_fd = __open("/dev/console", O_WRONLY, 0)) == -1) - rtems_fatal_error_occurred('STD2'); + rtems_fatal_error_occurred( error_code | 'D' << 8 | '2' ); if ((stdin_fd != 0) || (stdout_fd != 1) || (stderr_fd != 2)) - rtems_fatal_error_occurred('STIO'); + rtems_fatal_error_occurred( error_code | 'I' << 8 | 'O' ); } int main( diff --git a/c/src/lib/libbsp/m68k/efi68k/clock/ckinit.c b/c/src/lib/libbsp/m68k/efi68k/clock/ckinit.c index c90eba1e22..9c698cd0ba 100644 --- a/c/src/lib/libbsp/m68k/efi68k/clock/ckinit.c +++ b/c/src/lib/libbsp/m68k/efi68k/clock/ckinit.c @@ -93,17 +93,6 @@ void Install_clock( } } -void ReInstall_clock( - rtems_isr_entry clock_isr -) -{ - rtems_unsigned32 isrlevel = 0 ; - - rtems_interrupt_disable( isrlevel ); - (void) set_vector( clock_isr, CLOCK_VECTOR, 1 ); - rtems_interrupt_enable( isrlevel ); -} - void Clock_exit( void ) { @@ -141,6 +130,7 @@ rtems_device_driver Clock_control( void *pargp ) { + rtems_unsigned32 isrlevel; rtems_libio_ioctl_args_t *args = pargp; if (args == 0) @@ -157,7 +147,9 @@ rtems_device_driver Clock_control( } else if (args->command == rtems_build_name('N', 'E', 'W', ' ')) { - ReInstall_clock(args->buffer); + rtems_interrupt_disable( isrlevel ); + (void) set_vector( args->buffer, CLOCK_VECTOR, 1 ); + rtems_interrupt_enable( isrlevel ); } done: diff --git a/c/src/lib/libbsp/m68k/efi68k/startup/bspstart.c b/c/src/lib/libbsp/m68k/efi68k/startup/bspstart.c index e08f78baff..366a6502e7 100644 --- a/c/src/lib/libbsp/m68k/efi68k/startup/bspstart.c +++ b/c/src/lib/libbsp/m68k/efi68k/startup/bspstart.c @@ -130,18 +130,21 @@ void bsp_postdriver_hook(void) { int stdin_fd, stdout_fd, stderr_fd; + int error_code; + + error_code = 'S' << 24 | 'T' << 16; if ((stdin_fd = __open("/dev/console", O_RDONLY, 0)) == -1) - rtems_fatal_error_occurred('STD0'); + rtems_fatal_error_occurred( error_code | 'D' << 8 | '0' ); if ((stdout_fd = __open("/dev/console", O_WRONLY, 0)) == -1) - rtems_fatal_error_occurred('STD1'); + rtems_fatal_error_occurred( error_code | 'D' << 8 | '1' ); if ((stderr_fd = __open("/dev/console", O_WRONLY, 0)) == -1) - rtems_fatal_error_occurred('STD2'); + rtems_fatal_error_occurred( error_code | 'D' << 8 | '2' ); if ((stdin_fd != 0) || (stdout_fd != 1) || (stderr_fd != 2)) - rtems_fatal_error_occurred('STIO'); + rtems_fatal_error_occurred( error_code | 'I' << 8 | 'O' ); } int main( diff --git a/c/src/lib/libbsp/m68k/gen68302/clock/ckinit.c b/c/src/lib/libbsp/m68k/gen68302/clock/ckinit.c index f842bbc83c..386fc026a7 100644 --- a/c/src/lib/libbsp/m68k/gen68302/clock/ckinit.c +++ b/c/src/lib/libbsp/m68k/gen68302/clock/ckinit.c @@ -89,7 +89,7 @@ void Install_clock( Clock_isrs = BSP_Configuration.microseconds_per_tick / 1000; if ( BSP_Configuration.ticks_per_timeslice ) { -/* set_vector( clock_isr, CLOCK_VECTOR, 1 );*/ + set_vector( clock_isr, CLOCK_VECTOR, 1 ); m302.reg.trr1 = TRR1_VAL; /* set timer reference register */ m302.reg.tmr1 = TMR1_VAL; /* set timer mode register & enable */ @@ -102,17 +102,6 @@ void Install_clock( } } -void ReInstall_clock( - rtems_isr_entry clock_isr -) -{ - rtems_unsigned32 isrlevel; - - rtems_interrupt_disable( isrlevel ); - /* (void) set_vector( clock_isr, CLOCK_VECTOR, 1 ); */ - rtems_interrupt_enable( isrlevel ); -} - void Clock_exit( void ) { if ( BSP_Configuration.ticks_per_timeslice ) { @@ -145,6 +134,7 @@ rtems_device_driver Clock_control( void *pargp ) { + rtems_unsigned32 isrlevel; rtems_libio_ioctl_args_t *args = pargp; if (args == 0) @@ -161,7 +151,9 @@ rtems_device_driver Clock_control( } else if (args->command == rtems_build_name('N', 'E', 'W', ' ')) { - ReInstall_clock(args->buffer); + rtems_interrupt_disable( isrlevel ); + (void) set_vector( args->buffer, CLOCK_VECTOR, 1 ); + rtems_interrupt_enable( isrlevel ); } done: diff --git a/c/src/lib/libbsp/m68k/gen68302/start/start302.s b/c/src/lib/libbsp/m68k/gen68302/start/start302.s index d92ed1ce6b..311cd3fa39 100644 --- a/c/src/lib/libbsp/m68k/gen68302/start/start302.s +++ b/c/src/lib/libbsp/m68k/gen68302/start/start302.s @@ -193,7 +193,6 @@ cpy_Bad1: move.l d1,(a0)+ | move.l #_cnsl_isr,vbase+0x028 | SCC2 move.l #timerisr,vbase+0x018 | Timer ISR - move.l #RTC_ISR,vbase+0x024 | Real Time Clock ISR | | zero out uninitialized data area @@ -236,14 +235,6 @@ loop: movel d0,a1@+ | to zero out uninitialized Bad: bra Bad nop -RTC_ISR: - movem.l d0-d1/a0-a1,a7@- | save d0-d1,a0-a1 - addql #1,_ISR_Nest_level | one nest level deeper - addql #1,_Thread_Dispatch_disable_level - | disable multitasking - - jbsr Clock_isr | invoke the user ISR - jmp _ISR_Exit END_CODE diff --git a/c/src/lib/libbsp/m68k/gen68302/start302/start302.s b/c/src/lib/libbsp/m68k/gen68302/start302/start302.s index d92ed1ce6b..311cd3fa39 100644 --- a/c/src/lib/libbsp/m68k/gen68302/start302/start302.s +++ b/c/src/lib/libbsp/m68k/gen68302/start302/start302.s @@ -193,7 +193,6 @@ cpy_Bad1: move.l d1,(a0)+ | move.l #_cnsl_isr,vbase+0x028 | SCC2 move.l #timerisr,vbase+0x018 | Timer ISR - move.l #RTC_ISR,vbase+0x024 | Real Time Clock ISR | | zero out uninitialized data area @@ -236,14 +235,6 @@ loop: movel d0,a1@+ | to zero out uninitialized Bad: bra Bad nop -RTC_ISR: - movem.l d0-d1/a0-a1,a7@- | save d0-d1,a0-a1 - addql #1,_ISR_Nest_level | one nest level deeper - addql #1,_Thread_Dispatch_disable_level - | disable multitasking - - jbsr Clock_isr | invoke the user ISR - jmp _ISR_Exit END_CODE diff --git a/c/src/lib/libbsp/m68k/gen68302/startup/bspstart.c b/c/src/lib/libbsp/m68k/gen68302/startup/bspstart.c index 94973ea4cc..af512c0d8e 100644 --- a/c/src/lib/libbsp/m68k/gen68302/startup/bspstart.c +++ b/c/src/lib/libbsp/m68k/gen68302/startup/bspstart.c @@ -130,18 +130,21 @@ void bsp_postdriver_hook(void) { int stdin_fd, stdout_fd, stderr_fd; + int error_code; + + error_code = 'S' << 24 | 'T' << 16; if ((stdin_fd = __open("/dev/console", O_RDONLY, 0)) == -1) - rtems_fatal_error_occurred('STD0'); + rtems_fatal_error_occurred( error_code | 'D' << 8 | '0' ); if ((stdout_fd = __open("/dev/console", O_WRONLY, 0)) == -1) - rtems_fatal_error_occurred('STD1'); + rtems_fatal_error_occurred( error_code | 'D' << 8 | '1' ); if ((stderr_fd = __open("/dev/console", O_WRONLY, 0)) == -1) - rtems_fatal_error_occurred('STD2'); + rtems_fatal_error_occurred( error_code | 'D' << 8 | '2' ); if ((stdin_fd != 0) || (stdout_fd != 1) || (stderr_fd != 2)) - rtems_fatal_error_occurred('STIO'); + rtems_fatal_error_occurred( error_code | 'I' << 8 | 'O' ); } int main( diff --git a/c/src/lib/libbsp/m68k/idp/clock/ckinit.c b/c/src/lib/libbsp/m68k/idp/clock/ckinit.c index 7966fc61d1..6d93523563 100644 --- a/c/src/lib/libbsp/m68k/idp/clock/ckinit.c +++ b/c/src/lib/libbsp/m68k/idp/clock/ckinit.c @@ -130,16 +130,6 @@ rtems_isr_entry clock_isr; } } -void ReInstall_clock( clock_isr ) -rtems_isr_entry clock_isr; -{ - rtems_unsigned32 isrlevel = 0 ; - - rtems_interrupt_disable( isrlevel ); - (void) set_vector( clock_isr, CLOCK_VECTOR, 1 ); - rtems_interrupt_enable( isrlevel ); -} - /* The following was added for debugging purposes */ void Clock_exit( void ) { @@ -181,6 +171,7 @@ rtems_device_driver Clock_control( void *pargp ) { + rtems_unsigned32 isrlevel; rtems_libio_ioctl_args_t *args = pargp; if (args == 0) @@ -197,7 +188,9 @@ rtems_device_driver Clock_control( } else if (args->command == rtems_build_name('N', 'E', 'W', ' ')) { - ReInstall_clock(args->buffer); + rtems_interrupt_disable( isrlevel ); + (void) set_vector( args->buffer, CLOCK_VECTOR, 1 ); + rtems_interrupt_enable( isrlevel ); } done: diff --git a/c/src/lib/libbsp/m68k/idp/console/duart.c b/c/src/lib/libbsp/m68k/idp/console/duart.c index fe4b657b37..2d82590a49 100644 --- a/c/src/lib/libbsp/m68k/idp/console/duart.c +++ b/c/src/lib/libbsp/m68k/idp/console/duart.c @@ -1,6 +1,6 @@ -# -# $Id$ -# +/* + * $Id$ + */ /*######################################################### # diff --git a/c/src/lib/libbsp/m68k/idp/startup/bspstart.c b/c/src/lib/libbsp/m68k/idp/startup/bspstart.c index b4f4928f7d..9c79960580 100644 --- a/c/src/lib/libbsp/m68k/idp/startup/bspstart.c +++ b/c/src/lib/libbsp/m68k/idp/startup/bspstart.c @@ -131,18 +131,21 @@ void bsp_postdriver_hook(void) { int stdin_fd, stdout_fd, stderr_fd; + int error_code; + + error_code = 'S' << 24 | 'T' << 16; if ((stdin_fd = __open("/dev/console", O_RDONLY, 0)) == -1) - rtems_fatal_error_occurred('STD0'); + rtems_fatal_error_occurred( error_code | 'D' << 8 | '0' ); if ((stdout_fd = __open("/dev/console", O_WRONLY, 0)) == -1) - rtems_fatal_error_occurred('STD1'); + rtems_fatal_error_occurred( error_code | 'D' << 8 | '1' ); if ((stderr_fd = __open("/dev/console", O_WRONLY, 0)) == -1) - rtems_fatal_error_occurred('STD2'); + rtems_fatal_error_occurred( error_code | 'D' << 8 | '2' ); if ((stdin_fd != 0) || (stdout_fd != 1) || (stderr_fd != 2)) - rtems_fatal_error_occurred('STIO'); + rtems_fatal_error_occurred( error_code | 'I' << 8 | 'O' ); } int main( diff --git a/c/src/lib/libbsp/m68k/mvme136/clock/ckinit.c b/c/src/lib/libbsp/m68k/mvme136/clock/ckinit.c index 61069a8627..0ba674aee9 100644 --- a/c/src/lib/libbsp/m68k/mvme136/clock/ckinit.c +++ b/c/src/lib/libbsp/m68k/mvme136/clock/ckinit.c @@ -108,17 +108,6 @@ void Install_clock( } -void ReInstall_clock( - rtems_isr_entry clock_isr -) -{ - rtems_unsigned32 isrlevel; - - rtems_interrupt_disable( isrlevel ); - (void) set_vector( clock_isr, CLOCK_VECTOR, 1 ); - rtems_interrupt_enable( isrlevel ); -} - void Clock_exit( void ) { volatile struct z8036_map *timer; @@ -157,6 +146,7 @@ rtems_device_driver Clock_control( void *pargp ) { + rtems_unsigned32 isrlevel; rtems_libio_ioctl_args_t *args = pargp; if (args == 0) @@ -173,7 +163,9 @@ rtems_device_driver Clock_control( } else if (args->command == rtems_build_name('N', 'E', 'W', ' ')) { - ReInstall_clock(args->buffer); + rtems_interrupt_disable( isrlevel ); + (void) set_vector( args->buffer, CLOCK_VECTOR, 1 ); + rtems_interrupt_enable( isrlevel ); } done: diff --git a/c/src/lib/libbsp/m68k/mvme136/startup/bspstart.c b/c/src/lib/libbsp/m68k/mvme136/startup/bspstart.c index 3465f72416..ea8eb56db6 100644 --- a/c/src/lib/libbsp/m68k/mvme136/startup/bspstart.c +++ b/c/src/lib/libbsp/m68k/mvme136/startup/bspstart.c @@ -124,18 +124,21 @@ void bsp_postdriver_hook(void) { int stdin_fd, stdout_fd, stderr_fd; - + int error_code; + + error_code = 'S' << 24 | 'T' << 16; + if ((stdin_fd = __open("/dev/console", O_RDONLY, 0)) == -1) - rtems_fatal_error_occurred('STD0'); + rtems_fatal_error_occurred( error_code | 'D' << 8 | '0' ); if ((stdout_fd = __open("/dev/console", O_WRONLY, 0)) == -1) - rtems_fatal_error_occurred('STD1'); + rtems_fatal_error_occurred( error_code | 'D' << 8 | '1' ); if ((stderr_fd = __open("/dev/console", O_WRONLY, 0)) == -1) - rtems_fatal_error_occurred('STD2'); + rtems_fatal_error_occurred( error_code | 'D' << 8 | '2' ); if ((stdin_fd != 0) || (stdout_fd != 1) || (stderr_fd != 2)) - rtems_fatal_error_occurred('STIO'); + rtems_fatal_error_occurred( error_code | 'I' << 8 | 'O' ); } diff --git a/c/src/lib/libbsp/m68k/mvme162/clock/ckinit.c b/c/src/lib/libbsp/m68k/mvme162/clock/ckinit.c index df0a13d52f..57afd71292 100644 --- a/c/src/lib/libbsp/m68k/mvme162/clock/ckinit.c +++ b/c/src/lib/libbsp/m68k/mvme162/clock/ckinit.c @@ -89,15 +89,6 @@ void Install_clock(rtems_isr_entry clock_isr ) } } -void ReInstall_clock(rtems_isr_entry clock_isr) -{ - rtems_unsigned32 isrlevel; - - rtems_interrupt_disable( isrlevel ); - (void) set_vector( clock_isr, CLOCK_VECTOR, 1 ); - rtems_interrupt_enable( isrlevel ); -} - void Clock_exit( void ) { /* Dummy for now. See other m68k BSP's for code examples */ @@ -127,6 +118,7 @@ rtems_device_driver Clock_control( void *pargp ) { + rtems_unsigned32 isrlevel; rtems_libio_ioctl_args_t *args = pargp; if (args == 0) @@ -143,7 +135,9 @@ rtems_device_driver Clock_control( } else if (args->command == rtems_build_name('N', 'E', 'W', ' ')) { - ReInstall_clock(args->buffer); + rtems_interrupt_disable( isrlevel ); + (void) set_vector( args->buffer, CLOCK_VECTOR, 1 ); + rtems_interrupt_enable( isrlevel ); } done: diff --git a/c/src/lib/libbsp/m68k/mvme162/startup/bspstart.c b/c/src/lib/libbsp/m68k/mvme162/startup/bspstart.c index 123cd413d2..211ce19032 100644 --- a/c/src/lib/libbsp/m68k/mvme162/startup/bspstart.c +++ b/c/src/lib/libbsp/m68k/mvme162/startup/bspstart.c @@ -130,18 +130,21 @@ void bsp_postdriver_hook(void) { int stdin_fd, stdout_fd, stderr_fd; + int error_code; + + error_code = 'S' << 24 | 'T' << 16; if ((stdin_fd = __open("/dev/console", O_RDONLY, 0)) == -1) - rtems_fatal_error_occurred('STD0'); + rtems_fatal_error_occurred( error_code | 'D' << 8 | '0' ); if ((stdout_fd = __open("/dev/console", O_WRONLY, 0)) == -1) - rtems_fatal_error_occurred('STD1'); + rtems_fatal_error_occurred( error_code | 'D' << 8 | '1' ); if ((stderr_fd = __open("/dev/console", O_WRONLY, 0)) == -1) - rtems_fatal_error_occurred('STD2'); + rtems_fatal_error_occurred( error_code | 'D' << 8 | '2' ); if ((stdin_fd != 0) || (stdout_fd != 1) || (stderr_fd != 2)) - rtems_fatal_error_occurred('STIO'); + rtems_fatal_error_occurred( error_code | 'I' << 8 | 'O' ); } int main( diff --git a/c/src/lib/libbsp/no_cpu/no_bsp/clock/ckinit.c b/c/src/lib/libbsp/no_cpu/no_bsp/clock/ckinit.c index efe0225520..7c8f9617e7 100644 --- a/c/src/lib/libbsp/no_cpu/no_bsp/clock/ckinit.c +++ b/c/src/lib/libbsp/no_cpu/no_bsp/clock/ckinit.c @@ -105,7 +105,7 @@ void Install_clock( */ if ( BSP_Configuration.ticks_per_timeslice ) { - Old_ticker = ( rtems_isr_entry ) set_vector( clock_isr, CLOCK_VECTOR, 1 ); + Old_ticker = (rtems_isr_entry) set_vector( clock_isr, CLOCK_VECTOR, 1 ); /* * Hardware specific initialize goes here */ @@ -121,30 +121,6 @@ void Install_clock( } /* - * Reinstall_clock - * - * Install a clock tick handler without reprogramming the chip. This - * is used by the polling shared memory device driver. - */ - -void ReInstall_clock( - rtems_isr_entry clock_isr -) -{ - rtems_unsigned32 isrlevel = 0; - - /* - * Disable interrupts and install the clock ISR vector using the - * BSP dependent set_vector routine. In the below example, the clock - * ISR is on vector 4 and is an RTEMS interrupt. - */ - - rtems_interrupt_disable( isrlevel ); - (void) set_vector( clock_isr, CLOCK_VECTOR, 1 ); - rtems_interrupt_enable( isrlevel ); -} - -/* * Clean up before the application exits */ @@ -188,6 +164,7 @@ rtems_device_driver Clock_control( void *pargp ) { + rtems_unsigned32 isrlevel; rtems_libio_ioctl_args_t *args = pargp; if (args == 0) @@ -204,7 +181,9 @@ rtems_device_driver Clock_control( } else if (args->command == rtems_build_name('N', 'E', 'W', ' ')) { - ReInstall_clock(args->buffer); + rtems_interrupt_disable( isrlevel ); + (void) set_vector( args->buffer, CLOCK_VECTOR, 1 ); + rtems_interrupt_enable( isrlevel ); } done: diff --git a/c/src/lib/libbsp/no_cpu/no_bsp/startup/bspstart.c b/c/src/lib/libbsp/no_cpu/no_bsp/startup/bspstart.c index e28e791503..7f08b779dd 100644 --- a/c/src/lib/libbsp/no_cpu/no_bsp/startup/bspstart.c +++ b/c/src/lib/libbsp/no_cpu/no_bsp/startup/bspstart.c @@ -131,18 +131,21 @@ void bsp_postdriver_hook(void) { int stdin_fd, stdout_fd, stderr_fd; + int error_code; + + error_code = 'S' << 24 | 'T' << 16; if ((stdin_fd = __open("/dev/console", O_RDONLY, 0)) == -1) - rtems_fatal_error_occurred('STD0'); + rtems_fatal_error_occurred( error_code | 'D' << 8 | '0' ); if ((stdout_fd = __open("/dev/console", O_WRONLY, 0)) == -1) - rtems_fatal_error_occurred('STD1'); + rtems_fatal_error_occurred( error_code | 'D' << 8 | '1' ); if ((stderr_fd = __open("/dev/console", O_WRONLY, 0)) == -1) - rtems_fatal_error_occurred('STD2'); + rtems_fatal_error_occurred( error_code | 'D' << 8 | '2' ); if ((stdin_fd != 0) || (stdout_fd != 1) || (stderr_fd != 2)) - rtems_fatal_error_occurred('STIO'); + rtems_fatal_error_occurred( error_code | 'I' << 8 | 'O' ); } int bsp_start( diff --git a/c/src/lib/libbsp/powerpc/papyrus/startup/bspstart.c b/c/src/lib/libbsp/powerpc/papyrus/startup/bspstart.c index 6c5133f7ed..b044367f43 100644 --- a/c/src/lib/libbsp/powerpc/papyrus/startup/bspstart.c +++ b/c/src/lib/libbsp/powerpc/papyrus/startup/bspstart.c @@ -149,18 +149,21 @@ void bsp_postdriver_hook(void) { int stdin_fd, stdout_fd, stderr_fd; + int error_code; + + error_code = 'S' << 24 | 'T' << 16; if ((stdin_fd = __open("/dev/console", O_RDONLY, 0)) == -1) - rtems_fatal_error_occurred('STD0'); + rtems_fatal_error_occurred( error_code | 'D' << 8 | '0' ); if ((stdout_fd = __open("/dev/console", O_WRONLY, 0)) == -1) - rtems_fatal_error_occurred('STD1'); + rtems_fatal_error_occurred( error_code | 'D' << 8 | '1' ); if ((stderr_fd = __open("/dev/console", O_WRONLY, 0)) == -1) - rtems_fatal_error_occurred('STD2'); + rtems_fatal_error_occurred( error_code | 'D' << 8 | '2' ); if ((stdin_fd != 0) || (stdout_fd != 1) || (stderr_fd != 2)) - rtems_fatal_error_occurred('STIO'); + rtems_fatal_error_occurred( error_code | 'I' << 8 | 'O' ); } int main( diff --git a/c/src/lib/libbsp/unix/posix/clock/clock.c b/c/src/lib/libbsp/unix/posix/clock/clock.c index da0dd46807..3e05b694a7 100644 --- a/c/src/lib/libbsp/unix/posix/clock/clock.c +++ b/c/src/lib/libbsp/unix/posix/clock/clock.c @@ -31,30 +31,18 @@ rtems_unsigned32 Clock_driver_vector; rtems_device_major_number rtems_clock_major = ~0; rtems_device_minor_number rtems_clock_minor; -void -Install_clock(rtems_isr_entry clock_isr) +void Install_clock(rtems_isr_entry clock_isr) { Clock_driver_ticks = 0; - (void)set_vector(clock_isr, Clock_driver_vector, 1); + (void) set_vector( clock_isr, Clock_driver_vector, 1 ); _CPU_Start_clock( BSP_Configuration.microseconds_per_tick ); atexit(Clock_exit); } -void -ReInstall_clock(rtems_isr_entry new_clock_isr) -{ - rtems_unsigned32 isrlevel = 0; - - rtems_interrupt_disable(isrlevel); - (void)set_vector(new_clock_isr, Clock_driver_vector, 1); - rtems_interrupt_enable(isrlevel); -} - -void -Clock_isr(int vector) +void Clock_isr(int vector) { Clock_driver_ticks++; rtems_clock_tick(); @@ -65,16 +53,14 @@ Clock_isr(int vector) * Remove the clock signal */ -void -Clock_exit(void) +void Clock_exit(void) { _CPU_Stop_clock(); - (void)set_vector(0, Clock_driver_vector, 1); + (void) set_vector( 0, Clock_driver_vector, 1 ); } -rtems_device_driver -Clock_initialize( +rtems_device_driver Clock_initialize( rtems_device_major_number major, rtems_device_minor_number minor, void *pargp @@ -99,6 +85,7 @@ rtems_device_driver Clock_control( void *pargp ) { + rtems_unsigned32 isrlevel; rtems_libio_ioctl_args_t *args = pargp; if (args == 0) @@ -115,7 +102,9 @@ rtems_device_driver Clock_control( } else if (args->command == rtems_build_name('N', 'E', 'W', ' ')) { - ReInstall_clock(args->buffer); + rtems_interrupt_disable( isrlevel ); + (void) set_vector( args->buffer, Clock_driver_vector, 1 ); + rtems_interrupt_enable( isrlevel ); } done: diff --git a/c/src/lib/libbsp/unix/posix/startup/bspstart.c b/c/src/lib/libbsp/unix/posix/startup/bspstart.c index 8ce3e92ecb..cefa60032f 100644 --- a/c/src/lib/libbsp/unix/posix/startup/bspstart.c +++ b/c/src/lib/libbsp/unix/posix/startup/bspstart.c @@ -182,18 +182,21 @@ 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 = __open("/dev/console", O_RDONLY, 0)) == -1) - rtems_fatal_error_occurred('STD0'); + rtems_fatal_error_occurred( error_code | 'D' << 8 | '0' ); if ((stdout_fd = __open("/dev/console", O_WRONLY, 0)) == -1) - rtems_fatal_error_occurred('STD1'); + rtems_fatal_error_occurred( error_code | 'D' << 8 | '1' ); if ((stderr_fd = __open("/dev/console", O_WRONLY, 0)) == -1) - rtems_fatal_error_occurred('STD2'); + rtems_fatal_error_occurred( error_code | 'D' << 8 | '2' ); if ((stdin_fd != 0) || (stdout_fd != 1) || (stderr_fd != 2)) - rtems_fatal_error_occurred('STIO'); + rtems_fatal_error_occurred( error_code | 'I' << 8 | 'O' ); #endif #if defined(MALLOC_STATS) |