Changeset 26e51609 in mainline


Ignore:
Timestamp:
2009-02-21T21:53:25Z (16 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
e7abb0e
Parents:
d063365
Message:

Remove unneeded stuff from kernel's ns16550 driver.

File:
1 edited

Legend:

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

    rd063365 r26e51609  
    4141#include <arch/drivers/kbd.h>
    4242#include <ddi/irq.h>
    43 #include <ipc/irq.h>
    4443#include <cpu.h>
    4544#include <arch/asm.h>
     
    5554#define LSR_DATA_READY  0x01
    5655
    57 static irq_t *ns16550_irq;
    58 
    5956/*
    6057 * These codes read from ns16550 data register are silently ignored.
     
    6966        .resume = ns16550_resume,
    7067};
    71 
    72 /** Initialize keyboard and service interrupts using kernel routine */
    73 void ns16550_grab(void)
    74 {
    75         ipl_t ipl = interrupts_disable();
    76         spinlock_lock(&ns16550_irq->lock);
    77         ns16550_irq->notif_cfg.notify = false;
    78         spinlock_unlock(&ns16550_irq->lock);
    79         interrupts_restore(ipl);
    80 }
    81 
    82 /** Resume the former interrupt vector */
    83 void ns16550_release(void)
    84 {
    85         ipl_t ipl = interrupts_disable();
    86         spinlock_lock(&ns16550_irq->lock);
    87         if (ns16550_irq->notif_cfg.answerbox)
    88                 ns16550_irq->notif_cfg.notify = true;
    89         spinlock_unlock(&ns16550_irq->lock);
    90         interrupts_restore(ipl);
    91 }
    9268
    9369/** Initialize ns16550.
     
    126102        irq_register(&instance->irq);
    127103
    128         ns16550_irq = &instance->irq;   /* TODO: remove me soon */
    129        
    130104        while ((pio_read_8(&dev->lsr) & LSR_DATA_READY))
    131105                (void) pio_read_8(&dev->rbr);
    132106       
     107        /*
     108         * This is the necessary evil until the userspace driver is entirely
     109         * self-sufficient.
     110         */
    133111        sysinfo_set_item_val("kbd", NULL, true);
    134112        sysinfo_set_item_val("kbd.type", NULL, KBD_NS16550);
     
    141119        pio_write_8(&dev->ier, IER_ERBFI);
    142120        pio_write_8(&dev->mcr, MCR_OUT2);
    143        
    144         ns16550_grab();
    145121       
    146122        return true;
     
    170146void ns16550_irq_handler(irq_t *irq)
    171147{
    172         if (irq->notif_cfg.notify && irq->notif_cfg.answerbox) {
    173                 /*
    174                  * This will hopefully go to the IRQ dispatch code soon.
    175                  */
    176                 ipc_irq_send_notif(irq);
    177                 return;
    178         }
    179 
    180148        ns16550_instance_t *ns16550_instance = irq->instance;
    181149        ns16550_t *dev = ns16550_instance->ns16550;
Note: See TracChangeset for help on using the changeset viewer.