Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 5863a95 in mainline for uspace/lib/c/generic/cap.c


Ignore:
Timestamp:
2010-12-17T08:59:35Z (11 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master
Children:
58854f2
Parents:
70e5ad5 (diff), 11658b64 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge development/ changes

File:
1 edited

Legend:

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

    r70e5ad5 r5863a95  
    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>
    4140
    4241/** Grant capabilities to a task.
    4342 *
    44  * @param id Destination task ID.
     43 * @param id   Destination task ID.
    4544 * @param caps Capabilities to grant.
    4645 *
    4746 * @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         sysarg64_t arg;
     51#ifdef __32_BITS__
     52        sysarg64_t arg = (sysarg64_t) id;
     53        return __SYSCALL2(SYS_CAP_GRANT, (sysarg_t) &arg, (sysarg_t) caps);
     54#endif
    5255       
    53         arg.value = (unsigned long long) id;
    54 
    55         return __SYSCALL2(SYS_CAP_GRANT, (sysarg_t) &arg, (sysarg_t) caps);
     56#ifdef __64_BITS__
     57        return __SYSCALL2(SYS_CAP_GRANT, (sysarg_t) id, (sysarg_t) caps);
     58#endif
    5659}
    5760
    5861/** Revoke capabilities from a task.
    5962 *
    60  * @param id Destination task ID.
     63 * @param id   Destination task ID.
    6164 * @param caps Capabilities to revoke.
    6265 *
    6366 * @return Zero on success or a value from @ref errno.h on failure.
     67 *
    6468 */
    6569int cap_revoke(task_id_t id, unsigned int caps)
    6670{
    67         sysarg64_t arg;
     71#ifdef __32_BITS__
     72        sysarg64_t arg = (sysarg64_t) id;
     73        return __SYSCALL2(SYS_CAP_REVOKE, (sysarg_t) &arg, (sysarg_t) caps);
     74#endif
    6875       
    69         arg.value = (unsigned long long) id;
    70 
    71         return __SYSCALL2(SYS_CAP_REVOKE, (sysarg_t) &arg, (sysarg_t) caps);
     76#ifdef __64_BITS__
     77        return __SYSCALL2(SYS_CAP_REVOKE, (sysarg_t) id, (sysarg_t) caps);
     78#endif
    7279}
    7380
Note: See TracChangeset for help on using the changeset viewer.