Ignore:
Timestamp:
Jul 5, 2018, 3:45:43 PM (4 years ago)
Author:
alain
Message:

Fix a bug in soclib_pic driver (bad separation between IOPIC an LAPIC initialisation)

File:
1 edited

Legend:

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

    r446 r451  
    22 * soclib_tty.c - soclib tty driver implementation.
    33 *
    4  * Author  Alain Greiner (2016)
     4 * Author  Alain Greiner (2016,2017,2018)
    55 *
    66 * Copyright (c)  UPMC Sorbonne Universites
     
    2222 */
    2323
     24
     25#include <hal_kernel_types.h>
    2426#include <dev_txt.h>
    2527#include <chdev.h>
     
    123125#endif
    124126
    125 #if DEBUG_HAL_TXT_RX
    126 uint32_t rx_cycle = (uint32_t)hal_get_cycles();
    127 if( (DEBUG_HAL_TXT_RX < rx_cycle) && (type == TXT_READ) )
    128 printk("\n[DBG] %s : thread %x enter for RX / cycle %d\n",
    129 __FUNCTION__ , CURRENT_THREAD , rx_cycle );
    130 #endif
    131 
    132 #if DEBUG_HAL_TXT_TX
    133 uint32_t tx_cycle = (uint32_t)hal_get_cycles();
    134 if( (DEBUG_HAL_TXT_TX < tx_cycle) && (type == TXT_WRITE) )
    135 printk("\n[DBG] %s : thread %x enter for TX / cycle %d\n",
    136 __FUNCTION__ , CURRENT_THREAD , tx_cycle );
    137 #endif
    138 
    139127    // get TXT device cluster and pointers
    140128    xptr_t     dev_xp = (xptr_t)hal_remote_lwd( XPTR( th_cxy , &th_ptr->txt_cmd.dev_xp ) );
     
    165153                byte = hal_remote_lb( buf_xp + done );
    166154
     155#if DEBUG_HAL_TXT_TX
     156uint32_t tx_cycle = (uint32_t)hal_get_cycles();
     157if( DEBUG_HAL_TXT_TX < tx_cycle )
     158printk("\n[DBG] %s : thread %x put character <%c> to TXT%d_TX fifo / cycle %d\n",
     159__FUNCTION__, CURRENT_THREAD, byte, channel, tx_cycle );
     160#endif
    167161                // write byte to FIFO
    168162                fifo->data[fifo->ptw] = byte;
     
    208202                char byte = fifo->data[fifo->ptr];
    209203
     204#if DEBUG_HAL_TXT_RX
     205uint32_t rx_cycle = (uint32_t)hal_get_cycles();
     206if( DEBUG_HAL_TXT_RX < rx_cycle )
     207printk("\n[DBG] %s : thread %x get character <%c> from TXT%d_RX fifo / cycle %d\n",
     208__FUNCTION__, CURRENT_THREAD, byte, channel, rx_cycle );
     209#endif
    210210                // update FIFO state
    211211                fifo->ptr = (fifo->ptr + 1) % TTY_FIFO_DEPTH;
     
    235235        assert( false , __FUNCTION__ , "illegal TXT command\n" );
    236236    }
    237 
    238 #if DEBUG_HAL_TXT_RX
    239 rx_cycle = (uint32_t)hal_get_cycles();
    240 if( (DEBUG_HAL_TXT_RX < rx_cycle) && (type == TXT_READ) )
    241 printk("\n[DBG] %s : thread %x exit after RX / cycle %d\n",
    242 __FUNCTION__ , CURRENT_THREAD , rx_cycle );
    243 #endif
    244 
    245 #if DEBUG_HAL_TXT_TX
    246 tx_cycle = (uint32_t)hal_get_cycles();
    247 if( (DEBUG_HAL_TXT_TX < tx_cycle) && (type == TXT_WRITE) )
    248 printk("\n[DBG] %s : thread %x exit after TX / cycle %d\n",
    249 __FUNCTION__ , CURRENT_THREAD , tx_cycle );
    250 #endif
    251237
    252238#if (DEBUG_SYS_READ & 1)
     
    453439#if DEBUG_HAL_TXT_RX
    454440if( DEBUG_HAL_TXT_RX < rx_cycle )
    455 printk("\n[DBG] %s : read character %c from TXT%d\n", __FUNCTION__, byte, channel );
     441printk("\n[DBG] %s : put character <%c> to TXT%d_RX fifo\n",
     442__FUNCTION__, byte, channel );
    456443#endif
    457444                // store byte into FIFO
     
    496483#if DEBUG_HAL_TXT_TX
    497484if( DEBUG_HAL_TXT_TX < tx_cycle )
    498 printk("\n[DBG] %s : write character %c to TXT%d\n", __FUNCTION__, byte, channel );
     485printk("\n[DBG] %s : get character <%c> from TXT%d_TX fifo\n",
     486__FUNCTION__, byte, channel );
    499487#endif
    500488                // update TX_FIFO state
Note: See TracChangeset for help on using the changeset viewer.