Changeset 683 for trunk/kernel/libk/remote_sem.c
- Timestamp:
- Jan 13, 2021, 12:36:17 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/libk/remote_sem.c
r671 r683 2 2 * remote_sem.c - POSIX unnamed semaphore implementation. 3 3 * 4 * Author Alain Greiner (2016,2017,2018,2019 )4 * Author Alain Greiner (2016,2017,2018,2019,2020) 5 5 * 6 6 * Copyright (c) UPMC Sorbonne Universites … … 86 86 uint32_t value ) 87 87 { 88 kmem_req_t req;89 88 remote_sem_t * sem_ptr; 90 89 … … 100 99 101 100 // allocate memory for new semaphore in reference cluster 102 req.type = KMEM_KCM; 103 req.order = bits_log2( sizeof(remote_sem_t) ); 104 req.flags = AF_ZERO | AF_KERNEL; 105 sem_ptr = kmem_remote_alloc( ref_cxy, &req ); 101 sem_ptr = kmem_remote_alloc( ref_cxy , bits_log2(sizeof(remote_sem_t)) , AF_ZERO ); 106 102 107 103 if( sem_ptr == NULL ) … … 144 140 void remote_sem_destroy( xptr_t sem_xp ) 145 141 { 146 kmem_req_t req;147 148 142 // get pointer on local process descriptor 149 143 process_t * process = CURRENT_THREAD->process; … … 176 170 177 171 // release memory allocated for semaphore descriptor 178 req.type = KMEM_KCM; 179 req.ptr = sem_ptr; 180 kmem_remote_free( sem_cxy , &req ); 172 kmem_remote_free( sem_cxy , sem_ptr , bits_log2(sizeof(remote_sem_t)) ); 181 173 182 174 } // end remote_sem_destroy()
Note: See TracChangeset
for help on using the changeset viewer.