Changes in kernel/generic/src/ddi/ddi.c [8cd680c:63e27ef] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/ddi/ddi.c
r8cd680c r63e27ef 40 40 */ 41 41 42 #include <assert.h> 42 43 #include <ddi/ddi.h> 43 44 #include <proc/task.h> 44 #include <security/ cap.h>45 #include <security/perm.h> 45 46 #include <mm/frame.h> 46 47 #include <mm/as.h> … … 96 97 * 97 98 * @return EOK on success. 98 * @return EPERM if the caller lacks capabilities to use this syscall.99 * @return EPERM if the caller lacks permissions to use this syscall. 99 100 * @return EBADMEM if phys is not page aligned. 100 101 * @return ENOENT if there is no task matching the specified ID or … … 106 107 unsigned int flags, uintptr_t *virt, uintptr_t bound) 107 108 { 108 ASSERT(TASK);109 assert(TASK); 109 110 110 111 if ((phys % FRAME_SIZE) != 0) … … 116 117 */ 117 118 bool priv = 118 (( cap_get(TASK) & CAP_MEM_MANAGER) == CAP_MEM_MANAGER);119 ((perm_get(TASK) & PERM_MEM_MANAGER) == PERM_MEM_MANAGER); 119 120 120 121 mem_backend_data_t backend_data; … … 211 212 NO_TRACE static int physmem_unmap(uintptr_t virt) 212 213 { 213 ASSERT(TASK);214 assert(TASK); 214 215 215 216 return as_area_destroy(TASK->as, virt); … … 260 261 * @param size Size of the enabled I/O space. 261 262 * 262 * @return 0 on success, EPERM if the caller lacks capabilities to use this263 * @return 0 on success, EPERM if the caller lacks permissions to use this 263 264 * syscall, ENOENT if there is no task matching the specified ID. 264 265 * … … 269 270 * Make sure the caller is authorised to make this syscall. 270 271 */ 271 cap_t caps = cap_get(TASK);272 if (!( caps & CAP_IO_MANAGER))272 perm_t perms = perm_get(TASK); 273 if (!(perms & PERM_IO_MANAGER)) 273 274 return EPERM; 274 275 … … 301 302 * @param size Size of the enabled I/O space. 302 303 * 303 * @return 0 on success, EPERM if the caller lacks capabilities to use this304 * @return 0 on success, EPERM if the caller lacks permissions to use this 304 305 * syscall, ENOENT if there is no task matching the specified ID. 305 306 * … … 310 311 * Make sure the caller is authorised to make this syscall. 311 312 */ 312 cap_t caps = cap_get(TASK);313 if (!( caps & CAP_IO_MANAGER))313 perm_t perms = perm_get(TASK); 314 if (!(perms & PERM_IO_MANAGER)) 314 315 return EPERM; 315 316 … … 368 369 unsigned int flags, uintptr_t *phys) 369 370 { 370 ASSERT(TASK);371 assert(TASK); 371 372 372 373 // TODO: implement locking of non-anonymous mapping … … 378 379 uintptr_t *virt, uintptr_t bound) 379 380 { 380 ASSERT(TASK);381 assert(TASK); 381 382 382 383 size_t frames = SIZE2FRAMES(size);
Note:
See TracChangeset
for help on using the changeset viewer.