Changeset 451 for trunk/hal/tsar_mips32/drivers/soclib_tty.c
- Timestamp:
- Jul 5, 2018, 3:45:43 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/hal/tsar_mips32/drivers/soclib_tty.c
r446 r451 2 2 * soclib_tty.c - soclib tty driver implementation. 3 3 * 4 * Author Alain Greiner (2016 )4 * Author Alain Greiner (2016,2017,2018) 5 5 * 6 6 * Copyright (c) UPMC Sorbonne Universites … … 22 22 */ 23 23 24 25 #include <hal_kernel_types.h> 24 26 #include <dev_txt.h> 25 27 #include <chdev.h> … … 123 125 #endif 124 126 125 #if DEBUG_HAL_TXT_RX126 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 #endif131 132 #if DEBUG_HAL_TXT_TX133 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 #endif138 139 127 // get TXT device cluster and pointers 140 128 xptr_t dev_xp = (xptr_t)hal_remote_lwd( XPTR( th_cxy , &th_ptr->txt_cmd.dev_xp ) ); … … 165 153 byte = hal_remote_lb( buf_xp + done ); 166 154 155 #if DEBUG_HAL_TXT_TX 156 uint32_t tx_cycle = (uint32_t)hal_get_cycles(); 157 if( DEBUG_HAL_TXT_TX < tx_cycle ) 158 printk("\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 167 161 // write byte to FIFO 168 162 fifo->data[fifo->ptw] = byte; … … 208 202 char byte = fifo->data[fifo->ptr]; 209 203 204 #if DEBUG_HAL_TXT_RX 205 uint32_t rx_cycle = (uint32_t)hal_get_cycles(); 206 if( DEBUG_HAL_TXT_RX < rx_cycle ) 207 printk("\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 210 210 // update FIFO state 211 211 fifo->ptr = (fifo->ptr + 1) % TTY_FIFO_DEPTH; … … 235 235 assert( false , __FUNCTION__ , "illegal TXT command\n" ); 236 236 } 237 238 #if DEBUG_HAL_TXT_RX239 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 #endif244 245 #if DEBUG_HAL_TXT_TX246 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 #endif251 237 252 238 #if (DEBUG_SYS_READ & 1) … … 453 439 #if DEBUG_HAL_TXT_RX 454 440 if( DEBUG_HAL_TXT_RX < rx_cycle ) 455 printk("\n[DBG] %s : read character %c from TXT%d\n", __FUNCTION__, byte, channel ); 441 printk("\n[DBG] %s : put character <%c> to TXT%d_RX fifo\n", 442 __FUNCTION__, byte, channel ); 456 443 #endif 457 444 // store byte into FIFO … … 496 483 #if DEBUG_HAL_TXT_TX 497 484 if( DEBUG_HAL_TXT_TX < tx_cycle ) 498 printk("\n[DBG] %s : write character %c to TXT%d\n", __FUNCTION__, byte, channel ); 485 printk("\n[DBG] %s : get character <%c> from TXT%d_TX fifo\n", 486 __FUNCTION__, byte, channel ); 499 487 #endif 500 488 // update TX_FIFO state
Note: See TracChangeset
for help on using the changeset viewer.