Changeset 615


Ignore:
Timestamp:
Jan 15, 2019, 2:02:18 PM (6 years ago)
Author:
alain
Message:

introduce a SYNC_WRITE command in soclib_bdv driver cmd() function.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/hal/tsar_mips32/drivers/soclib_bdv.c

    r610 r615  
    111111
    112112    // select operation
    113     if( cmd_type == IOC_WRITE ) op = BDV_OP_WRITE;
    114     else                        op = BDV_OP_READ;
     113    if( (cmd_type == IOC_READ) || (cmd_type == IOC_SYNC_READ) ) op = BDV_OP_READ;
     114    else                                                        op = BDV_OP_WRITE;
    115115
    116116    // set SOCLIB_BDV registers to configure the I/O operation
     
    125125    //   that blocks and deschedules after launching the I/O transfer.
    126126    //   The I/O operation status is reported in the command by the ISR.
    127     // - for IOC_SYNC_READ command, this function is called by the client thread
    128     //   that polls the BDV status register until I/O transfer completion.
    129 
    130     if( cmd_type == IOC_SYNC_READ )                   // status polling policy
     127    // - for IOC_SYNC_READ / IOC_SYNC_WRITE command, this function is called by the client
     128    //   thread that polls the BDV status register until I/O transfer completion.
     129
     130    if( (cmd_type == IOC_SYNC_READ) || (cmd_type == IOC_SYNC_WRITE) )  // polling policy
    131131    {
    132132        // launch I/O operation on BDV device
     
    138138            status = hal_remote_l32( XPTR( seg_cxy , seg_ptr + BDV_STATUS_REG ) );
    139139
    140             if( status == BDV_READ_SUCCESS ) // successfully completed
     140            if( (status == BDV_READ_SUCCESS) ||
     141                (status == BDV_WRITE_SUCCESS) ) // successfully completed
    141142            {
    142143                hal_remote_s32( XPTR( th_cxy , &th_ptr->ioc_cmd.error ) , 0 );
     
    154155        }
    155156    }
    156     else                                            // descheduling + IRQ policy
     157    else                                                     // descheduling + IRQ policy
    157158    {
    158159        // enter critical section to atomically
Note: See TracChangeset for help on using the changeset viewer.