Ignore:
Timestamp:
Jan 13, 2021, 12:36:17 AM (3 years ago)
Author:
alain
Message:

All modifications required to support the <tcp_chat> application
including error recovery in case of packet loss.A

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kernel/libk/remote_fifo.c

    r657 r683  
    4242        fifo->wr_id     = 0;
    4343        fifo->rd_id     = 0;
    44     for( slot = 0 ; slot < CONFIG_REMOTE_FIFO_SLOTS ; slot++ )
     44    for( slot = 0 ; slot < CONFIG_RPC_FIFO_SLOTS ; slot++ )
    4545    {
    4646        fifo->valid[slot] = 0;
     
    6969
    7070    // wait until allocated slot is empty in remote FIFO
    71     // max retry = CONFIG_REMOTE_FIFO_MAX_ITERATIONS 
     71    // max retry = CONFIG_RPC_FIFO_MAX_ITERATIONS 
    7272    // return error if watchdog is reached
    7373    while( 1 )
    7474    {
    7575        // return error if contention detected by watchdog
    76         if( watchdog > CONFIG_REMOTE_FIFO_MAX_ITERATIONS )  return EBUSY;
     76        if( watchdog > CONFIG_RPC_FIFO_MAX_ITERATIONS )  return EBUSY;
    7777
    7878        // read remote rd_id value
     
    8484
    8585        // exit waiting loop as soon as fifo not full
    86         if ( nslots < CONFIG_REMOTE_FIFO_SLOTS )  break;
     86        if ( nslots < CONFIG_RPC_FIFO_SLOTS )  break;
    8787       
    8888        // retry later if fifo full:
     
    9797
    9898    // compute actual write slot pointer
    99     ptw = wr_id % CONFIG_REMOTE_FIFO_SLOTS;
     99    ptw = wr_id % CONFIG_RPC_FIFO_SLOTS;
    100100
    101101    // copy item to fifo
     
    123123       
    124124    // compute actual read slot pointer
    125         uint32_t ptr = rd_id % CONFIG_REMOTE_FIFO_SLOTS;
     125        uint32_t ptr = rd_id % CONFIG_RPC_FIFO_SLOTS;
    126126       
    127127        // wait slot filled by the writer
     
    158158    else                 nslots = (0xFFFFFFFF - rd_id) + wr_id;
    159159
    160     return ( nslots >= CONFIG_REMOTE_FIFO_SLOTS );
     160    return ( nslots >= CONFIG_RPC_FIFO_SLOTS );
    161161}
    162162
Note: See TracChangeset for help on using the changeset viewer.