Changeset 440 for trunk/kernel/syscalls/sys_mutex.c
- Timestamp:
- May 3, 2018, 5:51:22 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/syscalls/sys_mutex.c
r23 r440 2 2 * sys_mutex.c - Access a POSIX mutex. 3 3 * 4 * Author Alain Greiner (2016,2017 )4 * Author Alain Greiner (2016,2017,2018) 5 5 * 6 6 * Copyright (c) UPMC Sorbonne Universites … … 37 37 uint32_t attr ) 38 38 { 39 error_t error;40 paddr_t paddr;39 error_t error; 40 vseg_t * vseg; 41 41 42 thread_t * this = CURRENT_THREAD; 42 thread_t * this = CURRENT_THREAD; 43 process_t * process = this->process; 43 44 44 45 // check vaddr in user vspace 45 error = vmm_v2p_translate( false , vaddr , &paddr ); 46 error = vmm_get_vseg( process , (intptr_t)vaddr , &vseg ); 47 46 48 if( error ) 47 49 { 48 printk("\n[ERROR] in %s : illegal virtual address = %x\n", 49 __FUNCTION__ , (intptr_t)vaddr ); 50 51 #if DEBUG_SYSCALLS_ERROR 52 printk("\n[ERROR] in %s : mutex unmapped %x / thread %x / process %x\n", 53 __FUNCTION__ , (intptr_t)vaddr , this->trdid , process->pid ); 54 vmm_display( process , false ); 55 #endif 50 56 this->errno = error; 51 57 return -1; … … 60 66 if( attr != 0 ) 61 67 { 62 printk("\n[ERROR] in %s : mutex attributes non supported yet\n", 63 __FUNCTION__ ); 68 69 #if DEBUG_SYSCALLS_ERROR 70 printk("\n[ERROR] in %s : mutex attribute non supported / thread %x / process %x\n", 71 __FUNCTION__ , this->trdid , process->pid ); 72 #endif 64 73 this->errno = error; 65 74 return -1; … … 70 79 if( error ) 71 80 { 72 printk("\n[ERROR] in %s : cannot create mutex\n", 73 __FUNCTION__ ); 81 82 #if DEBUG_SYSCALLS_ERROR 83 printk("\n[ERROR] in %s : cannot create mutex / thread %x / process %x\n", 84 __FUNCTION__ , this->trdid , process->pid ); 85 #endif 74 86 this->errno = error; 75 87 return -1; … … 84 96 if( mutex_xp == XPTR_NULL ) // user error 85 97 { 86 printk("\n[ERROR] in %s : mutex %x not registered\n", 87 __FUNCTION__ , (intptr_t)vaddr ); 98 99 #if DEBUG_SYSCALLS_ERROR 100 printk("\n[ERROR] in %s : mutex %x not registered / thread %x / process %x\n", 101 __FUNCTION__ , (intptr_t)vaddr , this->trdid , process->pid ); 102 #endif 88 103 this->errno = EINVAL; 89 104 return -1; … … 102 117 if( mutex_xp == XPTR_NULL ) // user error 103 118 { 104 printk("\n[ERROR] in %s : mutex %x not registered\n", 105 __FUNCTION__ , (intptr_t)vaddr ); 119 120 #if DEBUG_SYSCALLS_ERROR 121 printk("\n[ERROR] in %s : mutex %x not registered / thread %x / process %x\n", 122 __FUNCTION__ , (intptr_t)vaddr , this->trdid , process->pid ); 123 #endif 106 124 this->errno = EINVAL; 107 125 return -1; … … 120 138 if( mutex_xp == XPTR_NULL ) // user error 121 139 { 122 printk("\n[ERROR] in %s : mutex %x not registered\n", 123 __FUNCTION__ , (intptr_t)vaddr ); 140 141 #if DEBUG_SYSCALLS_ERROR 142 printk("\n[ERROR] in %s : mutex %x not registered / thread %x / process %x\n", 143 __FUNCTION__ , (intptr_t)vaddr , this->trdid , process->pid ); 144 #endif 124 145 this->errno = EINVAL; 125 146 return -1;
Note: See TracChangeset
for help on using the changeset viewer.