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