Ignore:
Timestamp:
Jan 13, 2021, 12:36:17 AM (4 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/syscalls/sys_barrier.c

    r670 r683  
    22 * sys_barrier.c - Access a POSIX barrier.
    33 *
    4  * authors       Alain Greiner (2016,2017,2018,2019)
     4 * authors       Alain Greiner (2016,2017,2018,2019,2020)
    55 *
    66 * Copyright (c) UPMC Sorbonne Universites
     
    3333#include <remote_barrier.h>
    3434
     35/////////////////////////////////////////////////////////////////////////////////
     36// This function returns a printable string for the barrier related command type.
     37/////////////////////////////////////////////////////////////////////////////////
     38
     39#if DEBUG_SYS_SOCKET || DEBUG_SYSCALLS_ERROR
     40static char* barrier_cmd_str( uint32_t type )
     41{
     42    if     ( type == BARRIER_INIT     ) return "INIT";
     43    else if( type == BARRIER_WAIT     ) return "WAIT";
     44    else if( type == BARRIER_DESTROY  ) return "DESTROY";
     45    else                                return "undefined";
     46}
     47#endif
     48
    3549//////////////////////////////////
    3650int sys_barrier( intptr_t   vaddr,
     
    5367if( DEBUG_SYS_BARRIER < tm_start )
    5468printk("\n[%s] thread[%x,%x] enters for %s / count %d / cycle %d\n",
    55 __FUNCTION__, process->pid, this->trdid, sys_barrier_op_str(operation), count,
     69__FUNCTION__, process->pid, this->trdid, barrier_cmd_str(operation), count,
    5670(uint32_t)tm_start );
    5771#endif
    5872
    5973    // check vaddr in user vspace
    60         error = vmm_get_vseg( process , vaddr , &vseg );
    61         if( error )
     74        if( vmm_get_vseg( process , vaddr , &vseg ) )
    6275    {
    6376
     
    6578if( DEBUG_SYSCALLS_ERROR < (uint32_t)tm_start )
    6679printk("\n[ERROR] in %s for %s : unmapped barrier %x / thread[%x,%x]\n",
    67 __FUNCTION__, sys_barrier_op_str(operation), vaddr, process->pid, this->trdid );
    68 #endif
    69         this->errno = error;
     80__FUNCTION__, barrier_cmd_str(operation), vaddr, process->pid, this->trdid );
     81#endif
     82        this->errno = EINVAL;
    7083        return -1;
    7184    }
     
    7992            if( attr != 0 )   // QDT barrier required
    8093            {
    81                 error = vmm_get_vseg( process , attr , &vseg );
    82                 if( error )
     94                if( vmm_get_vseg( process , attr , &vseg ) )
    8395                {
    8496
Note: See TracChangeset for help on using the changeset viewer.