Changeset d088616 in mainline for kernel/generic/src/cap/cap.c
- Timestamp:
- 2017-10-28T08:49:42Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- d470ec8
- Parents:
- 9b642f92
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/cap/cap.c
r9b642f92 rd088616 84 84 85 85 static slab_cache_t *cap_slab; 86 87 static kobject_t *cap_unpublish_locked(task_t *, cap_handle_t, kobject_type_t);88 86 89 87 static size_t caps_hash(const ht_link_t *item) … … 320 318 } 321 319 322 static kobject_t * 320 /** @copydoc cap_unpublish() 321 * 322 * Can only be called internally by the capability subsytem or from a 323 * caps_apply_to_kobject_type() callback. 324 */ 325 kobject_t * 323 326 cap_unpublish_locked(task_t *task, cap_handle_t handle, kobject_type_t type) 324 327 { … … 361 364 } 362 365 363 /** Free allocated capability364 * 365 * @param task Task in which to free the capability.366 * @param handle Capability handle.367 */ 368 void cap_free (task_t *task, cap_handle_t handle)366 /** @copydoc cap_free() 367 * 368 * Can only be called internally by the capability subsytem or from a 369 * caps_apply_to_kobject_type() callback. 370 */ 371 void cap_free_locked(task_t *task, cap_handle_t handle) 369 372 { 370 373 assert(handle >= 0); 371 374 assert(handle < MAX_CAPS); 372 375 373 mutex_lock(&task->cap_info->lock);374 376 cap_t *cap = cap_get(task, handle, CAP_STATE_ALLOCATED); 375 377 … … 379 381 ra_free(task->cap_info->handles, handle, 1); 380 382 slab_free(cap_slab, cap); 383 } 384 385 /** Free allocated capability 386 * 387 * @param task Task in which to free the capability. 388 * @param handle Capability handle. 389 */ 390 void cap_free(task_t *task, cap_handle_t handle) 391 { 392 mutex_lock(&task->cap_info->lock); 393 cap_free_locked(task, handle); 381 394 mutex_unlock(&task->cap_info->lock); 382 395 }
Note:
See TracChangeset
for help on using the changeset viewer.