Changeset bc73be3 in mainline for kernel/generic/src/cap/cap.c
- Timestamp:
- 2019-06-27T08:51:20Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 8add15e0
- Parents:
- ad40b74b (diff), aeba767 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)links above to see all the changes relative to each parent. - File:
-
- 1 edited
-
kernel/generic/src/cap/cap.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/cap/cap.c
rad40b74b rbc73be3 98 98 { 99 99 cap_t *cap = hash_table_get_inst(item, cap_t, caps_link); 100 return hash_mix( CAP_HANDLE_RAW(cap->handle));101 } 102 103 static size_t caps_key_hash( void *key)104 { 105 c ap_handle_t *handle = (cap_handle_t *)key;106 return hash_mix( CAP_HANDLE_RAW(*handle));107 } 108 109 static bool caps_key_equal( void *key, const ht_link_t *item)110 { 111 c ap_handle_t *handle = (cap_handle_t *)key;100 return hash_mix(cap_handle_raw(cap->handle)); 101 } 102 103 static size_t caps_key_hash(const void *key) 104 { 105 const cap_handle_t *handle = key; 106 return hash_mix(cap_handle_raw(*handle)); 107 } 108 109 static bool caps_key_equal(const void *key, const ht_link_t *item) 110 { 111 const cap_handle_t *handle = key; 112 112 cap_t *cap = hash_table_get_inst(item, cap_t, caps_link); 113 113 return *handle == cap->handle; … … 232 232 assert(mutex_locked(&task->cap_info->lock)); 233 233 234 if (( CAP_HANDLE_RAW(handle) < CAPS_START) ||235 ( CAP_HANDLE_RAW(handle) > CAPS_LAST))234 if ((cap_handle_raw(handle) < CAPS_START) || 235 (cap_handle_raw(handle) > CAPS_LAST)) 236 236 return NULL; 237 237 ht_link_t *link = hash_table_find(&task->cap_info->caps, &handle); … … 383 383 void cap_free(task_t *task, cap_handle_t handle) 384 384 { 385 assert( CAP_HANDLE_RAW(handle) >= CAPS_START);386 assert( CAP_HANDLE_RAW(handle) <= CAPS_LAST);385 assert(cap_handle_raw(handle) >= CAPS_START); 386 assert(cap_handle_raw(handle) <= CAPS_LAST); 387 387 388 388 mutex_lock(&task->cap_info->lock); … … 392 392 393 393 hash_table_remove_item(&task->cap_info->caps, &cap->caps_link); 394 ra_free(task->cap_info->handles, CAP_HANDLE_RAW(handle), 1);394 ra_free(task->cap_info->handles, cap_handle_raw(handle), 1); 395 395 slab_free(cap_cache, cap); 396 396 mutex_unlock(&task->cap_info->lock);
Note:
See TracChangeset
for help on using the changeset viewer.
