Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/ddi/ddi.c

    r63e27ef r8cd680c  
    4040 */
    4141
    42 #include <assert.h>
    4342#include <ddi/ddi.h>
    4443#include <proc/task.h>
    45 #include <security/perm.h>
     44#include <security/cap.h>
    4645#include <mm/frame.h>
    4746#include <mm/as.h>
     
    9796 *
    9897 * @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.
    10099 * @return EBADMEM if phys is not page aligned.
    101100 * @return ENOENT if there is no task matching the specified ID or
     
    107106    unsigned int flags, uintptr_t *virt, uintptr_t bound)
    108107{
    109         assert(TASK);
     108        ASSERT(TASK);
    110109       
    111110        if ((phys % FRAME_SIZE) != 0)
     
    117116         */
    118117        bool priv =
    119             ((perm_get(TASK) & PERM_MEM_MANAGER) == PERM_MEM_MANAGER);
     118            ((cap_get(TASK) & CAP_MEM_MANAGER) == CAP_MEM_MANAGER);
    120119       
    121120        mem_backend_data_t backend_data;
     
    212211NO_TRACE static int physmem_unmap(uintptr_t virt)
    213212{
    214         assert(TASK);
     213        ASSERT(TASK);
    215214
    216215        return as_area_destroy(TASK->as, virt);
     
    261260 * @param size   Size of the enabled I/O space.
    262261 *
    263  * @return 0 on success, EPERM if the caller lacks permissions to use this
     262 * @return 0 on success, EPERM if the caller lacks capabilities to use this
    264263 *           syscall, ENOENT if there is no task matching the specified ID.
    265264 *
     
    270269         * Make sure the caller is authorised to make this syscall.
    271270         */
    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))
    274273                return EPERM;
    275274       
     
    302301 * @param size   Size of the enabled I/O space.
    303302 *
    304  * @return 0 on success, EPERM if the caller lacks permissions to use this
     303 * @return 0 on success, EPERM if the caller lacks capabilities to use this
    305304 *           syscall, ENOENT if there is no task matching the specified ID.
    306305 *
     
    311310         * Make sure the caller is authorised to make this syscall.
    312311         */
    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))
    315314                return EPERM;
    316315       
     
    369368    unsigned int flags, uintptr_t *phys)
    370369{
    371         assert(TASK);
     370        ASSERT(TASK);
    372371       
    373372        // TODO: implement locking of non-anonymous mapping
     
    379378    uintptr_t *virt, uintptr_t bound)
    380379{
    381         assert(TASK);
     380        ASSERT(TASK);
    382381       
    383382        size_t frames = SIZE2FRAMES(size);
Note: See TracChangeset for help on using the changeset viewer.