Changeset bb97118 in mainline for uspace


Ignore:
Timestamp:
2019-02-06T13:25:12Z (7 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
eb13ef8
Parents:
d066259
git-author:
Jiří Zárevúcky <zarevucky.jiri@…> (2019-02-02 13:29:26)
git-committer:
Jiří Zárevúcky <zarevucky.jiri@…> (2019-02-06 13:25:12)
Message:

Convert CAP_HANDLE_RAW and CAP_HANDLE_VALID into functions

Location:
uspace
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/trace/ipcp.c

    rd066259 rbb97118  
    7575{
    7676        cap_call_handle_t *chandle = (cap_call_handle_t *) key;
    77         return CAP_HANDLE_RAW(*chandle);
     77        return cap_handle_raw(*chandle);
    7878}
    7979
     
    8181{
    8282        pending_call_t *hs = hash_table_get_inst(item, pending_call_t, link);
    83         return CAP_HANDLE_RAW(hs->call_handle);
     83        return cap_handle_raw(hs->call_handle);
    8484}
    8585
     
    104104        // XXX: there is no longer a limit on the number of phones as phones are
    105105        // now handled using capabilities
    106         if (CAP_HANDLE_RAW(phone) < 0 || CAP_HANDLE_RAW(phone) >= MAX_PHONE)
     106        if (cap_handle_raw(phone) < 0 || cap_handle_raw(phone) >= MAX_PHONE)
    107107                return;
    108         connections[CAP_HANDLE_RAW(phone)].server = server;
    109         connections[CAP_HANDLE_RAW(phone)].proto = proto;
    110         have_conn[CAP_HANDLE_RAW(phone)] = 1;
     108        connections[cap_handle_raw(phone)].server = server;
     109        connections[cap_handle_raw(phone)].proto = proto;
     110        have_conn[cap_handle_raw(phone)] = 1;
    111111}
    112112
    113113void ipcp_connection_clear(cap_phone_handle_t phone)
    114114{
    115         have_conn[CAP_HANDLE_RAW(phone)] = 0;
    116         connections[CAP_HANDLE_RAW(phone)].server = 0;
    117         connections[CAP_HANDLE_RAW(phone)].proto = NULL;
     115        have_conn[cap_handle_raw(phone)] = 0;
     116        connections[cap_handle_raw(phone)].server = 0;
     117        connections[cap_handle_raw(phone)].proto = NULL;
    118118}
    119119
     
    184184        int i;
    185185
    186         if (have_conn[CAP_HANDLE_RAW(phandle)])
    187                 proto = connections[CAP_HANDLE_RAW(phandle)].proto;
     186        if (have_conn[cap_handle_raw(phandle)])
     187                proto = connections[cap_handle_raw(phandle)].proto;
    188188        else
    189189                proto = NULL;
  • uspace/drv/bus/usb/ohci/hc.c

    rd066259 rbb97118  
    514514
    515515        /* Enable interrupts */
    516         if (CAP_HANDLE_VALID(instance->base.irq_handle)) {
     516        if (cap_handle_valid(instance->base.irq_handle)) {
    517517                OHCI_WR(instance->registers->interrupt_enable,
    518518                    OHCI_USED_INTERRUPTS);
  • uspace/drv/bus/usb/uhci/hc.c

    rd066259 rbb97118  
    295295        pio_write_32(&registers->flbaseadd, pa);
    296296
    297         if (CAP_HANDLE_VALID(instance->base.irq_handle)) {
     297        if (cap_handle_valid(instance->base.irq_handle)) {
    298298                /* Enable all interrupts, but resume interrupt */
    299299                pio_write_16(&instance->registers->usbintr,
  • uspace/drv/bus/usb/xhci/hc.c

    rd066259 rbb97118  
    494494        XHCI_REG_WR(intr0, XHCI_INTR_ERSTBA, erstba_phys);
    495495
    496         if (CAP_HANDLE_VALID(hc->base.irq_handle)) {
     496        if (cap_handle_valid(hc->base.irq_handle)) {
    497497                XHCI_REG_SET(intr0, XHCI_INTR_IE, 1);
    498498                XHCI_REG_SET(hc->op_regs, XHCI_OP_INTE, 1);
  • uspace/drv/char/msim-con/msim-con.c

    rd066259 rbb97118  
    156156        return EOK;
    157157error:
    158         if (CAP_HANDLE_VALID(con->irq_handle))
     158        if (cap_handle_valid(con->irq_handle))
    159159                async_irq_unsubscribe(con->irq_handle);
    160160        if (bound)
  • uspace/drv/char/pc-lpt/pc-lpt.c

    rd066259 rbb97118  
    173173        return EOK;
    174174error:
    175         if (CAP_HANDLE_VALID(lpt->irq_handle))
     175        if (cap_handle_valid(lpt->irq_handle))
    176176                async_irq_unsubscribe(lpt->irq_handle);
    177177        if (bound)
  • uspace/lib/c/generic/async/client.c

    rd066259 rbb97118  
    12601260{
    12611261        return async_req_5_0(exch, IPC_M_STATE_CHANGE_AUTHORIZE,
    1262             arg1, arg2, arg3, 0, CAP_HANDLE_RAW(other_exch->phone));
     1262            arg1, arg2, arg3, 0, cap_handle_raw(other_exch->phone));
    12631263}
    12641264
  • uspace/lib/c/generic/async/server.c

    rd066259 rbb97118  
    17351735
    17361736        if ((IPC_GET_IMETHOD(call) != IPC_M_CONNECT_TO_ME) ||
    1737             !CAP_HANDLE_VALID((phandle))) {
     1737            !cap_handle_valid((phandle))) {
    17381738                async_answer_0(&call, EINVAL);
    17391739                return NULL;
     
    17791779
    17801780        if ((IPC_GET_IMETHOD(*call) != IPC_M_CONNECT_TO_ME) ||
    1781             !CAP_HANDLE_VALID((phandle)))
     1781            !cap_handle_valid((phandle)))
    17821782                return NULL;
    17831783
     
    18131813        assert(call);
    18141814
    1815         return async_answer_1(call, EOK, CAP_HANDLE_RAW(other_exch->phone));
     1815        return async_answer_1(call, EOK, cap_handle_raw(other_exch->phone));
    18161816}
    18171817
  • uspace/lib/c/generic/ipc.c

    rd066259 rbb97118  
    7171{
    7272        return __SYSCALL6(SYS_IPC_CALL_ASYNC_FAST,
    73             CAP_HANDLE_RAW(phandle), imethod, arg1, arg2, arg3,
     73            cap_handle_raw(phandle), imethod, arg1, arg2, arg3,
    7474            (sysarg_t) label);
    7575}
     
    106106
    107107        return __SYSCALL3(SYS_IPC_CALL_ASYNC_SLOW,
    108             CAP_HANDLE_RAW(phandle), (sysarg_t) &data,
     108            cap_handle_raw(phandle), (sysarg_t) &data,
    109109            (sysarg_t) label);
    110110}
     
    130130{
    131131        return (errno_t) __SYSCALL6(SYS_IPC_ANSWER_FAST,
    132             CAP_HANDLE_RAW(chandle), (sysarg_t) retval, arg1, arg2, arg3, arg4);
     132            cap_handle_raw(chandle), (sysarg_t) retval, arg1, arg2, arg3, arg4);
    133133}
    134134
     
    160160
    161161        return (errno_t) __SYSCALL2(SYS_IPC_ANSWER_SLOW,
    162             CAP_HANDLE_RAW(chandle), (sysarg_t) &data);
     162            cap_handle_raw(chandle), (sysarg_t) &data);
    163163}
    164164
     
    186186errno_t ipc_hangup(cap_phone_handle_t phandle)
    187187{
    188         return (errno_t) __SYSCALL1(SYS_IPC_HANGUP, CAP_HANDLE_RAW(phandle));
     188        return (errno_t) __SYSCALL1(SYS_IPC_HANGUP, cap_handle_raw(phandle));
    189189}
    190190
     
    210210{
    211211        return (errno_t) __SYSCALL6(SYS_IPC_FORWARD_FAST,
    212             CAP_HANDLE_RAW(chandle), CAP_HANDLE_RAW(phandle), imethod, arg1,
     212            cap_handle_raw(chandle), cap_handle_raw(phandle), imethod, arg1,
    213213            arg2, mode);
    214214}
     
    228228
    229229        return (errno_t) __SYSCALL4(SYS_IPC_FORWARD_SLOW,
    230             CAP_HANDLE_RAW(chandle), CAP_HANDLE_RAW(phandle), (sysarg_t) &data,
     230            cap_handle_raw(chandle), cap_handle_raw(phandle), (sysarg_t) &data,
    231231            mode);
    232232}
  • uspace/lib/c/generic/irq.c

    rd066259 rbb97118  
    8383{
    8484        return (errno_t) __SYSCALL1(SYS_IPC_IRQ_UNSUBSCRIBE,
    85             CAP_HANDLE_RAW(cap));
     85            cap_handle_raw(cap));
    8686}
    8787
  • uspace/lib/hound/src/protocol.c

    rd066259 rbb97118  
    158158        async_exch_t *exch = async_exchange_begin(sess);
    159159        const errno_t ret = async_req_1_0(exch, IPC_M_HOUND_CONTEXT_UNREGISTER,
    160             CAP_HANDLE_RAW(id));
     160            cap_handle_raw(id));
    161161        async_exchange_end(exch);
    162162        return ret;
     
    315315        };
    316316
    317         return async_req_4_0(exch, IPC_M_HOUND_STREAM_ENTER, CAP_HANDLE_RAW(id),
     317        return async_req_4_0(exch, IPC_M_HOUND_STREAM_ENTER, cap_handle_raw(id),
    318318            flags, c.arg, bsize);
    319319}
     
    431431                                async_answer_0(&call, ret);
    432432                        } else {
    433                                 async_answer_1(&call, EOK, CAP_HANDLE_RAW(context));
     433                                async_answer_1(&call, EOK, cap_handle_raw(context));
    434434                        }
    435435                        break;
Note: See TracChangeset for help on using the changeset viewer.