Changeset dc22844 in mainline


Ignore:
Timestamp:
2009-02-20T16:44:32Z (16 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
5c06c1c
Parents:
7aef7ee
Message:

Embed the ns16550 irq structure into the ns16550 instance structure.

Location:
kernel/genarch
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • kernel/genarch/include/kbd/ns16550.h

    r7aef7ee rdc22844  
    6666        devno_t devno;
    6767        ns16550_t *ns16550;
    68         irq_t *irq;
     68        irq_t irq;
    6969} ns16550_instance_t;
    7070
  • kernel/genarch/src/kbd/ns16550.c

    r7aef7ee rdc22844  
    105105{
    106106        ns16550_instance_t *instance;
    107         irq_t *irq;
    108107
    109108        chardev_initialize("ns16550_kbd", &kbrd, &ops);
     
    114113                return false;
    115114
    116         irq = malloc(sizeof(irq_t), FRAME_ATOMIC);
    117         if (!irq) {
    118                 free(instance);
    119                 return false;
    120         }
    121 
    122115        instance->devno = devno;
    123116        instance->ns16550 = dev;
    124         instance->irq = irq;
    125117       
    126         irq_initialize(irq);
    127         irq->devno = devno;
    128         irq->inr = inr;
    129         irq->claim = ns16550_claim;
    130         irq->handler = ns16550_irq_handler;
    131         irq->instance = instance;
    132         irq->cir = cir;
    133         irq->cir_arg = cir_arg;
    134         irq_register(irq);
     118        irq_initialize(&instance->irq);
     119        instance->irq.devno = devno;
     120        instance->irq.inr = inr;
     121        instance->irq.claim = ns16550_claim;
     122        instance->irq.handler = ns16550_irq_handler;
     123        instance->irq.instance = instance;
     124        instance->irq.cir = cir;
     125        instance->irq.cir_arg = cir_arg;
     126        irq_register(&instance->irq);
    135127
    136         ns16550_irq = irq;      /* TODO: remove me soon */
     128        ns16550_irq = &instance->irq;   /* TODO: remove me soon */
    137129       
    138         while ((pio_read_8(&dev->lsr) & LSR_DATA_READY)) 
     130        while ((pio_read_8(&dev->lsr) & LSR_DATA_READY))
    139131                (void) pio_read_8(&dev->rbr);
    140132       
Note: See TracChangeset for help on using the changeset viewer.