Ignore:
Timestamp:
Apr 20, 2001, 1:24:39 PM (21 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, 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.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.