Changeset eadaeae8 in mainline for uspace/drv/char/i8042/i8042.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
  • uspace/drv/char/i8042/i8042.c

    r874381a readaeae8  
    281281        };
    282282
    283         int irq_kbd_cap;
     283        cap_irq_handle_t kbd_ihandle;
    284284        rc = register_interrupt_handler(ddf_dev, irq_kbd,
    285             i8042_irq_handler, &irq_code, &irq_kbd_cap);
     285            i8042_irq_handler, &irq_code, &kbd_ihandle);
    286286        if (rc != EOK) {
    287287                ddf_msg(LVL_ERROR, "Failed set handler for kbd: %s.",
     
    290290        }
    291291
    292         int irq_mouse_cap;
     292        cap_irq_handle_t mouse_ihandle;
    293293        rc = register_interrupt_handler(ddf_dev, irq_mouse,
    294             i8042_irq_handler, &irq_code, &irq_mouse_cap);
     294            i8042_irq_handler, &irq_code, &mouse_ihandle);
    295295        if (rc != EOK) {
    296296                ddf_msg(LVL_ERROR, "Failed set handler for mouse: %s.",
Note: See TracChangeset for help on using the changeset viewer.