Changeset eadaeae8 in mainline for uspace/lib/c/include/ipc/ipc.h


Ignore:
Timestamp:
2018-03-21T20:58:49Z (7 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
3be9d10
Parents:
874381a
Message:

Make capability handles type-safe

Define distinct pointer types for the handles of the supported
capability types and use them instead of integer handles. This makes it
virtually impossible to pass a non-handle or a handle of different type
instead of the proper handle. Also turn cap_handle_t into an "untyped"
capability handle that can be assigned to and from the "typed" handles.

This commit also fixes a bug in msim-con driver, which wrongly used the
IRQ number instead of the IRQ capability handle to unregister the IRQ.

This commit also fixes the wrong use of the capability handle instead
of error code in libusbhost.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/include/ipc/ipc.h

    r874381a readaeae8  
    7878            (arg5))
    7979
    80 extern errno_t ipc_answer_fast(cap_handle_t, errno_t, sysarg_t, sysarg_t,
     80extern errno_t ipc_answer_fast(cap_call_handle_t, errno_t, sysarg_t, sysarg_t,
    8181    sysarg_t, sysarg_t);
    82 extern errno_t ipc_answer_slow(cap_handle_t, errno_t, sysarg_t, sysarg_t,
     82extern errno_t ipc_answer_slow(cap_call_handle_t, errno_t, sysarg_t, sysarg_t,
    8383    sysarg_t, sysarg_t, sysarg_t);
    8484
     
    110110            (arg4), (arg5), (private), (callback))
    111111
    112 extern void ipc_call_async_fast(cap_handle_t, sysarg_t, sysarg_t, sysarg_t,
    113     sysarg_t, void *, ipc_async_callback_t);
    114 extern void ipc_call_async_slow(cap_handle_t, sysarg_t, sysarg_t, sysarg_t,
    115     sysarg_t, sysarg_t, sysarg_t, void *, ipc_async_callback_t);
     112extern void ipc_call_async_fast(cap_phone_handle_t, sysarg_t, sysarg_t,
     113    sysarg_t, sysarg_t, void *, ipc_async_callback_t);
     114extern void ipc_call_async_slow(cap_phone_handle_t, sysarg_t, sysarg_t,
     115    sysarg_t, sysarg_t, sysarg_t, sysarg_t, void *, ipc_async_callback_t);
    116116
    117 extern errno_t ipc_hangup(cap_handle_t);
     117extern errno_t ipc_hangup(cap_phone_handle_t);
    118118
    119 extern errno_t ipc_forward_fast(cap_handle_t, cap_handle_t, sysarg_t, sysarg_t,
    120     sysarg_t, unsigned int);
    121 extern errno_t ipc_forward_slow(cap_handle_t, cap_handle_t, sysarg_t, sysarg_t,
    122     sysarg_t, sysarg_t, sysarg_t, sysarg_t, unsigned int);
     119extern errno_t ipc_forward_fast(cap_call_handle_t, cap_phone_handle_t, sysarg_t,
     120    sysarg_t, sysarg_t, unsigned int);
     121extern errno_t ipc_forward_slow(cap_call_handle_t, cap_phone_handle_t, sysarg_t,
     122    sysarg_t, sysarg_t, sysarg_t, sysarg_t, sysarg_t, unsigned int);
    123123
    124 extern errno_t ipc_connect_kbox(task_id_t, cap_handle_t *);
     124extern errno_t ipc_connect_kbox(task_id_t, cap_phone_handle_t *);
    125125
    126126#endif
Note: See TracChangeset for help on using the changeset viewer.