Ignore:
Timestamp:
Jun 29, 2014, 12:53:25 PM (10 years ago)
Author:
alain
Message:

Introducing two modifications regarding the locks protecting
exclusive access to BDV and TTY peripherals channels:

  • use the giet_lock_t type to have only one lock per cache line.
  • store these locks in the seg_kernel_data or in seg_kernel_uncdata, depending on the GIET_NO HARD_CC configuration parameter, to have cacheable locks when it is possible.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • soft/giet_vm/giet_drivers/tty_driver.c

    r345 r350  
    3939#endif
    4040
     41#if !defined(GIET_NO_HARD_CC)
     42# error: You must define GIET_NO_HARD_CC in the giet_config.h file
     43#endif
     44
    4145#if (NB_TTY_CHANNELS < 1)
    4246# error: NB_TTY_CHANNELS cannot be smaller than 1!
    4347#endif
    4448
     49//////////////////////////////////////////////////////////////////////////////
     50//   TTY global variables
     51//////////////////////////////////////////////////////////////////////////////
     52
    4553#define in_unckdata __attribute__((section (".unckdata")))
    4654#define in_kdata    __attribute__((section (".kdata")))
    4755
    48 //////////////////////////////////////////////////////////////////////////////
    49 //   TTY global variables
    50 //////////////////////////////////////////////////////////////////////////////
    51 
     56#if GIET_NO_HARD_CC
    5257in_unckdata volatile unsigned int _tty_rx_buf[NB_TTY_CHANNELS];
    53 
    54 in_unckdata volatile unsigned int _tty_rx_full[NB_TTY_CHANNELS]
    55     = { [0 ... NB_TTY_CHANNELS - 1] = 0 };
    56 
    57 in_unckdata unsigned int _tty_lock[NB_TTY_CHANNELS]
    58     = { [0 ... NB_TTY_CHANNELS - 1] = 0 };
     58in_unckdata volatile unsigned int _tty_rx_full[NB_TTY_CHANNELS];
     59in_unckdata giet_lock_t _tty_lock[NB_TTY_CHANNELS] __attribute__((aligned(64)));
     60#else
     61in_kdata volatile unsigned int _tty_rx_buf[NB_TTY_CHANNELS];
     62in_kdata volatile unsigned int _tty_rx_full[NB_TTY_CHANNELS];
     63in_kdata giet_lock_t _tty_lock[NB_TTY_CHANNELS] __attribute__((aligned(64)));
     64#endif
    5965
    6066//////////////////////////////////////////////////////////////////////////////
Note: See TracChangeset for help on using the changeset viewer.