Changeset 60744cb in mainline for uspace/drv/char/ns8250/ns8250.c


Ignore:
Timestamp:
2024-05-17T17:51:56Z (12 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/char/ns8250/ns8250.c

    r646849b3 r60744cb  
    783783 * data and reading the line status register.
    784784 *
    785  * @param dev The serial port device.
    786  *
    787  */
    788 static inline void ns8250_interrupt_handler(ipc_call_t *icall, ddf_dev_t *dev)
    789 {
    790         ns8250_t *ns = dev_ns8250(dev);
     785 * @pram icall IRQ event notificatoin
     786 * @param arg Argument (ns8250_t *)
     787 */
     788static inline void ns8250_interrupt_handler(ipc_call_t *icall, void *arg)
     789{
     790        ns8250_t *ns = (ns8250_t *)arg;
    791791        uint8_t iir = pio_read_8(&ns->regs->iid);
    792792        if ((iir & NS8250_IID_CAUSE_MASK) == NS8250_IID_CAUSE_RXSTATUS) {
     
    809809{
    810810        return register_interrupt_handler(ns->dev, ns->irq,
    811             ns8250_interrupt_handler, NULL, ihandle);
     811            ns8250_interrupt_handler, (void *)ns, NULL, ihandle);
    812812}
    813813
Note: See TracChangeset for help on using the changeset viewer.