Changeset 3e53ab7 in mainline for kernel/genarch/src


Ignore:
Timestamp:
2008-11-28T19:33:10Z (17 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
7905360
Parents:
4c4ddbe9
Message:

Initial support for interrupt driven driver for ns16550.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/genarch/src/kbd/ns16550.c

    r4c4ddbe9 r3e53ab7  
    135135        sysinfo_set_item_val("kbd.address.virtual", NULL, port);
    136136
     137#ifdef CONFIG_NS16550_INTERRUPT_DRIVEN
     138        /* Enable interrupts */
     139        ns16550_ier_write(&ns16550, IER_ERBFI);
     140        ns16550_mcr_write(&ns16550, MCR_OUT2);
     141#endif
     142
    137143#ifdef ia64
    138144        uint8_t c;
     
    150156void ns16550_interrupt(void)
    151157{
    152         /* TODO
    153          *
    154          * ns16550 works in the polled mode so far.
    155          */
     158        ns16550_poll();
    156159}
    157160
     
    202205void ns16550_poll(void)
    203206{
     207#ifndef CONFIG_NS16550_INTERRUPT_DRIVEN
    204208        ipl_t ipl;
    205209
     
    221225        spinlock_unlock(&ns16550_irq.lock);
    222226        interrupts_restore(ipl);
     227#endif
    223228
    224229        while (ns16550_lsr_read(&ns16550) & LSR_DATA_READY) {
     
    252257void ns16550_irq_handler(irq_t *irq, void *arg, ...)
    253258{
    254         panic("Not yet implemented, ns16550 works in polled mode.\n");
     259        if (irq->notif_cfg.notify && irq->notif_cfg.answerbox)
     260                ipc_irq_send_notif(irq);
     261        else
     262                ns16550_interrupt();
    255263}
    256264
Note: See TracChangeset for help on using the changeset viewer.