Changeset eadaeae8 in mainline for kernel/generic/src/ipc/irq.c


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
  • kernel/generic/src/ipc/irq.c

    r874381a readaeae8  
    314314 */
    315315errno_t ipc_irq_subscribe(answerbox_t *box, inr_t inr, sysarg_t imethod,
    316     irq_code_t *ucode, cap_handle_t *uspace_handle)
     316    irq_code_t *ucode, cap_irq_handle_t *uspace_handle)
    317317{
    318318        if ((inr < 0) || (inr > last_inr))
     
    390390 *
    391391 */
    392 errno_t ipc_irq_unsubscribe(answerbox_t *box, int handle)
     392errno_t ipc_irq_unsubscribe(answerbox_t *box, cap_irq_handle_t handle)
    393393{
    394394        kobject_t *kobj = cap_unpublish(TASK, handle, KOBJECT_TYPE_IRQ);
Note: See TracChangeset for help on using the changeset viewer.