Changeset 8820544 in mainline for uspace/drv


Ignore:
Timestamp:
2014-08-16T00:02:04Z (12 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
35b8bfe, 8cd680c
Parents:
83f29e0
Message:

support for kernel notification multiplexing in the async framework

  • rename SYS_EVENT_* and SYS_IRQ_* syscalls to unify the terminology
  • add SYS_IPC_EVENT_UNSUBSCRIBE
  • remove IRQ handler multiplexing from DDF, the generic mechanism replaces it (unfortunatelly the order of arguments used by interrupt_handler_t needs to be permutated to align with the async framework conventions)
Location:
uspace/drv
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/audio/sb16/main.c

    r83f29e0 r8820544  
    7777}
    7878
    79 static void irq_handler(ddf_dev_t *dev, ipc_callid_t iid, ipc_call_t *call)
     79static void irq_handler(ipc_callid_t iid, ipc_call_t *call, ddf_dev_t *dev)
    8080{
    8181        sb16_t *sb16_dev = ddf_dev_data_get(dev);
  • uspace/drv/block/ahci/ahci.c

    r83f29e0 r8820544  
    890890/** AHCI interrupt handler.
    891891 *
    892  * @param dev   DDF device structure.
    893892 * @param iid   The IPC call id.
    894893 * @param icall The IPC call structure.
    895  *
    896  */
    897 static void ahci_interrupt(ddf_dev_t *dev, ipc_callid_t iid, ipc_call_t *icall)
     894 * @param dev   DDF device structure.
     895 *
     896 */
     897static void ahci_interrupt(ipc_callid_t iid, ipc_call_t *icall, ddf_dev_t *dev)
    898898{
    899899        ahci_dev_t *ahci = dev_ahci_dev(dev);
  • uspace/drv/bus/usb/ohci/ohci.c

    r83f29e0 r8820544  
    5959/** IRQ handling callback, identifies device
    6060 *
    61  * @param[in] dev DDF instance of the device to use.
    6261 * @param[in] iid (Unused).
    6362 * @param[in] call Pointer to the call that represents interrupt.
    64  */
    65 static void irq_handler(ddf_dev_t *dev, ipc_callid_t iid, ipc_call_t *call)
     63 * @param[in] dev DDF instance of the device to use.
     64 *
     65 */
     66static void irq_handler(ipc_callid_t iid, ipc_call_t *call, ddf_dev_t *dev)
    6667{
    6768        assert(dev);
    68 
     69       
    6970        ohci_t *ohci = dev_to_ohci(dev);
    7071        if (!ohci) {
     
    7273                return;
    7374        }
     75       
    7476        const uint16_t status = IPC_GET_ARG1(*call);
    7577        hc_interrupt(&ohci->hc, status);
  • uspace/drv/bus/usb/uhci/hc.c

    r83f29e0 r8820544  
    151151                return rc;
    152152        }
    153 
     153       
    154154        irq_code_t irq_code = {
    155155                .rangecount = hc_irq_pio_range_count,
     
    158158                .cmds = irq_cmds
    159159        };
    160 
    161         /* Register handler to avoid interrupt lockup */
    162         rc = register_interrupt_handler(device, irq, handler, &irq_code);
    163         if (rc != EOK) {
    164                 usb_log_error("Failed to register interrupt handler: %s.\n",
    165                     str_error(rc));
    166                 return rc;
    167         }
    168 
     160       
     161        /* Register handler to avoid interrupt lockup */
     162        rc = register_interrupt_handler(device, irq, handler, &irq_code);
     163        if (rc != EOK) {
     164                usb_log_error("Failed to register interrupt handler: %s.\n",
     165                    str_error(rc));
     166                return rc;
     167        }
     168       
    169169        return EOK;
    170170}
  • uspace/drv/bus/usb/uhci/uhci.c

    r83f29e0 r8820544  
    6969/** IRQ handling callback, forward status from call to diver structure.
    7070 *
    71  * @param[in] dev DDF instance of the device to use.
    7271 * @param[in] iid (Unused).
    7372 * @param[in] call Pointer to the call from kernel.
    74  */
    75 static void irq_handler(ddf_dev_t *dev, ipc_callid_t iid, ipc_call_t *call)
     73 * @param[in] dev DDF instance of the device to use.
     74 *
     75 */
     76static void irq_handler(ipc_callid_t iid, ipc_call_t *call, ddf_dev_t *dev)
    7677{
    7778        assert(dev);
     79       
    7880        uhci_t *uhci = dev_to_uhci(dev);
    7981        if (!uhci) {
     
    8183                return;
    8284        }
     85       
    8386        const uint16_t status = IPC_GET_ARG1(*call);
    8487        hc_interrupt(&uhci->hc, status);
  • uspace/drv/char/i8042/i8042.c

    r83f29e0 r8820544  
    6464#define i8042_KBD_TRANSLATE  0x40  /* Use this to switch to XT scancodes */
    6565
    66 void default_handler(ddf_fun_t *, ipc_callid_t, ipc_call_t *);
     66static void default_handler(ddf_fun_t *, ipc_callid_t, ipc_call_t *);
    6767
    6868/** Port function operations. */
    6969static ddf_dev_ops_t ops = {
    70         .default_handler = default_handler,
     70        .default_handler = default_handler
    7171};
    7272
     
    123123 * Write new data to the corresponding buffer.
    124124 *
    125  * @param dev  Device that caued the interrupt.
    126125 * @param iid  Call id.
    127126 * @param call pointerr to call data.
    128  *
    129  */
    130 static void i8042_irq_handler(ddf_dev_t *dev, ipc_callid_t iid,
    131     ipc_call_t *call)
     127 * @param dev  Device that caued the interrupt.
     128 *
     129 */
     130static void i8042_irq_handler(ipc_callid_t iid, ipc_call_t *call,
     131    ddf_dev_t *dev)
    132132{
    133133        i8042_t *controller = dev_i8042(dev);
     
    361361 *
    362362 */
    363 void default_handler(ddf_fun_t *fun, ipc_callid_t id, ipc_call_t *call)
     363static void default_handler(ddf_fun_t *fun, ipc_callid_t id, ipc_call_t *call)
    364364{
    365365        const sysarg_t method = IPC_GET_IMETHOD(*call);
  • uspace/drv/char/i8042/i8042.h

    r83f29e0 r8820544  
    6868} i8042_t;
    6969
    70 int i8042_init(i8042_t *, addr_range_t *, int, int, ddf_dev_t *);
     70extern int i8042_init(i8042_t *, addr_range_t *, int, int, ddf_dev_t *);
    7171
    7272#endif
  • uspace/drv/char/i8042/main.c

    r83f29e0 r8820544  
    157157         * interrupt storms when the default large stacks are used.
    158158         */
    159         async_set_interrupt_handler_stack_size(PAGE_SIZE);
     159        async_set_notification_handler_stack_size(PAGE_SIZE);
    160160
    161161        return ddf_driver_main(&i8042_driver);
  • uspace/drv/char/ns8250/ns8250.c

    r83f29e0 r8820544  
    764764 * data and reading the line status register.
    765765 *
    766  * @param dev           The serial port device.
    767  */
    768 static inline void ns8250_interrupt_handler(ddf_dev_t *dev, ipc_callid_t iid,
    769     ipc_call_t *icall)
     766 * @param dev The serial port device.
     767 *
     768 */
     769static inline void ns8250_interrupt_handler(ipc_callid_t iid, ipc_call_t *icall,
     770    ddf_dev_t *dev)
    770771{
    771772        ns8250_t *ns = dev_ns8250(dev);
  • uspace/drv/nic/e1k/e1k.c

    r83f29e0 r8820544  
    12291229/** Handle device interrupt
    12301230 *
    1231  * @param dev   E1000 device
    12321231 * @param iid   IPC call id
    12331232 * @param icall IPC call structure
    1234  *
    1235  */
    1236 static void e1000_interrupt_handler(ddf_dev_t *dev, ipc_callid_t iid,
    1237     ipc_call_t *icall)
     1233 * @param dev   E1000 device
     1234 *
     1235 */
     1236static void e1000_interrupt_handler(ipc_callid_t iid, ipc_call_t *icall,
     1237    ddf_dev_t *dev)
    12381238{
    12391239        uint32_t icr = (uint32_t) IPC_GET_ARG2(*icall);
  • uspace/drv/nic/ne2k/ne2k.c

    r83f29e0 r8820544  
    122122};
    123123
    124 static void ne2k_interrupt_handler(ddf_dev_t *dev, ipc_callid_t iid,
    125         ipc_call_t *call);
     124static void ne2k_interrupt_handler(ipc_callid_t, ipc_call_t *, ddf_dev_t *);
    126125
    127126static int ne2k_register_interrupt(nic_t *nic_data)
     
    240239}
    241240
    242 void ne2k_interrupt_handler(ddf_dev_t *dev, ipc_callid_t iid, ipc_call_t *call)
     241void ne2k_interrupt_handler(ipc_callid_t iid, ipc_call_t *call, ddf_dev_t *dev)
    243242{
    244243        nic_t *nic_data = DRIVER_DATA(dev);
    245244        ne2k_interrupt(nic_data, IRQ_GET_ISR(*call), IRQ_GET_TSR(*call));
    246 
     245       
    247246        async_answer_0(iid, EOK);
    248247}
  • uspace/drv/nic/rtl8139/driver.c

    r83f29e0 r8820544  
    852852/** Handle device interrupt
    853853 *
    854  *  @param dev    The rtl8139 device
    855  *  @param iid    The IPC call id
    856  *  @param icall  The IPC call structure
    857  */
    858 static void rtl8139_interrupt_handler(ddf_dev_t *dev, ipc_callid_t iid,
    859     ipc_call_t *icall)
     854 * @param iid    The IPC call id
     855 * @param icall  The IPC call structure
     856 * @param dev    The rtl8139 device
     857 *
     858 */
     859static void rtl8139_interrupt_handler(ipc_callid_t iid, ipc_call_t *icall,
     860    ddf_dev_t *dev)
    860861{
    861862        assert(dev);
  • uspace/drv/nic/rtl8169/driver.c

    r83f29e0 r8820544  
    7676static int rtl8169_on_stopped(nic_t *nic_data);
    7777static void rtl8169_send_frame(nic_t *nic_data, void *data, size_t size);
    78 static void rtl8169_irq_handler(ddf_dev_t *dev, ipc_callid_t iid,
    79     ipc_call_t *icall);
     78static void rtl8169_irq_handler(ipc_callid_t iid, ipc_call_t *icall,
     79    ddf_dev_t *dev);
    8080static inline int rtl8169_register_int_handler(nic_t *nic_data);
    8181static inline void rtl8169_get_hwaddr(rtl8169_t *rtl8169, nic_address_t *addr);
     
    897897}
    898898
    899 static void rtl8169_irq_handler(ddf_dev_t *dev, ipc_callid_t iid,
    900     ipc_call_t *icall)
     899static void rtl8169_irq_handler(ipc_callid_t iid, ipc_call_t *icall,
     900    ddf_dev_t *dev)
    901901{
    902902        assert(dev);
Note: See TracChangeset for help on using the changeset viewer.