Changeset 9700578 in rtems for c/src/lib


Ignore:
Timestamp:
10/30/95 21:54:45 (27 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
c4808ca
Parents:
ea74482
Message:

SPARC port passes all tests

Location:
c/src/lib
Files:
1 added
30 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/include/ringbuf.h

    rea74482 r9700578  
    1111
    1212#ifndef RINGBUF_QUEUE_LENGTH
    13 #define RINGBUF_QUEUE_LENGTH 200
     13#define RINGBUF_QUEUE_LENGTH 128
    1414#endif
    1515
    1616typedef struct {
    1717  char buffer[RINGBUF_QUEUE_LENGTH];
    18   int  head;
    19   int  tail;
     18  volatile int  head;
     19  volatile int  tail;
    2020} Ring_buffer_t;
    2121
     
    2828   ( (_buffer)->head == (_buffer)->tail )
    2929
     30#define Ring_buffer_Is_full( _buffer ) \
     31   ( (_buffer)->head == ((_buffer)->tail + 1) % RINGBUF_QUEUE_LENGTH )
     32
    3033#define Ring_buffer_Add_character( _buffer, _ch ) \
    3134  do { \
    32     (_buffer)->buffer[ (_buffer)->tail ] = (_ch); \
    33     (_buffer)->tail = ((_buffer)->tail+1) % RINGBUF_QUEUE_LENGTH; \
     35    rtems_unsigned32 isrlevel; \
     36    \
     37    rtems_interrupt_disable( isrlevel ); \
     38      (_buffer)->tail = ((_buffer)->tail+1) % RINGBUF_QUEUE_LENGTH; \
     39      (_buffer)->buffer[ (_buffer)->tail ] = (_ch); \
     40    rtems_interrupt_enable( isrlevel ); \
    3441  } while ( 0 )
    3542
    3643#define Ring_buffer_Remove_character( _buffer, _ch ) \
    3744  do { \
    38     (_ch) = (_buffer)->buffer[ (_buffer)->head ]; \
    39     (_buffer)->head = ((_buffer)->head+1) % RINGBUF_QUEUE_LENGTH; \
     45    rtems_unsigned32 isrlevel; \
     46    \
     47    rtems_interrupt_disable( isrlevel ); \
     48      (_buffer)->head = ((_buffer)->head+1) % RINGBUF_QUEUE_LENGTH; \
     49      (_ch) = (_buffer)->buffer[ (_buffer)->head ]; \
     50    rtems_interrupt_enable( isrlevel ); \
    4051  } while ( 0 )
    4152
  • c/src/lib/libbsp/hppa1.1/simhppa/startup/bspstart.c

    rea74482 r9700578  
    3030#include <bsp.h>
    3131#include <rtems/libio.h>
    32 #include <rtems/score/intthrd.h>
     32#include <rtems/intthrd.h>
    3333
    3434#include <libcsupport.h>
     
    244244bsp_postdriver_hook(void)
    245245{
    246     int stdin_fd, stdout_fd, stderr_fd;
    247    
    248     if ((stdin_fd = __open("/dev/tty00", O_RDONLY, 0)) == -1)
    249         rtems_fatal_error_occurred('STD0');
    250 
    251     if ((stdout_fd = __open("/dev/tty00", O_WRONLY, 0)) == -1)
    252         rtems_fatal_error_occurred('STD1');
    253 
    254     if ((stderr_fd = __open("/dev/tty00", O_WRONLY, 0)) == -1)
    255         rtems_fatal_error_occurred('STD2');
    256 
    257     if ((stdin_fd != 0) || (stdout_fd != 1) || (stderr_fd != 2))
    258         rtems_fatal_error_occurred('STIO');
     246  int stdin_fd, stdout_fd, stderr_fd;
     247  int error_code;
     248 
     249  error_code = 'S' << 24 | 'T' << 16;
     250 
     251  if ((stdin_fd = __open("/dev/console", O_RDONLY, 0)) == -1)
     252    rtems_fatal_error_occurred( error_code | 'D' << 8 | '0' );
     253 
     254  if ((stdout_fd = __open("/dev/console", O_WRONLY, 0)) == -1)
     255    rtems_fatal_error_occurred( error_code | 'D' << 8 | '1' );
     256 
     257  if ((stderr_fd = __open("/dev/console", O_WRONLY, 0)) == -1)
     258    rtems_fatal_error_occurred( error_code | 'D' << 8 | '2' );
     259 
     260  if ((stdin_fd != 0) || (stdout_fd != 1) || (stderr_fd != 2))
     261    rtems_fatal_error_occurred( error_code | 'I' << 8 | 'O' );
    259262}
    260263
  • c/src/lib/libbsp/i386/force386/clock/ckinit.c

    rea74482 r9700578  
    7676}
    7777
    78 void ReInstall_clock(
    79   rtems_isr_entry clock_isr
    80 )
    81 {
    82   rtems_unsigned32 isrlevel = 0;
    83 
    84   rtems_interrupt_disable( isrlevel );
    85    (void) set_vector( clock_isr, CLOCK_VECTOR, 1 );
    86   rtems_interrupt_enable( isrlevel );
    87 }
    88 
    8978void Clock_exit( void )
    9079{
     
    120109)
    121110{
     111    rtems_unsigned32 isrlevel;
    122112    rtems_libio_ioctl_args_t *args = pargp;
    123113 
     
    136126    else if (args->command == rtems_build_name('N', 'E', 'W', ' '))
    137127    {
    138         ReInstall_clock(args->buffer);
     128      rtems_interrupt_disable( isrlevel );
     129       (void) set_vector( args->buffer, CLOCK_VECTOR, 1 );
     130      rtems_interrupt_enable( isrlevel );
    139131    }
    140132 
  • c/src/lib/libbsp/i386/force386/startup/bspstart.c

    rea74482 r9700578  
    123123{
    124124  int stdin_fd, stdout_fd, stderr_fd;
     125  int error_code;
     126 
     127  error_code = 'S' << 24 | 'T' << 16;
    125128 
    126129  if ((stdin_fd = __open("/dev/console", O_RDONLY, 0)) == -1)
    127     rtems_fatal_error_occurred('STD0');
     130    rtems_fatal_error_occurred( error_code | 'D' << 8 | '0' );
    128131 
    129132  if ((stdout_fd = __open("/dev/console", O_WRONLY, 0)) == -1)
    130     rtems_fatal_error_occurred('STD1');
     133    rtems_fatal_error_occurred( error_code | 'D' << 8 | '1' );
    131134 
    132135  if ((stderr_fd = __open("/dev/console", O_WRONLY, 0)) == -1)
    133     rtems_fatal_error_occurred('STD2');
     136    rtems_fatal_error_occurred( error_code | 'D' << 8 | '2' );
    134137 
    135138  if ((stdin_fd != 0) || (stdout_fd != 1) || (stderr_fd != 2))
    136     rtems_fatal_error_occurred('STIO');
     139    rtems_fatal_error_occurred( error_code | 'I' << 8 | 'O' );
    137140}
    138141
  • c/src/lib/libbsp/i386/go32/clock/ckinit.c

    rea74482 r9700578  
    109109}
    110110
    111 void ReInstall_clock(
    112   rtems_isr_entry clock_isr
    113 )
    114 {
    115   rtems_unsigned32 isrlevel = 0;
    116 
    117   rtems_interrupt_disable( isrlevel );
    118    (void) set_vector( clock_isr, CLOCK_VECTOR, 1 );
    119   rtems_interrupt_enable( isrlevel );
    120 }
    121 
    122111void Clock_exit( void )
    123112{
     
    162151)
    163152{
     153    rtems_unsigned32 isrlevel;
    164154    rtems_libio_ioctl_args_t *args = pargp;
    165155 
     
    178168    else if (args->command == rtems_build_name('N', 'E', 'W', ' '))
    179169    {
    180         ReInstall_clock(args->buffer);
     170      rtems_interrupt_disable( isrlevel );
     171       (void) set_vector( args->buffer, CLOCK_VECTOR, 1 );
     172      rtems_interrupt_enable( isrlevel );
    181173    }
    182174 
  • c/src/lib/libbsp/i386/go32/startup/bspstart.c

    rea74482 r9700578  
    130130{
    131131  int stdin_fd, stdout_fd, stderr_fd;
     132  int error_code;
     133 
     134  error_code = 'S' << 24 | 'T' << 16;
    132135 
    133136  if ((stdin_fd = __open("/dev/console", O_RDONLY, 0)) == -1)
    134     rtems_fatal_error_occurred('STD0');
     137    rtems_fatal_error_occurred( error_code | 'D' << 8 | '0' );
    135138 
    136139  if ((stdout_fd = __open("/dev/console", O_WRONLY, 0)) == -1)
    137     rtems_fatal_error_occurred('STD1');
     140    rtems_fatal_error_occurred( error_code | 'D' << 8 | '1' );
    138141 
    139142  if ((stderr_fd = __open("/dev/console", O_WRONLY, 0)) == -1)
    140     rtems_fatal_error_occurred('STD2');
     143    rtems_fatal_error_occurred( error_code | 'D' << 8 | '2' );
    141144 
    142145  if ((stdin_fd != 0) || (stdout_fd != 1) || (stderr_fd != 2))
    143     rtems_fatal_error_occurred('STIO');
     146    rtems_fatal_error_occurred( error_code | 'I' << 8 | 'O' );
    144147}
    145148
  • c/src/lib/libbsp/i960/cvme961/clock/ckinit.c

    rea74482 r9700578  
    6161}
    6262
    63 void ReInstall_clock(
    64   rtems_isr_entry clock_isr
    65 )
    66 {
    67    (void) set_vector( clock_isr, CLOCK_VECTOR, 1 );
    68 }
    69 
    7063void Clock_exit()
    7164{
     
    10699)
    107100{
     101    rtems_unsigned32 isrlevel;
    108102    rtems_libio_ioctl_args_t *args = pargp;
    109103 
     
    122116    else if (args->command == rtems_build_name('N', 'E', 'W', ' '))
    123117    {
    124         ReInstall_clock(args->buffer);
     118      rtems_interrupt_disable( isrlevel );
     119       (void) set_vector( args->buffer, CLOCK_VECTOR, 1 );
     120      rtems_interrupt_enable( isrlevel );
    125121    }
    126122 
  • c/src/lib/libbsp/i960/cvme961/startup/bspstart.c

    rea74482 r9700578  
    125125{
    126126  int stdin_fd, stdout_fd, stderr_fd;
     127  int error_code;
     128 
     129  error_code = 'S' << 24 | 'T' << 16;
    127130 
    128131  if ((stdin_fd = __open("/dev/console", O_RDONLY, 0)) == -1)
    129     rtems_fatal_error_occurred('STD0');
     132    rtems_fatal_error_occurred( error_code | 'D' << 8 | '0' );
    130133 
    131134  if ((stdout_fd = __open("/dev/console", O_WRONLY, 0)) == -1)
    132     rtems_fatal_error_occurred('STD1');
     135    rtems_fatal_error_occurred( error_code | 'D' << 8 | '1' );
    133136 
    134137  if ((stderr_fd = __open("/dev/console", O_WRONLY, 0)) == -1)
    135     rtems_fatal_error_occurred('STD2');
     138    rtems_fatal_error_occurred( error_code | 'D' << 8 | '2' );
    136139 
    137140  if ((stdin_fd != 0) || (stdout_fd != 1) || (stderr_fd != 2))
    138     rtems_fatal_error_occurred('STIO');
     141    rtems_fatal_error_occurred( error_code | 'I' << 8 | 'O' );
    139142}
    140143
  • c/src/lib/libbsp/m68k/dmv152/clock/ckinit.c

    rea74482 r9700578  
    9898}
    9999
    100 void ReInstall_clock(
    101   rtems_isr_entry clock_isr
    102 )
    103 {
    104   rtems_unsigned32 isrlevel = 0 ;
    105 
    106   rtems_interrupt_disable( isrlevel );
    107    (void) set_vector( clock_isr, CLOCK_VECTOR, 1 );
    108   rtems_interrupt_enable( isrlevel );
    109 }
    110 
    111100void Clock_exit( void )
    112101{
     
    146135)
    147136{
     137    rtems_unsigned32 isrlevel;
    148138    rtems_libio_ioctl_args_t *args = pargp;
    149139 
     
    162152    else if (args->command == rtems_build_name('N', 'E', 'W', ' '))
    163153    {
    164         ReInstall_clock(args->buffer);
     154      rtems_interrupt_disable( isrlevel );
     155       (void) set_vector( args->buffer, CLOCK_VECTOR, 1 );
     156      rtems_interrupt_enable( isrlevel );
    165157    }
    166158 
  • c/src/lib/libbsp/m68k/dmv152/startup/bspstart.c

    rea74482 r9700578  
    124124{
    125125  int stdin_fd, stdout_fd, stderr_fd;
     126  int error_code;
     127 
     128  error_code = 'S' << 24 | 'T' << 16;
    126129 
    127130  if ((stdin_fd = __open("/dev/console", O_RDONLY, 0)) == -1)
    128     rtems_fatal_error_occurred('STD0');
     131    rtems_fatal_error_occurred( error_code | 'D' << 8 | '0' );
    129132 
    130133  if ((stdout_fd = __open("/dev/console", O_WRONLY, 0)) == -1)
    131     rtems_fatal_error_occurred('STD1');
     134    rtems_fatal_error_occurred( error_code | 'D' << 8 | '1' );
    132135 
    133136  if ((stderr_fd = __open("/dev/console", O_WRONLY, 0)) == -1)
    134     rtems_fatal_error_occurred('STD2');
     137    rtems_fatal_error_occurred( error_code | 'D' << 8 | '2' );
    135138 
    136139  if ((stdin_fd != 0) || (stdout_fd != 1) || (stderr_fd != 2))
    137     rtems_fatal_error_occurred('STIO');
     140    rtems_fatal_error_occurred( error_code | 'I' << 8 | 'O' );
    138141}
    139142
  • c/src/lib/libbsp/m68k/efi332/clock/ckinit.c

    rea74482 r9700578  
    7171}
    7272
    73 void ReInstall_clock(
    74   rtems_isr_entry clock_isr
    75 )
    76 {
    77   rtems_unsigned32 isrlevel = 0 ;
    78 
    79   rtems_interrupt_disable( isrlevel );
    80    (void) set_vector( clock_isr, CLOCK_VECTOR, 1 );
    81   rtems_interrupt_enable( isrlevel );
    82 }
    83 
    8473void Clock_exit( void )
    8574{
     
    121110)
    122111{
     112    rtems_unsigned32 isrlevel;
    123113    rtems_libio_ioctl_args_t *args = pargp;
    124114 
     
    137127    else if (args->command == rtems_build_name('N', 'E', 'W', ' '))
    138128    {
    139         ReInstall_clock(args->buffer);
     129      rtems_interrupt_disable( isrlevel );
     130       (void) set_vector( args->buffer, CLOCK_VECTOR, 1 );
     131      rtems_interrupt_enable( isrlevel );
    140132    }
    141133 
  • c/src/lib/libbsp/m68k/efi332/startup/bspstart.c

    rea74482 r9700578  
    124124{
    125125  int stdin_fd, stdout_fd, stderr_fd;
     126  int error_code;
     127 
     128  error_code = 'S' << 24 | 'T' << 16;
    126129 
    127130  if ((stdin_fd = __open("/dev/console", O_RDONLY, 0)) == -1)
    128     rtems_fatal_error_occurred('STD0');
     131    rtems_fatal_error_occurred( error_code | 'D' << 8 | '0' );
    129132 
    130133  if ((stdout_fd = __open("/dev/console", O_WRONLY, 0)) == -1)
    131     rtems_fatal_error_occurred('STD1');
     134    rtems_fatal_error_occurred( error_code | 'D' << 8 | '1' );
    132135 
    133136  if ((stderr_fd = __open("/dev/console", O_WRONLY, 0)) == -1)
    134     rtems_fatal_error_occurred('STD2');
     137    rtems_fatal_error_occurred( error_code | 'D' << 8 | '2' );
    135138 
    136139  if ((stdin_fd != 0) || (stdout_fd != 1) || (stderr_fd != 2))
    137     rtems_fatal_error_occurred('STIO');
     140    rtems_fatal_error_occurred( error_code | 'I' << 8 | 'O' );
    138141}
    139142 
  • c/src/lib/libbsp/m68k/efi68k/clock/ckinit.c

    rea74482 r9700578  
    9494}
    9595
    96 void ReInstall_clock(
    97   rtems_isr_entry clock_isr
    98 )
    99 {
    100   rtems_unsigned32 isrlevel = 0 ;
    101 
    102   rtems_interrupt_disable( isrlevel );
    103    (void) set_vector( clock_isr, CLOCK_VECTOR, 1 );
    104   rtems_interrupt_enable( isrlevel );
    105 }
    106 
    10796void Clock_exit( void )
    10897{
     
    142131)
    143132{
     133    rtems_unsigned32 isrlevel;
    144134    rtems_libio_ioctl_args_t *args = pargp;
    145135 
     
    158148    else if (args->command == rtems_build_name('N', 'E', 'W', ' '))
    159149    {
    160         ReInstall_clock(args->buffer);
     150      rtems_interrupt_disable( isrlevel );
     151       (void) set_vector( args->buffer, CLOCK_VECTOR, 1 );
     152      rtems_interrupt_enable( isrlevel );
    161153    }
    162154 
  • c/src/lib/libbsp/m68k/efi68k/startup/bspstart.c

    rea74482 r9700578  
    131131{
    132132  int stdin_fd, stdout_fd, stderr_fd;
     133  int error_code;
     134 
     135  error_code = 'S' << 24 | 'T' << 16;
    133136 
    134137  if ((stdin_fd = __open("/dev/console", O_RDONLY, 0)) == -1)
    135     rtems_fatal_error_occurred('STD0');
     138    rtems_fatal_error_occurred( error_code | 'D' << 8 | '0' );
    136139 
    137140  if ((stdout_fd = __open("/dev/console", O_WRONLY, 0)) == -1)
    138     rtems_fatal_error_occurred('STD1');
     141    rtems_fatal_error_occurred( error_code | 'D' << 8 | '1' );
    139142 
    140143  if ((stderr_fd = __open("/dev/console", O_WRONLY, 0)) == -1)
    141     rtems_fatal_error_occurred('STD2');
     144    rtems_fatal_error_occurred( error_code | 'D' << 8 | '2' );
    142145 
    143146  if ((stdin_fd != 0) || (stdout_fd != 1) || (stderr_fd != 2))
    144     rtems_fatal_error_occurred('STIO');
     147    rtems_fatal_error_occurred( error_code | 'I' << 8 | 'O' );
    145148}
    146149
  • c/src/lib/libbsp/m68k/gen68302/clock/ckinit.c

    rea74482 r9700578  
    9090
    9191  if ( BSP_Configuration.ticks_per_timeslice ) {
    92 /*  set_vector( clock_isr, CLOCK_VECTOR, 1 );*/
     92   set_vector( clock_isr, CLOCK_VECTOR, 1 );
    9393
    9494    m302.reg.trr1 = TRR1_VAL;           /* set timer reference register */
     
    101101    atexit( Clock_exit );
    102102  }
    103 }
    104 
    105 void ReInstall_clock(
    106   rtems_isr_entry clock_isr
    107 )
    108 {
    109   rtems_unsigned32 isrlevel;
    110  
    111   rtems_interrupt_disable( isrlevel );
    112    /* (void) set_vector( clock_isr, CLOCK_VECTOR, 1 ); */
    113   rtems_interrupt_enable( isrlevel );
    114103}
    115104
     
    146135)
    147136{
     137    rtems_unsigned32 isrlevel;
    148138    rtems_libio_ioctl_args_t *args = pargp;
    149139 
     
    162152    else if (args->command == rtems_build_name('N', 'E', 'W', ' '))
    163153    {
    164         ReInstall_clock(args->buffer);
     154      rtems_interrupt_disable( isrlevel );
     155       (void) set_vector( args->buffer, CLOCK_VECTOR, 1 );
     156      rtems_interrupt_enable( isrlevel );
    165157    }
    166158 
  • c/src/lib/libbsp/m68k/gen68302/start/start302.s

    rea74482 r9700578  
    194194|               move.l  #_cnsl_isr,vbase+0x028  | SCC2
    195195                move.l  #timerisr,vbase+0x018   | Timer ISR
    196                 move.l  #RTC_ISR,vbase+0x024    | Real Time Clock ISR
    197196
    198197        |
     
    237236
    238237        nop
    239 RTC_ISR:
    240         movem.l  d0-d1/a0-a1,a7@-    | save d0-d1,a0-a1
    241         addql   #1,_ISR_Nest_level       | one nest level deeper
    242         addql   #1,_Thread_Dispatch_disable_level
    243                                          | disable multitasking
    244 
    245         jbsr    Clock_isr               | invoke the user ISR
    246         jmp     _ISR_Exit
    247238END_CODE
    248239
  • c/src/lib/libbsp/m68k/gen68302/start302/start302.s

    rea74482 r9700578  
    194194|               move.l  #_cnsl_isr,vbase+0x028  | SCC2
    195195                move.l  #timerisr,vbase+0x018   | Timer ISR
    196                 move.l  #RTC_ISR,vbase+0x024    | Real Time Clock ISR
    197196
    198197        |
     
    237236
    238237        nop
    239 RTC_ISR:
    240         movem.l  d0-d1/a0-a1,a7@-    | save d0-d1,a0-a1
    241         addql   #1,_ISR_Nest_level       | one nest level deeper
    242         addql   #1,_Thread_Dispatch_disable_level
    243                                          | disable multitasking
    244 
    245         jbsr    Clock_isr               | invoke the user ISR
    246         jmp     _ISR_Exit
    247238END_CODE
    248239
  • c/src/lib/libbsp/m68k/gen68302/startup/bspstart.c

    rea74482 r9700578  
    131131{
    132132  int stdin_fd, stdout_fd, stderr_fd;
     133  int error_code;
     134 
     135  error_code = 'S' << 24 | 'T' << 16;
    133136 
    134137  if ((stdin_fd = __open("/dev/console", O_RDONLY, 0)) == -1)
    135     rtems_fatal_error_occurred('STD0');
     138    rtems_fatal_error_occurred( error_code | 'D' << 8 | '0' );
    136139 
    137140  if ((stdout_fd = __open("/dev/console", O_WRONLY, 0)) == -1)
    138     rtems_fatal_error_occurred('STD1');
     141    rtems_fatal_error_occurred( error_code | 'D' << 8 | '1' );
    139142 
    140143  if ((stderr_fd = __open("/dev/console", O_WRONLY, 0)) == -1)
    141     rtems_fatal_error_occurred('STD2');
     144    rtems_fatal_error_occurred( error_code | 'D' << 8 | '2' );
    142145 
    143146  if ((stdin_fd != 0) || (stdout_fd != 1) || (stderr_fd != 2))
    144     rtems_fatal_error_occurred('STIO');
     147    rtems_fatal_error_occurred( error_code | 'I' << 8 | 'O' );
    145148}
    146149
  • c/src/lib/libbsp/m68k/idp/clock/ckinit.c

    rea74482 r9700578  
    131131}
    132132
    133 void ReInstall_clock( clock_isr )
    134 rtems_isr_entry clock_isr;
    135 {
    136   rtems_unsigned32 isrlevel = 0 ;
    137 
    138   rtems_interrupt_disable( isrlevel );
    139    (void) set_vector( clock_isr, CLOCK_VECTOR, 1 );
    140   rtems_interrupt_enable( isrlevel );
    141 }
    142 
    143133/* The following was added for debugging purposes */
    144134void Clock_exit( void )
     
    182172)
    183173{
     174    rtems_unsigned32 isrlevel;
    184175    rtems_libio_ioctl_args_t *args = pargp;
    185176 
     
    198189    else if (args->command == rtems_build_name('N', 'E', 'W', ' '))
    199190    {
    200         ReInstall_clock(args->buffer);
     191      rtems_interrupt_disable( isrlevel );
     192       (void) set_vector( args->buffer, CLOCK_VECTOR, 1 );
     193      rtems_interrupt_enable( isrlevel );
    201194    }
    202195 
  • c/src/lib/libbsp/m68k/idp/console/duart.c

    rea74482 r9700578  
    1 #
    2 #  $Id$
    3 #
     1/*
     2 *  $Id$
     3 */
    44
    55/*#########################################################
  • c/src/lib/libbsp/m68k/idp/startup/bspstart.c

    rea74482 r9700578  
    132132{
    133133  int stdin_fd, stdout_fd, stderr_fd;
     134  int error_code;
     135 
     136  error_code = 'S' << 24 | 'T' << 16;
    134137 
    135138  if ((stdin_fd = __open("/dev/console", O_RDONLY, 0)) == -1)
    136     rtems_fatal_error_occurred('STD0');
     139    rtems_fatal_error_occurred( error_code | 'D' << 8 | '0' );
    137140 
    138141  if ((stdout_fd = __open("/dev/console", O_WRONLY, 0)) == -1)
    139     rtems_fatal_error_occurred('STD1');
     142    rtems_fatal_error_occurred( error_code | 'D' << 8 | '1' );
    140143 
    141144  if ((stderr_fd = __open("/dev/console", O_WRONLY, 0)) == -1)
    142     rtems_fatal_error_occurred('STD2');
     145    rtems_fatal_error_occurred( error_code | 'D' << 8 | '2' );
    143146 
    144147  if ((stdin_fd != 0) || (stdout_fd != 1) || (stderr_fd != 2))
    145     rtems_fatal_error_occurred('STIO');
     148    rtems_fatal_error_occurred( error_code | 'I' << 8 | 'O' );
    146149}
    147150
  • c/src/lib/libbsp/m68k/mvme136/clock/ckinit.c

    rea74482 r9700578  
    109109}
    110110
    111 void ReInstall_clock(
    112   rtems_isr_entry clock_isr
    113 )
    114 {
    115   rtems_unsigned32 isrlevel;
    116 
    117   rtems_interrupt_disable( isrlevel );
    118    (void) set_vector( clock_isr, CLOCK_VECTOR, 1 );
    119   rtems_interrupt_enable( isrlevel );
    120 }
    121 
    122111void Clock_exit( void )
    123112{
     
    158147)
    159148{
     149    rtems_unsigned32 isrlevel;
    160150    rtems_libio_ioctl_args_t *args = pargp;
    161151 
     
    174164    else if (args->command == rtems_build_name('N', 'E', 'W', ' '))
    175165    {
    176         ReInstall_clock(args->buffer);
     166      rtems_interrupt_disable( isrlevel );
     167       (void) set_vector( args->buffer, CLOCK_VECTOR, 1 );
     168      rtems_interrupt_enable( isrlevel );
    177169    }
    178170 
  • c/src/lib/libbsp/m68k/mvme136/startup/bspstart.c

    rea74482 r9700578  
    125125{
    126126  int stdin_fd, stdout_fd, stderr_fd;
    127 
     127  int error_code;
     128 
     129  error_code = 'S' << 24 | 'T' << 16;
     130 
    128131  if ((stdin_fd = __open("/dev/console", O_RDONLY, 0)) == -1)
    129     rtems_fatal_error_occurred('STD0');
     132    rtems_fatal_error_occurred( error_code | 'D' << 8 | '0' );
    130133 
    131134  if ((stdout_fd = __open("/dev/console", O_WRONLY, 0)) == -1)
    132     rtems_fatal_error_occurred('STD1');
     135    rtems_fatal_error_occurred( error_code | 'D' << 8 | '1' );
    133136 
    134137  if ((stderr_fd = __open("/dev/console", O_WRONLY, 0)) == -1)
    135     rtems_fatal_error_occurred('STD2');
     138    rtems_fatal_error_occurred( error_code | 'D' << 8 | '2' );
    136139 
    137140  if ((stdin_fd != 0) || (stdout_fd != 1) || (stderr_fd != 2))
    138     rtems_fatal_error_occurred('STIO');
     141    rtems_fatal_error_occurred( error_code | 'I' << 8 | 'O' );
    139142}
    140143
  • c/src/lib/libbsp/m68k/mvme162/clock/ckinit.c

    rea74482 r9700578  
    9090}
    9191
    92 void ReInstall_clock(rtems_isr_entry clock_isr)
    93 {
    94   rtems_unsigned32 isrlevel;
    95 
    96   rtems_interrupt_disable( isrlevel );
    97   (void) set_vector( clock_isr, CLOCK_VECTOR, 1 );
    98   rtems_interrupt_enable( isrlevel );
    99 }
    100 
    10192void Clock_exit( void )
    10293{
     
    128119)
    129120{
     121    rtems_unsigned32 isrlevel;
    130122    rtems_libio_ioctl_args_t *args = pargp;
    131123 
     
    144136    else if (args->command == rtems_build_name('N', 'E', 'W', ' '))
    145137    {
    146         ReInstall_clock(args->buffer);
     138      rtems_interrupt_disable( isrlevel );
     139       (void) set_vector( args->buffer, CLOCK_VECTOR, 1 );
     140      rtems_interrupt_enable( isrlevel );
    147141    }
    148142 
  • c/src/lib/libbsp/m68k/mvme162/startup/bspstart.c

    rea74482 r9700578  
    131131{
    132132  int stdin_fd, stdout_fd, stderr_fd;
     133  int error_code;
     134 
     135  error_code = 'S' << 24 | 'T' << 16;
    133136 
    134137  if ((stdin_fd = __open("/dev/console", O_RDONLY, 0)) == -1)
    135     rtems_fatal_error_occurred('STD0');
     138    rtems_fatal_error_occurred( error_code | 'D' << 8 | '0' );
    136139 
    137140  if ((stdout_fd = __open("/dev/console", O_WRONLY, 0)) == -1)
    138     rtems_fatal_error_occurred('STD1');
     141    rtems_fatal_error_occurred( error_code | 'D' << 8 | '1' );
    139142 
    140143  if ((stderr_fd = __open("/dev/console", O_WRONLY, 0)) == -1)
    141     rtems_fatal_error_occurred('STD2');
     144    rtems_fatal_error_occurred( error_code | 'D' << 8 | '2' );
    142145 
    143146  if ((stdin_fd != 0) || (stdout_fd != 1) || (stderr_fd != 2))
    144     rtems_fatal_error_occurred('STIO');
     147    rtems_fatal_error_occurred( error_code | 'I' << 8 | 'O' );
    145148}
    146149
  • c/src/lib/libbsp/no_cpu/no_bsp/clock/ckinit.c

    rea74482 r9700578  
    106106
    107107  if ( BSP_Configuration.ticks_per_timeslice ) {
    108     Old_ticker = ( rtems_isr_entry ) set_vector( clock_isr, CLOCK_VECTOR, 1 );
     108    Old_ticker = (rtems_isr_entry) set_vector( clock_isr, CLOCK_VECTOR, 1 );
    109109    /*
    110110     *  Hardware specific initialize goes here
     
    119119
    120120  atexit( Clock_exit );
    121 }
    122 
    123 /*
    124  *  Reinstall_clock
    125  *
    126  *  Install a clock tick handler without reprogramming the chip.  This
    127  *  is used by the polling shared memory device driver.
    128  */
    129 
    130 void ReInstall_clock(
    131   rtems_isr_entry clock_isr
    132 )
    133 {
    134   rtems_unsigned32 isrlevel = 0;
    135 
    136   /*
    137    *  Disable interrupts and install the clock ISR vector using the
    138    *  BSP dependent set_vector routine.  In the below example, the clock
    139    *  ISR is on vector 4 and is an RTEMS interrupt.
    140    */
    141 
    142   rtems_interrupt_disable( isrlevel );
    143    (void) set_vector( clock_isr, CLOCK_VECTOR, 1 );
    144   rtems_interrupt_enable( isrlevel );
    145121}
    146122
     
    189165)
    190166{
     167    rtems_unsigned32 isrlevel;
    191168    rtems_libio_ioctl_args_t *args = pargp;
    192169 
     
    205182    else if (args->command == rtems_build_name('N', 'E', 'W', ' '))
    206183    {
    207         ReInstall_clock(args->buffer);
     184      rtems_interrupt_disable( isrlevel );
     185       (void) set_vector( args->buffer, CLOCK_VECTOR, 1 );
     186      rtems_interrupt_enable( isrlevel );
    208187    }
    209188 
  • c/src/lib/libbsp/no_cpu/no_bsp/startup/bspstart.c

    rea74482 r9700578  
    132132{
    133133  int stdin_fd, stdout_fd, stderr_fd;
     134  int error_code;
     135 
     136  error_code = 'S' << 24 | 'T' << 16;
    134137 
    135138  if ((stdin_fd = __open("/dev/console", O_RDONLY, 0)) == -1)
    136     rtems_fatal_error_occurred('STD0');
     139    rtems_fatal_error_occurred( error_code | 'D' << 8 | '0' );
    137140 
    138141  if ((stdout_fd = __open("/dev/console", O_WRONLY, 0)) == -1)
    139     rtems_fatal_error_occurred('STD1');
     142    rtems_fatal_error_occurred( error_code | 'D' << 8 | '1' );
    140143 
    141144  if ((stderr_fd = __open("/dev/console", O_WRONLY, 0)) == -1)
    142     rtems_fatal_error_occurred('STD2');
     145    rtems_fatal_error_occurred( error_code | 'D' << 8 | '2' );
    143146 
    144147  if ((stdin_fd != 0) || (stdout_fd != 1) || (stderr_fd != 2))
    145     rtems_fatal_error_occurred('STIO');
     148    rtems_fatal_error_occurred( error_code | 'I' << 8 | 'O' );
    146149}
    147150
  • c/src/lib/libbsp/powerpc/papyrus/startup/bspstart.c

    rea74482 r9700578  
    150150{
    151151  int stdin_fd, stdout_fd, stderr_fd;
     152  int error_code;
     153 
     154  error_code = 'S' << 24 | 'T' << 16;
    152155 
    153156  if ((stdin_fd = __open("/dev/console", O_RDONLY, 0)) == -1)
    154     rtems_fatal_error_occurred('STD0');
     157    rtems_fatal_error_occurred( error_code | 'D' << 8 | '0' );
    155158 
    156159  if ((stdout_fd = __open("/dev/console", O_WRONLY, 0)) == -1)
    157     rtems_fatal_error_occurred('STD1');
     160    rtems_fatal_error_occurred( error_code | 'D' << 8 | '1' );
    158161 
    159162  if ((stderr_fd = __open("/dev/console", O_WRONLY, 0)) == -1)
    160     rtems_fatal_error_occurred('STD2');
     163    rtems_fatal_error_occurred( error_code | 'D' << 8 | '2' );
    161164 
    162165  if ((stdin_fd != 0) || (stdout_fd != 1) || (stderr_fd != 2))
    163     rtems_fatal_error_occurred('STIO');
     166    rtems_fatal_error_occurred( error_code | 'I' << 8 | 'O' );
    164167}
    165168
  • c/src/lib/libbsp/unix/posix/clock/clock.c

    rea74482 r9700578  
    3232rtems_device_minor_number rtems_clock_minor;
    3333
    34 void
    35 Install_clock(rtems_isr_entry clock_isr)
     34void Install_clock(rtems_isr_entry clock_isr)
    3635{
    3736    Clock_driver_ticks = 0;
    3837
    39     (void)set_vector(clock_isr, Clock_driver_vector, 1);
     38    (void) set_vector( clock_isr, Clock_driver_vector, 1 );
    4039
    4140    _CPU_Start_clock( BSP_Configuration.microseconds_per_tick );
     
    4443}
    4544
    46 void
    47 ReInstall_clock(rtems_isr_entry new_clock_isr)
    48 {
    49     rtems_unsigned32  isrlevel = 0;
    50 
    51     rtems_interrupt_disable(isrlevel);
    52     (void)set_vector(new_clock_isr, Clock_driver_vector, 1);
    53     rtems_interrupt_enable(isrlevel);
    54 }
    55 
    56 void
    57 Clock_isr(int vector)
     45void Clock_isr(int vector)
    5846{
    5947    Clock_driver_ticks++;
     
    6654 */
    6755
    68 void
    69 Clock_exit(void)
     56void Clock_exit(void)
    7057{
    7158  _CPU_Stop_clock();
    7259
    73   (void)set_vector(0, Clock_driver_vector, 1);
     60  (void) set_vector( 0, Clock_driver_vector, 1 );
    7461}
    7562
    76 rtems_device_driver
    77 Clock_initialize(
     63rtems_device_driver Clock_initialize(
    7864  rtems_device_major_number major,
    7965  rtems_device_minor_number minor,
     
    10086)
    10187{
     88    rtems_unsigned32 isrlevel;
    10289    rtems_libio_ioctl_args_t *args = pargp;
    10390
     
    116103    else if (args->command == rtems_build_name('N', 'E', 'W', ' '))
    117104    {
    118         ReInstall_clock(args->buffer);
     105      rtems_interrupt_disable( isrlevel );
     106       (void) set_vector( args->buffer, Clock_driver_vector, 1 );
     107      rtems_interrupt_enable( isrlevel );
    119108    }
    120109   
  • c/src/lib/libbsp/unix/posix/startup/bspstart.c

    rea74482 r9700578  
    183183#if 0
    184184  int stdin_fd, stdout_fd, stderr_fd;
     185  int error_code;
     186 
     187  error_code = 'S' << 24 | 'T' << 16;
    185188 
    186189  if ((stdin_fd = __open("/dev/console", O_RDONLY, 0)) == -1)
    187     rtems_fatal_error_occurred('STD0');
     190    rtems_fatal_error_occurred( error_code | 'D' << 8 | '0' );
    188191 
    189192  if ((stdout_fd = __open("/dev/console", O_WRONLY, 0)) == -1)
    190     rtems_fatal_error_occurred('STD1');
     193    rtems_fatal_error_occurred( error_code | 'D' << 8 | '1' );
    191194 
    192195  if ((stderr_fd = __open("/dev/console", O_WRONLY, 0)) == -1)
    193     rtems_fatal_error_occurred('STD2');
     196    rtems_fatal_error_occurred( error_code | 'D' << 8 | '2' );
    194197 
    195198  if ((stdin_fd != 0) || (stdout_fd != 1) || (stderr_fd != 2))
    196     rtems_fatal_error_occurred('STIO');
     199    rtems_fatal_error_occurred( error_code | 'I' << 8 | 'O' );
    197200#endif
    198201
Note: See TracChangeset for help on using the changeset viewer.