Changeset cea12e9 in mainline for kernel/arch/ia32/src/drivers/i8254.c


Ignore:
Timestamp:
2006-10-27T11:13:13Z (18 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
16d71f41
Parents:
8c84448
Message:

ia32: adopt new IRQ interface, mouse not tested yet

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/ia32/src/drivers/i8254.c

    r8c84448 rcea12e9  
    5050#include <arch.h>
    5151#include <time/delay.h>
    52 #include <interrupt.h>
     52#include <ddi/irq.h>
     53#include <ddi/device.h>
    5354
    5455#define CLK_PORT1       0x40
     
    5859#define MAGIC_NUMBER    1194
    5960
    60 static void i8254_interrupt(int n, istate_t *istate);
     61static irq_t i8254_irq;
     62
     63static irq_ownership_t i8254_claim(void)
     64{
     65        return IRQ_ACCEPT;
     66}
     67
     68static void i8254_irq_handler(irq_t *irq, void *arg, ...)
     69{
     70        clock();
     71}
    6172
    6273void i8254_init(void)
    6374{
     75        irq_initialize(&i8254_irq);
     76        i8254_irq.devno = device_assign_devno();
     77        i8254_irq.inr = IRQ_CLK;
     78        i8254_irq.claim = i8254_claim;
     79        i8254_irq.handler = i8254_irq_handler;
     80        irq_register(&i8254_irq);
     81       
    6482        i8254_normal_operation();
    6583}
     
    6886{
    6987        outb(CLK_PORT4, 0x36);
    70         pic_disable_irqs(1<<IRQ_CLK);
    71         outb(CLK_PORT1, (CLK_CONST/HZ) & 0xf);
    72         outb(CLK_PORT1, (CLK_CONST/HZ) >> 8);
    73         pic_enable_irqs(1<<IRQ_CLK);
    74         exc_register(VECTOR_CLK, "i8254_clock", (iroutine) i8254_interrupt);
     88        pic_disable_irqs(1 << IRQ_CLK);
     89        outb(CLK_PORT1, (CLK_CONST / HZ) & 0xf);
     90        outb(CLK_PORT1, (CLK_CONST / HZ) >> 8);
     91        pic_enable_irqs(1 << IRQ_CLK);
    7592}
    7693
     
    130147}
    131148
    132 void i8254_interrupt(int n, istate_t *istate)
    133 {
    134         trap_virtual_eoi();
    135         clock();
    136 }
    137 
    138149/** @}
    139150 */
Note: See TracChangeset for help on using the changeset viewer.