Changeset eadaeae8 in mainline for uspace/drv/audio


Ignore:
Timestamp:
2018-03-21T20:58:49Z (8 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.

Location:
uspace/drv/audio
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/audio/hdaudio/hdaudio.c

    r874381a readaeae8  
    263263        }
    264264
    265         int irq_cap;
     265        cap_irq_handle_t irq_cap;
    266266        rc = register_interrupt_handler(dev, res.irqs.irqs[0],
    267267            hdaudio_interrupt, &irq_code, &irq_cap);
  • uspace/drv/audio/sb16/main.c

    r874381a readaeae8  
    9393        irq_cmd_t irq_cmds[irq_cmd_count];
    9494        irq_pio_range_t irq_ranges[1];
    95         int irq_cap;
     95        cap_irq_handle_t irq_cap;
    9696
    9797        sb16_t *soft_state = ddf_dev_data_alloc(device, sizeof(sb16_t));
Note: See TracChangeset for help on using the changeset viewer.