Changeset 683 for trunk/kernel/syscalls/sys_barrier.c
- Timestamp:
- Jan 13, 2021, 12:36:17 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/syscalls/sys_barrier.c
r670 r683 2 2 * sys_barrier.c - Access a POSIX barrier. 3 3 * 4 * authors Alain Greiner (2016,2017,2018,2019 )4 * authors Alain Greiner (2016,2017,2018,2019,2020) 5 5 * 6 6 * Copyright (c) UPMC Sorbonne Universites … … 33 33 #include <remote_barrier.h> 34 34 35 ///////////////////////////////////////////////////////////////////////////////// 36 // This function returns a printable string for the barrier related command type. 37 ///////////////////////////////////////////////////////////////////////////////// 38 39 #if DEBUG_SYS_SOCKET || DEBUG_SYSCALLS_ERROR 40 static 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 35 49 ////////////////////////////////// 36 50 int sys_barrier( intptr_t vaddr, … … 53 67 if( DEBUG_SYS_BARRIER < tm_start ) 54 68 printk("\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, 56 70 (uint32_t)tm_start ); 57 71 #endif 58 72 59 73 // check vaddr in user vspace 60 error = vmm_get_vseg( process , vaddr , &vseg ); 61 if( error ) 74 if( vmm_get_vseg( process , vaddr , &vseg ) ) 62 75 { 63 76 … … 65 78 if( DEBUG_SYSCALLS_ERROR < (uint32_t)tm_start ) 66 79 printk("\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; 70 83 return -1; 71 84 } … … 79 92 if( attr != 0 ) // QDT barrier required 80 93 { 81 error = vmm_get_vseg( process , attr , &vseg ); 82 if( error ) 94 if( vmm_get_vseg( process , attr , &vseg ) ) 83 95 { 84 96
Note: See TracChangeset
for help on using the changeset viewer.