Ignore:
Timestamp:
Jun 10, 2014, 12:33:23 PM (10 years ago)
Author:
alain
Message:

All drivers have been modified to use only the information
contained in the hard_config.h file

File:
1 edited

Legend:

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

    r313 r320  
    4242// An error code is returned if these conditions are not verified.
    4343//
    44 // The "seg_ioc_base" must be defined in giet_vsegs.ld file.
     44// The SEG_IOC_BASE address must be defined in the hard_config.h file.
    4545///////////////////////////////////////////////////////////////////////////////////
    4646// Implementation notes:
     
    5555
    5656#include <giet_config.h>
     57#include <hard_config.h>
    5758#include <bdv_driver.h>
    5859#include <xcu_driver.h>
     
    7778unsigned int _bdv_get_register( unsigned int index )
    7879{
    79     unsigned int* vaddr = (unsigned int*)&seg_ioc_base + index;
     80    unsigned int* vaddr = (unsigned int*)SEG_IOC_BASE + index;
    8081    return _io_extended_read( vaddr );
    8182}
     
    8788                        unsigned int value )
    8889{
    89     unsigned int* vaddr = (unsigned int*)&seg_ioc_base + index;
     90    unsigned int* vaddr = (unsigned int*)SEG_IOC_BASE + index;
    9091    _io_extended_write( vaddr, value );
    9192}
     
    185186        _it_disable( &save_sr );
    186187       
     188
    187189        // set _bdv_gtid and reset runnable
    188190        _bdv_gtid = (gpid<<16) + ltid;
     
    300302               unsigned int channel )   // unused
    301303{
    302     unsigned int procid     = _get_procid();
    303     unsigned int cluster_xy = procid / NB_PROCS_MAX;
    304     unsigned int lpid       = procid % NB_PROCS_MAX;
    305 
    306304    // get BDV status (and reset IRQ)
    307305    unsigned int status =  _bdv_get_register( BLOCK_DEVICE_STATUS );
     
    311309         (status == BLOCK_DEVICE_BUSY) )   return;
    312310 
    313     // reset WTI in XCU if WTI type
    314     if ( irq_type == IRQ_TYPE_WTI )
    315     {
    316         unsigned int value;
    317         _xcu_get_wti_value( cluster_xy, irq_id, &value );
    318     }
    319    
    320311    // save status in kernel buffer _bdv_status
    321312    _bdv_status = status;
    322313
    323314    // identify task waiting on BDV
    324     unsigned int rprocid    = _bdv_gtid>>16;
    325     unsigned int ltid       = _bdv_gtid & 0xFFFF;
    326     unsigned int remote_xy  = rprocid / NB_PROCS_MAX;
     315    unsigned int rprocid     = _bdv_gtid>>16;
     316    unsigned int ltid        = _bdv_gtid & 0xFFFF;
     317    unsigned int remote_xy   = rprocid / NB_PROCS_MAX;
     318    unsigned int remote_lpid = rprocid % NB_PROCS_MAX;
    327319
    328320    // re-activates sleeping task
     
    333325
    334326    // requires a context switch for remote processor running the waiting task
    335     _xcu_send_wti( remote_xy,    // cluster index
    336                    lpid,         // local processor index
     327    _xcu_send_wti( remote_xy,    // remote cluster index
     328                   remote_lpid,  // remote local processor index
    337329                   0 );          // don't force context switch if not idle
    338330
    339331#if GIET_DEBUG_IRQS  // we don't take the TTY lock to avoid deadlock
     332unsigned int procid     = _get_procid();
     333unsigned int cluster_xy = procid / NB_PROCS_MAX;
     334unsigned int lpid       = procid % NB_PROCS_MAX;
    340335unsigned int x              = cluster_xy >> Y_WIDTH;
    341336unsigned int y              = cluster_xy & ((1<<Y_WIDTH)-1);
    342337unsigned int rx             = remote_xy >> Y_WIDTH;
    343338unsigned int ry             = remote_xy & ((1<<Y_WIDTH)-1);
    344 unsigned int rlpid          = rprocid % NB_PROCS_MAX;
    345339_puts("\n[IRQS DEBUG] Processor[");
    346340_putd(x );
     
    358352_putd(ry );
    359353_puts(",");
    360 _putd(rlpid );
     354_putd(remote_lpid );
    361355_puts(" / bdv status = ");
    362356_putx(_bdv_status );
Note: See TracChangeset for help on using the changeset viewer.