Changeset 279 for soft/giet_vm/giet_drivers
- Timestamp:
- Jan 26, 2014, 11:29:15 AM (11 years ago)
- Location:
- soft/giet_vm/giet_drivers
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/giet_drivers/ioc_driver.c
r275 r279 315 315 else ioc_address[BLOCK_DEVICE_OP] = BLOCK_DEVICE_READ; 316 316 317 unsigned int status = _ioc_get_status(); 317 unsigned int status; 318 if ( _ioc_get_status(0, &status) ) return 1; 319 318 320 while( (status != BLOCK_DEVICE_READ_SUCCESS) && 319 321 (status != BLOCK_DEVICE_READ_ERROR) && … … 321 323 (status != BLOCK_DEVICE_WRITE_ERROR) ) 322 324 { 323 status = _ioc_get_status();325 if ( _ioc_get_status(0, &status) ) return 1; 324 326 325 327 #if GIET_DEBUG_IOC_DRIVER … … 392 394 unsigned int _ioc_init() 393 395 { 394 unsigned int * ioc_address = (unsigned int *) &seg_ioc_base ;396 volatile unsigned int * ioc_address = (unsigned int *) &seg_ioc_base ; 395 397 396 398 if ( ioc_address[BLOCK_DEVICE_BLOCK_SIZE] != 512 ) … … 448 450 /////////////////////////////////////////////////////////////////////////////// 449 451 // _ioc_get_status() 450 // This function returns the transfert status, and acknowledge the IRQ 451 // if the IOC controler is not busy. 452 /////////////////////////////////////////////////////////////////////////////// 453 unsigned int _ioc_get_status() 454 { 452 // This function returns in the status variable, the transfert status, and 453 // acknowledge the IRQ if the IOC controler is not busy. 454 // Returns 0 if success, > 0 if error 455 /////////////////////////////////////////////////////////////////////////////// 456 unsigned int _ioc_get_status( unsigned int channel, 457 unsigned int* status ) 458 { 459 if ( channel != 0 ) 460 { 461 _tty_get_lock( 0 ); 462 _puts("\n[GIET ERROR] in _ioc_get_status : illegal channel\n"); 463 _tty_release_lock( 0 ); 464 465 return 1; 466 } 467 455 468 // get IOC base address 456 unsigned int * ioc_address = (unsigned int *) &seg_ioc_base; 457 458 return ioc_address[BLOCK_DEVICE_STATUS]; 469 volatile unsigned int * ioc_address = (unsigned int *) &seg_ioc_base; 470 *status = ioc_address[BLOCK_DEVICE_STATUS]; 471 472 return 0; 459 473 } 460 474 … … 466 480 { 467 481 // get IOC base address 468 unsigned int * ioc_address = (unsigned int *) &seg_ioc_base;482 volatile unsigned int * ioc_address = (unsigned int *) &seg_ioc_base; 469 483 470 484 return ioc_address[BLOCK_DEVICE_BLOCK_SIZE]; -
soft/giet_vm/giet_drivers/ioc_driver.h
r258 r279 71 71 unsigned int count ); 72 72 73 extern unsigned int _ioc_get_status(); 73 extern unsigned int _ioc_get_status( unsigned int channel, 74 unsigned int* status ); 74 75 75 76 extern unsigned int _ioc_get_block_size();
Note: See TracChangeset
for help on using the changeset viewer.