Changeset 89ea2dc in mainline for kernel/generic/src
- Timestamp:
- 2017-12-19T17:35:28Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- d0c2beb
- Parents:
- 7565a4b
- Location:
- kernel/generic/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/adt/bitmap.c
r7565a4b r89ea2dc 269 269 * 270 270 */ 271 intbitmap_allocate_range(bitmap_t *bitmap, size_t count, size_t base,271 bool bitmap_allocate_range(bitmap_t *bitmap, size_t count, size_t base, 272 272 size_t prefered, size_t constraint, size_t *index) 273 273 { -
kernel/generic/src/synch/spinlock.c
r7565a4b r89ea2dc 153 153 * 154 154 */ 155 intspinlock_trylock(spinlock_t *lock)155 bool spinlock_trylock(spinlock_t *lock) 156 156 { 157 157 preemption_disable(); 158 int rc= !test_and_set(&lock->val);158 bool ret = !test_and_set(&lock->val); 159 159 160 160 /* … … 163 163 CS_ENTER_BARRIER(); 164 164 165 if (!r c)165 if (!ret) 166 166 preemption_enable(); 167 167 168 return r c;168 return ret; 169 169 } 170 170 … … 257 257 * 258 258 */ 259 intirq_spinlock_trylock(irq_spinlock_t *lock)259 bool irq_spinlock_trylock(irq_spinlock_t *lock) 260 260 { 261 261 ASSERT_IRQ_SPINLOCK(interrupts_disabled(), lock); 262 int rc= spinlock_trylock(&(lock->lock));263 264 ASSERT_IRQ_SPINLOCK((!r c) || (!lock->guard), lock);265 return r c;262 bool ret = spinlock_trylock(&(lock->lock)); 263 264 ASSERT_IRQ_SPINLOCK((!ret) || (!lock->guard), lock); 265 return ret; 266 266 } 267 267 -
kernel/generic/src/synch/workqueue.c
r7565a4b r89ea2dc 256 256 * workq_stop(). 257 257 */ 258 intworkq_init(struct work_queue *workq, const char *name)258 bool workq_init(struct work_queue *workq, const char *name) 259 259 { 260 260 workq_preinit(workq, name); … … 394 394 * See workq_enqueue_noblock() for more details. 395 395 */ 396 intworkq_global_enqueue_noblock(work_t *work_item, work_func_t func)396 bool workq_global_enqueue_noblock(work_t *work_item, work_func_t func) 397 397 { 398 398 return workq_enqueue_noblock(&g_work_queue, work_item, func); … … 403 403 * See workq_enqueue() for more details. 404 404 */ 405 intworkq_global_enqueue(work_t *work_item, work_func_t func)405 bool workq_global_enqueue(work_t *work_item, work_func_t func) 406 406 { 407 407 return workq_enqueue(&g_work_queue, work_item, func); … … 426 426 * @return true Otherwise. func() will be invoked in a separate thread. 427 427 */ 428 intworkq_enqueue_noblock(struct work_queue *workq, work_t *work_item,428 bool workq_enqueue_noblock(struct work_queue *workq, work_t *work_item, 429 429 work_func_t func) 430 430 { … … 446 446 * @return true Otherwise. func() will be invoked in a separate thread. 447 447 */ 448 intworkq_enqueue(struct work_queue *workq, work_t *work_item, work_func_t func)448 bool workq_enqueue(struct work_queue *workq, work_t *work_item, work_func_t func) 449 449 { 450 450 return _workq_enqueue(workq, work_item, func, true);
Note:
See TracChangeset
for help on using the changeset viewer.