Ignore:
Timestamp:
Sep 21, 2018, 10:20:35 PM (6 years ago)
Author:
nicolas.van.phan@…
Message:

Add mtty driver.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/hal/tsar_mips32/drivers/soclib_mtty.c

    r533 r534  
    5353
    5454__attribute__((section(".kdata")))
    55 tty_fifo_t  tty_rx_fifo[CONFIG_MAX_TXT_CHANNELS];
     55mtty_fifo_t  mtty_rx_fifo[CONFIG_MAX_TXT_CHANNELS];
    5656
    5757__attribute__((section(".kdata")))
    58 tty_fifo_t  tty_tx_fifo[CONFIG_MAX_TXT_CHANNELS];
     58mtty_fifo_t  mtty_tx_fifo[CONFIG_MAX_TXT_CHANNELS];
    5959
    6060///////////////////////////////////////
     
    8484    if( is_rx )
    8585    {
    86         tty_rx_fifo[channel].sts = 0;
    87         tty_rx_fifo[channel].ptr = 0;
    88         tty_rx_fifo[channel].ptw = 0;
     86        mtty_rx_fifo[channel].sts = 0;
     87        mtty_rx_fifo[channel].ptr = 0;
     88        mtty_rx_fifo[channel].ptw = 0;
    8989    }
    9090    else
    9191    {
    92         tty_tx_fifo[channel].sts = 0;
    93         tty_tx_fifo[channel].ptr = 0;
    94         tty_tx_fifo[channel].ptw = 0;
     92        mtty_tx_fifo[channel].sts = 0;
     93        mtty_tx_fifo[channel].ptr = 0;
     94        mtty_tx_fifo[channel].ptw = 0;
    9595    }
    9696}  // end soclib_mtty_init()
     
    9999void __attribute__ ((noinline)) soclib_mtty_cmd( xptr_t th_xp )
    100100{
    101     tty_fifo_t * fifo;     // MTTY_RX or MTTY_TX FIFO
     101    mtty_fifo_t * fifo;     // MTTY_RX or MTTY_TX FIFO
    102102    char         byte;     // byte value
    103103    uint32_t     done;     // number of bytes moved
     
    138138    if( type == TXT_WRITE )         // write bytes to MTTY_TX FIFO
    139139    {
    140         fifo = &tty_tx_fifo[channel];
     140        fifo = &mtty_tx_fifo[channel];
    141141
    142142        done = 0;
     
    190190    else if( type == TXT_READ )       // read bytes from MTTY_RX FIFO   
    191191    {
    192         fifo = &tty_rx_fifo[channel];
     192        fifo = &mtty_rx_fifo[channel];
    193193
    194194        done = 0;
     
    257257    process_t  * owner_ptr;         // local pointer on TXT owner process
    258258    pid_t        owner_pid;         // TXT owner process identifier
    259     tty_fifo_t * fifo;              // pointer on MTTY_TX or MTTY_RX FIFO
     259    mtty_fifo_t * fifo;              // pointer on MTTY_TX or MTTY_RX FIFO
    260260    cxy_t        tty_cxy;           // soclib_mtty cluster
    261261    uint32_t   * tty_ptr;           // soclib_mtty segment base address
     
    308308    if( is_rx )
    309309    {
    310         fifo = &tty_rx_fifo[channel];
     310        fifo = &mtty_rx_fifo[channel];
    311311
    312312        // try to move bytes until MTTY_READ register empty
     
    469469    else
    470470    {
    471         fifo = &tty_tx_fifo[channel];
     471        fifo = &mtty_tx_fifo[channel];
    472472
    473473        // try to move bytes until TX_FIFO empty
Note: See TracChangeset for help on using the changeset viewer.