Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/generic/cap.c

    r6b10dab r63f8966  
    3131 */
    3232/**
    33  * @file  cap.c
    34  * @brief Functions to grant/revoke capabilities to/from a task.
     33 * @file        cap.c
     34 * @brief       Functions to grant/revoke capabilities to/from a task.
    3535 */
    3636
     
    3838#include <task.h>
    3939#include <libc.h>
     40#include <kernel/syscall/sysarg64.h>
    4041
    4142/** Grant capabilities to a task.
    4243 *
    43  * @param id   Destination task ID.
     44 * @param id Destination task ID.
    4445 * @param caps Capabilities to grant.
    4546 *
    4647 * @return Zero on success or a value from @ref errno.h on failure.
    47  *
    4848 */
    4949int cap_grant(task_id_t id, unsigned int caps)
    5050{
    51 #ifdef __32_BITS__
    52         sysarg64_t arg = (sysarg64_t) id;
     51        sysarg64_t arg;
     52       
     53        arg.value = (unsigned long long) id;
     54
    5355        return __SYSCALL2(SYS_CAP_GRANT, (sysarg_t) &arg, (sysarg_t) caps);
    54 #endif
    55        
    56 #ifdef __64_BITS__
    57         return __SYSCALL2(SYS_CAP_GRANT, (sysarg_t) id, (sysarg_t) caps);
    58 #endif
    5956}
    6057
    6158/** Revoke capabilities from a task.
    6259 *
    63  * @param id   Destination task ID.
     60 * @param id Destination task ID.
    6461 * @param caps Capabilities to revoke.
    6562 *
    6663 * @return Zero on success or a value from @ref errno.h on failure.
    67  *
    6864 */
    6965int cap_revoke(task_id_t id, unsigned int caps)
    7066{
    71 #ifdef __32_BITS__
    72         sysarg64_t arg = (sysarg64_t) id;
     67        sysarg64_t arg;
     68       
     69        arg.value = (unsigned long long) id;
     70
    7371        return __SYSCALL2(SYS_CAP_REVOKE, (sysarg_t) &arg, (sysarg_t) caps);
    74 #endif
    75        
    76 #ifdef __64_BITS__
    77         return __SYSCALL2(SYS_CAP_REVOKE, (sysarg_t) id, (sysarg_t) caps);
    78 #endif
    7972}
    8073
Note: See TracChangeset for help on using the changeset viewer.