Changeset 279 for soft


Ignore:
Timestamp:
Jan 26, 2014, 11:29:15 AM (11 years ago)
Author:
cfuguet
Message:

Modifications in the ioc_driver:

  • Introducing uniform interface to access block device controller. All drivers for new disk controllers must respect the interface specified in the ioc_driver header file.
Location:
soft/giet_vm
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • soft/giet_vm/giet_drivers/ioc_driver.c

    r275 r279  
    315315        else             ioc_address[BLOCK_DEVICE_OP] = BLOCK_DEVICE_READ;
    316316
    317         unsigned int status = _ioc_get_status();
     317        unsigned int status;
     318        if ( _ioc_get_status(0, &status) ) return 1;
     319
    318320        while( (status != BLOCK_DEVICE_READ_SUCCESS)  &&
    319321               (status != BLOCK_DEVICE_READ_ERROR)    &&
     
    321323               (status != BLOCK_DEVICE_WRITE_ERROR) )
    322324        {
    323             status = _ioc_get_status();
     325            if ( _ioc_get_status(0, &status) ) return 1;
    324326
    325327#if GIET_DEBUG_IOC_DRIVER
     
    392394unsigned int _ioc_init()
    393395{
    394     unsigned int * ioc_address = (unsigned int *) &seg_ioc_base ;
     396    volatile unsigned int * ioc_address = (unsigned int *) &seg_ioc_base ;
    395397   
    396398    if ( ioc_address[BLOCK_DEVICE_BLOCK_SIZE] != 512 )
     
    448450///////////////////////////////////////////////////////////////////////////////
    449451//     _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///////////////////////////////////////////////////////////////////////////////
     456unsigned 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
    455468    // 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;
    459473}
    460474
     
    466480{
    467481    // 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;
    469483   
    470484    return  ioc_address[BLOCK_DEVICE_BLOCK_SIZE];
  • soft/giet_vm/giet_drivers/ioc_driver.h

    r258 r279  
    7171                                unsigned int count );
    7272
    73 extern unsigned int _ioc_get_status();
     73extern unsigned int _ioc_get_status( unsigned int  channel,
     74                                     unsigned int* status );
    7475
    7576extern unsigned int _ioc_get_block_size();
  • soft/giet_vm/giet_kernel/irq_handler.c

    r263 r279  
    151151{
    152152    // save status in _ioc_status variable and reset IRQ
    153     _ioc_status = _ioc_get_status();
     153    if ( _ioc_get_status(0, &_ioc_status) ) return;
    154154
    155155    // reactivate task waiting on IOC
Note: See TracChangeset for help on using the changeset viewer.