Changeset bd51a63 in rtems


Ignore:
Timestamp:
Sep 12, 2007, 3:16:00 PM (12 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, master
Children:
c83c325
Parents:
f3343c6e
Message:

2007-09-12 Joel Sherrill <joel.sherrill@…>

PR 1257/bsps

  • console/inch.c, console/keyboard.c, console/pc_keyb.c, console/vt.c: Code outside of cpukit should use the public API for rtems_interrupt_disable/rtems_interrupt_enable. By bypassing the public API and directly accessing _CPU_ISR_Disable and _CPU_ISR_Enable, they were bypassing the compiler memory barrier directive which could lead to problems. This patch also changes the type of the variable passed into these routines and addresses minor style issues.
Location:
c/src/lib/libbsp/i386/pc386
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/i386/pc386/ChangeLog

    rf3343c6e rbd51a63  
     12007-09-12      Joel Sherrill <joel.sherrill@OARcorp.com>
     2
     3        PR 1257/bsps
     4        * console/inch.c, console/keyboard.c, console/pc_keyb.c, console/vt.c:
     5        Code outside of cpukit should use the public API for
     6        rtems_interrupt_disable/rtems_interrupt_enable. By bypassing the
     7        public API and directly accessing _CPU_ISR_Disable and
     8        _CPU_ISR_Enable, they were bypassing the compiler memory barrier
     9        directive which could lead to problems. This patch also changes the
     10        type of the variable passed into these routines and addresses minor
     11        style issues.
     12
    1132007-09-10      Joel Sherrill <joel.sherrill@OARcorp.com>
    214
  • c/src/lib/libbsp/i386/pc386/console/inch.c

    rf3343c6e rbd51a63  
    274274int rtems_kbpoll( void )
    275275{
    276   int rc,level;
    277 
    278   _CPU_ISR_Disable(level);
     276  int                    rc;
     277  rtems_interrupt_level level;
     278
     279  rtems_interrupt_disable(level);
    279280
    280281  rc = ( kbd_first != kbd_last ) ? TRUE : FALSE;
    281282
    282   _CPU_ISR_Enable (level);
     283  rtems_interrupt_enable(level);
    283284
    284285  return rc;
  • c/src/lib/libbsp/i386/pc386/console/keyboard.c

    rf3343c6e rbd51a63  
    3535int set_bit(int nr, unsigned long * addr)
    3636{
    37   int  mask, retval,level;
     37  int                   mask;
     38  int                   retval;
     39  rtems_interrupt_level level;
    3840
    3941  addr += nr >> 5;
    4042  mask = 1 << (nr & 0x1f);
    41   _CPU_ISR_Disable(level)
    42   retval = (mask & *addr) != 0;
    43   *addr |= mask;
    44   _CPU_ISR_Enable (level);
     43  rtems_interrupt_disable(level);
     44    retval = (mask & *addr) != 0;
     45    *addr |= mask;
     46  rtems_interrupt_enable(level);
    4547  return retval;
    4648}
     
    4850int clear_bit(int nr, unsigned long * addr)
    4951{
    50   int  mask, retval,level;
     52  int                   mask;
     53  int                   retval;
     54  rtems_interrupt_level level;
    5155
    5256  addr += nr >> 5;
    5357  mask = 1 << (nr & 0x1f);
    54   _CPU_ISR_Disable(level)
    55   retval = (mask & *addr) != 0;
    56   *addr &= ~mask;
    57   _CPU_ISR_Enable (level);
     58  rtems_interrupt_disable(level);
     59    retval = (mask & *addr) != 0;
     60    *addr &= ~mask;
     61  rtems_interrupt_enable(level);
    5862  return retval;
    5963}
  • c/src/lib/libbsp/i386/pc386/console/pc_keyb.c

    rf3343c6e rbd51a63  
    632632char BSP_wait_polled_input( void )
    633633{
    634   int c,level;
    635 
    636   _CPU_ISR_Disable(level);
     634  int                   c;
     635  rtems_interrupt_level level;
     636
     637  rtems_interrupt_disable(level);
    637638  while ( ( c= kbd_wait_for_input() ) < 0 )
    638639      continue;
    639   _CPU_ISR_Enable (level);
     640  rtems_interrupt_enable(level);
    640641  return c;
    641642}
  • c/src/lib/libbsp/i386/pc386/console/vt.c

    rf3343c6e rbd51a63  
    6969_kd_mksound(unsigned int hz, unsigned int ticks)
    7070{
    71   unsigned int count = 0;
    72   int level;
     71  unsigned int          count = 0;
     72  rtems_interrupt_level level;
    7373
    7474  if (hz > 20 && hz < 32767)
    7575    count = 1193180 / hz;
    7676
    77    _CPU_ISR_Disable(level);
     77   rtems_interrupt_disable(level);
    7878/*  del_timer(&sound_timer);  */
    7979  if (count) {
     
    9595    kd_nosound(0);
    9696
    97    _CPU_ISR_Enable (level);
     97   rtems_interrupt_enable(level);
    9898  return;
    9999}
Note: See TracChangeset for help on using the changeset viewer.