Changeset 60744cb in mainline for uspace/drv/block/ahci/ahci.c


Ignore:
Timestamp:
2024-05-17T17:51:56Z (13 months ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
master
Children:
1801005
Parents:
646849b3
Message:

Let driver specify any argument to IRQ handler

This allows the driver to register a single handler for multiple
interrupts and still distinguish between them. It also removes
the extra step of having to get softstate from ddf_dev_t.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/block/ahci/ahci.c

    r646849b3 r60744cb  
    162162}
    163163
    164 /** Get AHCI structure from DDF device. */
    165 static ahci_dev_t *dev_ahci_dev(ddf_dev_t *dev)
    166 {
    167         return ddf_dev_data_get(dev);
    168 }
    169 
    170164/** Get SATA device name.
    171165 *
     
    891885 *
    892886 * @param icall The IPC call structure.
    893  * @param dev   DDF device structure.
    894  *
    895  */
    896 static void ahci_interrupt(ipc_call_t *icall, ddf_dev_t *dev)
    897 {
    898         ahci_dev_t *ahci = dev_ahci_dev(dev);
     887 * @param arg   Argument (ahci_dev_t *)
     888 */
     889static void ahci_interrupt(ipc_call_t *icall, void *arg)
     890{
     891        ahci_dev_t *ahci = (ahci_dev_t *)arg;
    899892        unsigned int port = ipc_get_arg1(icall);
    900893        ahci_port_is_t pxis = ipc_get_arg2(icall);
     
    11861179        cap_irq_handle_t irq_cap;
    11871180        errno_t rc = register_interrupt_handler(dev,
    1188             hw_res_parsed.irqs.irqs[0], ahci_interrupt, &ct, &irq_cap);
     1181            hw_res_parsed.irqs.irqs[0], ahci_interrupt, (void *)ahci, &ct,
     1182            &irq_cap);
    11891183        if (rc != EOK) {
    11901184                ddf_msg(LVL_ERROR, "Failed registering interrupt handler.");
Note: See TracChangeset for help on using the changeset viewer.