Changeset f571ca49 in mainline
- Timestamp:
- 2017-11-24T19:00:00Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- ac307b2
- Parents:
- 503ffce
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
abi/include/abi/ipc/methods.h
r503ffce rf571ca49 36 36 #define ABI_IPC_METHODS_H_ 37 37 38 #include <abi/cap.h> 39 38 40 /* Well known phone descriptors */ 39 #define PHONE_NS 041 #define PHONE_NS (CAP_NIL + 1) 40 42 41 43 /** Kernel IPC interfaces -
kernel/generic/src/cap/cap.c
r503ffce rf571ca49 73 73 74 74 #include <cap/cap.h> 75 #include <abi/cap.h> 75 76 #include <proc/task.h> 76 77 #include <synch/mutex.h> … … 81 82 #include <stdint.h> 82 83 83 #define MAX_CAPS INT_MAX 84 #define CAPS_START (CAP_NIL + 1) 85 #define CAPS_SIZE (INT_MAX - CAPS_START) 86 #define CAPS_LAST (CAPS_SIZE - 1) 84 87 85 88 static slab_cache_t *cap_slab; … … 129 132 if (!task->cap_info->handles) 130 133 goto error_handles; 131 if (!ra_span_add(task->cap_info->handles, 0, MAX_CAPS))134 if (!ra_span_add(task->cap_info->handles, CAPS_START, CAPS_SIZE)) 132 135 goto error_span; 133 136 if (!hash_table_create(&task->cap_info->caps, 0, 0, &caps_ops)) … … 220 223 assert(mutex_locked(&task->cap_info->lock)); 221 224 222 if ((handle < 0) || (handle >= MAX_CAPS))225 if ((handle < CAPS_START) || (handle > CAPS_LAST)) 223 226 return NULL; 224 227 ht_link_t *link = hash_table_find(&task->cap_info->caps, &handle); … … 357 360 void cap_free(task_t *task, cap_handle_t handle) 358 361 { 359 assert(handle >= 0);360 assert(handle < MAX_CAPS);362 assert(handle >= CAPS_START); 363 assert(handle <= CAPS_LAST); 361 364 362 365 mutex_lock(&task->cap_info->lock);
Note:
See TracChangeset
for help on using the changeset viewer.