Changeset 674 for trunk/kernel/devices/dev_txt.c
- Timestamp:
- Nov 20, 2020, 12:04:01 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/devices/dev_txt.c
r663 r674 74 74 bool_t is_rx = txt->is_rx; 75 75 76 assert( (pic_xp != XPTR_NULL) || (channel == 0) ,76 assert( __FUNCTION__, ((pic_xp != XPTR_NULL) || (channel == 0)) , 77 77 "PIC not initialised before TXT" ); 78 78 79 79 // set chdev name 80 if( is_rx ) snprint f( txt->name , 16 , "txt%d_rx" , channel );81 else snprint f( txt->name , 16 , "txt%d_tx" , channel );80 if( is_rx ) snprintk( txt->name , 16 , "txt%d_rx" , channel ); 81 else snprintk( txt->name , 16 , "txt%d_tx" , channel ); 82 82 83 83 // set TXT chdev extension … … 120 120 lid ); 121 121 122 assert( (error == 0) , "cannot create server thread" );122 assert( __FUNCTION__, (error == 0) , "cannot create server thread" ); 123 123 124 124 // set "server" field in chdev descriptor … … 154 154 155 155 // check channel argument 156 assert( (channel < CONFIG_MAX_TXT_CHANNELS) , "illegal channel index" );156 assert( __FUNCTION__, (channel < CONFIG_MAX_TXT_CHANNELS) , "illegal channel index" ); 157 157 158 158 // get pointers on chdev … … 162 162 163 163 // check dev_xp 164 assert( (dev_xp != XPTR_NULL) , "undefined TXT chdev descriptor" );164 assert( __FUNCTION__, (dev_xp != XPTR_NULL) , "undefined TXT chdev descriptor" ); 165 165 166 166 // If we use MTTY (vci_multi_tty), we do a synchronous write on TXT[0] … … 243 243 244 244 // check channel argument 245 assert( (channel < CONFIG_MAX_TXT_CHANNELS) , "illegal channel index" );245 assert( __FUNCTION__, (channel < CONFIG_MAX_TXT_CHANNELS) , "illegal channel index" ); 246 246 247 247 // get pointers on chdev … … 249 249 250 250 // check dev_xp 251 assert( (dev_xp != XPTR_NULL) , "undefined TXT chdev descriptor" );251 assert( __FUNCTION__, (dev_xp != XPTR_NULL) , "undefined TXT chdev descriptor" ); 252 252 253 253 // register command in calling thread descriptor … … 290 290 uint32_t count ) 291 291 { 292 // get extended pointer on TXT[0] chdev 293 xptr_t dev_xp = chdev_dir.txt_tx[0]; 294 295 assert( (dev_xp != XPTR_NULL) , 296 "undefined TXT0 chdev descriptor" ); 297 298 // get TXTO chdev cluster and local pointer 299 cxy_t dev_cxy = GET_CXY( dev_xp ); 292 // get extended pointers on TXT[0] chdev 293 xptr_t dev_xp = chdev_dir.txt_tx[0]; 294 cxy_t dev_cxy = GET_CXY( dev_xp ); 300 295 chdev_t * dev_ptr = GET_PTR( dev_xp ); 301 296 302 // get driver command function 303 dev_aux_t * aux = (dev_aux_t *)hal_remote_lpt( XPTR( dev_cxy , &dev_ptr->aux ) ); 304 305 // build arguments structure 306 txt_sync_args_t args; 307 args.dev_xp = dev_xp; 308 args.buffer = buffer; 309 args.count = count; 310 args.channel = 0; 311 312 // call driver function 313 aux( &args ); 314 315 return 0; 316 } 317 297 if( dev_xp != XPTR_NULL) 298 { 299 // get driver command function 300 dev_aux_t * aux = (dev_aux_t *)hal_remote_lpt( XPTR( dev_cxy , &dev_ptr->aux ) ); 301 302 // build arguments structure 303 txt_sync_args_t args; 304 args.dev_xp = dev_xp; 305 args.buffer = buffer; 306 args.count = count; 307 args.channel = 0; 308 309 // call driver function 310 aux( &args ); 311 312 return 0; 313 } 314 else 315 { 316 return -1; 317 } 318 } // end dev_txt_sync_write() 319
Note: See TracChangeset
for help on using the changeset viewer.