Changeset b85df34 in rtems


Ignore:
Timestamp:
Apr 20, 2001, 1:24:39 PM (19 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, master
Children:
53462762
Parents:
b335c503
Message:

2001-04-20 Joel Sherrill <joel@…>

  • mongoosev/duart/mg5uart.c (mg5uart_enable_interrupts): Honor the other bits set in the Peripheral Function Interrupt Mask Register when modifying those enabled for the DUART.
  • mongoosev/include/mongoose-v.h (MONGOOSEV_ATOMIC_MASK, MONGOOSEV_PFICR, MONGOOSEV_PFIMR, mongoosev_set_in_pficr, mongoosev_clear_in_pficr, mongoosev_set_in_pfimr, mongoosev_clear_in_pfimr, MONGOOSEV_UART_ALL_IRQ_BITS): New macros.
Location:
c/src/lib/libcpu/mips
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libcpu/mips/ChangeLog

    rb335c503 rb85df34  
     12001-04-20      Joel Sherrill <joel@OARcorp.com>
     2
     3        * mongoosev/duart/mg5uart.c (mg5uart_enable_interrupts): Honor
     4        the other bits set in the Peripheral Function Interrupt Mask
     5        Register when modifying those enabled for the DUART.
     6        * mongoosev/include/mongoose-v.h (MONGOOSEV_ATOMIC_MASK,
     7        MONGOOSEV_PFICR, MONGOOSEV_PFIMR, mongoosev_set_in_pficr,
     8        mongoosev_clear_in_pficr, mongoosev_set_in_pfimr,
     9        mongoosev_clear_in_pfimr, MONGOOSEV_UART_ALL_IRQ_BITS): New macros.
     10
    1112001-04-16      Joel Sherrill <joel@OARcorp.com>
    212
  • c/src/lib/libcpu/mips/mongoosev/duart/mg5uart.c

    rb335c503 rb85df34  
    729729{
    730730  unsigned32            pMG5UART;
    731   unsigned int          shift;
     731  unsigned32            shifted_mask;
     732  unsigned32            shifted_bits;
    732733
    733734  pMG5UART = Console_Port_Tbl[minor].ulCtrlPort1;
     
    737738   */
    738739
    739   if ( Console_Port_Tbl[minor].ulDataPort == MG5UART_UART0 )
    740     shift = MONGOOSEV_UART0_IRQ_SHIFT;
    741   else
    742     shift = MONGOOSEV_UART1_IRQ_SHIFT;
    743 
    744   MG5UART_SETREG(
    745      pMG5UART,
    746      MG5UART_INTERRUPT_MASK_REGISTER,
    747      mask << shift
     740  shifted_bits = MONGOOSEV_UART_ALL_IRQ_BITS;
     741  shifted_mask = mask;
     742
     743  if ( Console_Port_Tbl[minor].ulDataPort == MG5UART_UART0 ) {
     744    shifted_bits <<= MONGOOSEV_UART0_IRQ_SHIFT;
     745    shifted_mask <<= MONGOOSEV_UART0_IRQ_SHIFT;
     746  } else {
     747    shifted_bits <<= MONGOOSEV_UART1_IRQ_SHIFT;
     748    shifted_mask <<= MONGOOSEV_UART1_IRQ_SHIFT;
     749  }
     750
     751  MONGOOSEV_ATOMIC_MASK(
     752    MONGOOSEV_PERIPHERAL_FUNCTION_INTERRUPT_MASK_REGISTER,
     753    shifted_bits,
     754    shifted_mask
    748755  );
    749756}
  • c/src/lib/libcpu/mips/mongoosev/include/mongoose-v.h

    rb335c503 rb85df34  
    3030#define MONGOOSEV_WRITE_REGISTER( _base, _register, _value ) \
    3131  *((volatile unsigned32 *)((_base) + (_register))) = (_value)
     32
     33#define MONGOOSEV_ATOMIC_MASK( _addr, _mask, _new ) \
     34  do { \
     35    rtems_interrupt_level  Irql; \
     36    rtems_unsigned32       tmp; \
     37    \
     38    rtems_interrupt_disable(Irql); \
     39      tmp = *((volatile unsigned32 *)(_addr)) & ~(_mask); \
     40      *((volatile unsigned32 *)(_addr)) = tmp | (_new); \
     41    rtems_interrupt_enable(Irql); \
     42  } while (0)
    3243
    3344/*
     
    5061#define MONGOOSEV_PERIPHERAL_FUNCTION_INTERRUPT_CAUSE_REGISTER  0xFFFE0188
    5162#define MONGOOSEV_PERIPHERAL_FUNCTION_INTERRUPT_MASK_REGISTER   0xFFFE018C
     63
     64#define MONGOOSEV_PFICR MONGOOSEV_PERIPHERAL_FUNCTION_INTERRUPT_CAUSE_REGISTER
     65#define MONGOOSEV_PFIMR MONGOOSEV_PERIPHERAL_FUNCTION_INTERRUPT_MASK_REGISTER
     66
     67#define mongoosev_set_in_pficr( _mask, _bits ) \
     68  MONGOOSEV_ATOMIC_MASK( MONGOOSEV_PFICR, _mask, _bits )
     69#define mongoosev_clear_in_pficr( _mask, _bits ) \
     70  MONGOOSEV_ATOMIC_MASK( MONGOOSEV_PFICR, _mask, ~(_bits) )
     71
     72#define mongoosev_set_in_pfimr( _mask, _bits ) \
     73  MONGOOSEV_ATOMIC_MASK( MONGOOSEV_PFIMR, _mask, _bits )
     74#define mongoosev_clear_in_pfimr( _mask, _bits ) \
     75  MONGOOSEV_ATOMIC_MASK( MONGOOSEV_PFIMR, _mask, ~(_bits) )
    5276
    5377/* UART Bits in Peripheral Command Register Bits (TX/RX tied together here) */
     
    108132#define MONGOOSEV_UART_ALL_RX_STATUS_BITS          0x0003
    109133#define MONGOOSEV_UART_ALL_STATUS_BITS             0x001F
     134#define MONGOOSEV_UART_ALL_IRQ_BITS                0x001F
    110135
    111136/*
Note: See TracChangeset for help on using the changeset viewer.