Changes in kernel/generic/src/cap/cap.c [f571ca49:c1f68b0] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/cap/cap.c
rf571ca49 rc1f68b0 73 73 74 74 #include <cap/cap.h> 75 #include <abi/cap.h>76 75 #include <proc/task.h> 77 76 #include <synch/mutex.h> … … 82 81 #include <stdint.h> 83 82 84 #define CAPS_START (CAP_NIL + 1) 85 #define CAPS_SIZE (INT_MAX - CAPS_START) 86 #define CAPS_LAST (CAPS_SIZE - 1) 83 #define MAX_CAPS INT_MAX 87 84 88 85 static slab_cache_t *cap_slab; … … 132 129 if (!task->cap_info->handles) 133 130 goto error_handles; 134 if (!ra_span_add(task->cap_info->handles, CAPS_START, CAPS_SIZE))131 if (!ra_span_add(task->cap_info->handles, 0, MAX_CAPS)) 135 132 goto error_span; 136 133 if (!hash_table_create(&task->cap_info->caps, 0, 0, &caps_ops)) … … 223 220 assert(mutex_locked(&task->cap_info->lock)); 224 221 225 if ((handle < CAPS_START) || (handle > CAPS_LAST))222 if ((handle < 0) || (handle >= MAX_CAPS)) 226 223 return NULL; 227 224 ht_link_t *link = hash_table_find(&task->cap_info->caps, &handle); … … 360 357 void cap_free(task_t *task, cap_handle_t handle) 361 358 { 362 assert(handle >= CAPS_START);363 assert(handle < = CAPS_LAST);359 assert(handle >= 0); 360 assert(handle < MAX_CAPS); 364 361 365 362 mutex_lock(&task->cap_info->lock);
Note:
See TracChangeset
for help on using the changeset viewer.